Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenweijian
hilo-user
Commits
f485a21a
Commit
f485a21a
authored
Jun 05, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp
parent
0f6ba56f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
cp_relation.go
domain/model/cp_m/cp_relation.go
+8
-1
cp_relation.go
domain/service/cp_s/cp_relation.go
+2
-2
cp_relation.go
route/cp_r/cp_relation.go
+7
-7
No files found.
domain/model/cp_m/cp_relation.go
View file @
f485a21a
...
...
@@ -56,9 +56,16 @@ type CpCancel struct {
// 发送私信(解除)
type
CpCancelMessage
struct
{
Identifier
string
`json:"identifier"`
Msg
string
`json:"msg"`
Sender
*
user_m
.
UserTiny
`json:"sender"`
}
// 发送私信-撤销解除、接受解除
type
CpDealCancelMessage
struct
{
Identifier
string
`json:"identifier"`
Msg
string
`json:"msg"`
Status
uint8
`json:"status"`
//1.
发起解除2.撤销解除3
.接受解除
Status
uint8
`json:"status"`
//1.
撤销解除2
.接受解除
}
type
Cp
struct
{
...
...
domain/service/cp_s/cp_relation.go
View file @
f485a21a
...
...
@@ -142,11 +142,11 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
model
.
Log
.
Errorf
(
"CancelCpRelation myUserId:%d, err:%v"
,
myUserId
,
err
)
return
err
}
// 发送私信
// 发送私信
-发起解除
data
,
_
:=
json
.
Marshal
(
cp_m
.
CpCancelMessage
{
Identifier
:
"CpCancelMessage"
,
Msg
:
"I want to unbind the CP relationship"
,
S
tatus
:
1
,
S
ender
:
user_m
.
ToUserTiny
(
user
)
,
})
if
err
:=
tencentyun
.
BatchSendCustomMsg
(
model
,
1
,
user
.
ExternalId
,
[]
string
{
userRec
.
ExternalId
},
string
(
data
),
"cp解除"
);
err
!=
nil
{
model
.
Log
.
Errorf
(
"CancelCpRelation BatchSendCustomMsg fail:%v"
,
err
)
...
...
route/cp_r/cp_relation.go
View file @
f485a21a
...
...
@@ -294,10 +294,10 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
var
msgData
[]
byte
if
optType
==
1
{
// 撤销解除
// 私信
msgData
,
_
=
json
.
Marshal
(
cp_m
.
CpCancelMessage
{
Identifier
:
"CpCancelMessage"
,
msgData
,
_
=
json
.
Marshal
(
cp_m
.
Cp
Deal
CancelMessage
{
Identifier
:
"Cp
Deal
CancelMessage"
,
Msg
:
fmt
.
Sprintf
(
"%s withdrew my application to lift CP"
,
myUser
.
Nick
),
Status
:
2
,
Status
:
1
,
})
}
else
{
// 接受解除
// 删除cp关系表的记录
...
...
@@ -306,11 +306,11 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
model
.
Log
.
Errorf
(
"ReplyCpCancel myUser:%d, user2:%d, status:%d, err:%v"
,
myUser
.
ID
,
user2
.
ID
,
updateStatus
,
err
)
return
err
}
// 私信
msgData
,
_
=
json
.
Marshal
(
cp_m
.
CpCancelMessage
{
Identifier
:
"CpCancelMessage"
,
// 私信
-接受解除
msgData
,
_
=
json
.
Marshal
(
cp_m
.
Cp
Deal
CancelMessage
{
Identifier
:
"Cp
Deal
CancelMessage"
,
Msg
:
"The CP relationship has been unbound, the CP value has been cleared, and the CP privilege has disappeared"
,
Status
:
3
,
Status
:
2
,
})
}
if
err
:=
tencentyun
.
BatchSendCustomMsg
(
model
,
1
,
myUser
.
ExternalId
,
[]
string
{
user2
.
ExternalId
},
string
(
msgData
),
"cp解除"
);
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment