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
e7b378bf
Commit
e7b378bf
authored
Jun 05, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp im
parent
2afef13c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
cp_relation.go
domain/model/cp_m/cp_relation.go
+3
-0
cp_relation.go
domain/service/cp_s/cp_relation.go
+2
-0
cp_relation.go
route/cp_r/cp_relation.go
+1
-0
No files found.
domain/model/cp_m/cp_relation.go
View file @
e7b378bf
...
...
@@ -29,6 +29,7 @@ type CpInvite struct {
type
CpInviteMessage
struct
{
Identifier
string
`json:"identifier"`
Msg
string
`json:"msg"`
Tip
string
`json:"tip"`
Sender
*
user_m
.
UserTiny
`json:"sender"`
}
...
...
@@ -36,6 +37,7 @@ type CpInviteMessage struct {
type
CpAcceptInviteMessage
struct
{
Identifier
string
`json:"identifier"`
Msg
string
`json:"msg"`
Tip
string
`json:"tip"`
Sender
*
user_m
.
UserTiny
`json:"sender"`
Receiver
*
user_m
.
UserTiny
`json:"receiver"`
}
...
...
@@ -58,6 +60,7 @@ type CpCancel struct {
type
CpCancelMessage
struct
{
Identifier
string
`json:"identifier"`
Msg
string
`json:"msg"`
Tip
string
`json:"tip"`
Sender
*
user_m
.
UserTiny
`json:"sender"`
}
...
...
domain/service/cp_s/cp_relation.go
View file @
e7b378bf
...
...
@@ -75,6 +75,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
data
,
_
:=
json
.
Marshal
(
cp_m
.
CpInviteMessage
{
Identifier
:
"CpInviteMessage"
,
Msg
:
"Do you want to be CP with me?"
,
Tip
:
"24 hours automatic expiration"
,
Sender
:
user_m
.
ToUserTiny
(
user
),
})
if
err
:=
tencentyun
.
BatchSendCustomMsg
(
model
,
1
,
user
.
ExternalId
,
[]
string
{
userInvite
.
ExternalId
},
string
(
data
),
"cp邀请"
);
err
!=
nil
{
...
...
@@ -146,6 +147,7 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
data
,
_
:=
json
.
Marshal
(
cp_m
.
CpCancelMessage
{
Identifier
:
"CpCancelMessage"
,
Msg
:
"I want to unbind the CP relationship"
,
Tip
:
"24 hours automatic expiration"
,
Sender
:
user_m
.
ToUserTiny
(
user
),
})
if
err
:=
tencentyun
.
BatchSendCustomMsg
(
model
,
1
,
user
.
ExternalId
,
[]
string
{
userRec
.
ExternalId
},
string
(
data
),
"cp解除"
);
err
!=
nil
{
...
...
route/cp_r/cp_relation.go
View file @
e7b378bf
...
...
@@ -198,6 +198,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
msgData
,
_
=
json
.
Marshal
(
cp_m
.
CpAcceptInviteMessage
{
Identifier
:
"CpAcceptInviteMessage"
,
Msg
:
"We are already CP!"
,
Tip
:
fmt
.
Sprintf
(
"Celebration gifts have been sent to %s's backpack"
,
userSender
.
Code
),
Sender
:
user_m
.
ToUserTiny
(
userSender
),
Receiver
:
user_m
.
ToUserTiny
(
user
),
})
...
...
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