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
b308b069
Commit
b308b069
authored
Jun 05, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp
parent
92b6d007
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
cp_relation.go
domain/service/cp_s/cp_relation.go
+8
-0
cp_relation.go
route/cp_r/cp_relation.go
+7
-0
No files found.
domain/service/cp_s/cp_relation.go
View file @
b308b069
...
...
@@ -27,6 +27,10 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return
err
}
if
userInvite
.
ID
==
myUserId
{
return
bizerr
.
InvalidParameter
}
// 自己是否有cp了
myCp
,
err
:=
cp_m
.
GetCp
(
model
,
myUserId
)
if
err
!=
nil
{
...
...
@@ -100,6 +104,10 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return
err
}
if
userRec
.
ID
==
myUserId
{
return
bizerr
.
InvalidParameter
}
// 自己没有cp了
myCp
,
err
:=
cp_m
.
GetCp
(
model
,
myUserId
)
if
err
!=
nil
{
...
...
route/cp_r/cp_relation.go
View file @
b308b069
...
...
@@ -126,6 +126,9 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
return
myCtx
,
err
}
if
userSender
.
ID
==
myUserId
{
return
myCtx
,
bizerr
.
InvalidParameter
}
cpRecord
,
err
:=
cp_m
.
GetCpInvite
(
model
,
userSender
.
ID
,
user
.
ID
,
cp_e
.
CpInvite
)
if
err
!=
nil
{
...
...
@@ -253,6 +256,10 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
return
myCtx
,
err
}
if
user2
.
ID
==
myUserId
{
return
myCtx
,
bizerr
.
InvalidParameter
}
cpCancel
,
err
:=
cp_m
.
GetCpCancel
(
model
,
[]
uint64
{
myUser
.
ID
,
user2
.
ID
},
cp_e
.
CpCancel
)
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"ReplyCpCancel myUser:%d, user2:%d, err:%v"
,
myUser
.
ID
,
user2
.
ID
,
err
)
...
...
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