Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
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
hujiebin
hilo-group
Commits
5bce9bff
Commit
5bce9bff
authored
Mar 13, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
申请加入家族
parent
cc0ffcd3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
group_power_apply.go
domain/model/groupPower_m/group_power_apply.go
+2
-2
group_power.go
route/group_power_r/group_power.go
+22
-3
No files found.
domain/model/groupPower_m/group_power_apply.go
View file @
5bce9bff
...
@@ -43,8 +43,8 @@ func GetGroupPowerApplyJoin(model *domain.Model, userId, familyId uint64) (*Grou
...
@@ -43,8 +43,8 @@ func GetGroupPowerApplyJoin(model *domain.Model, userId, familyId uint64) (*Grou
return
res
,
nil
return
res
,
nil
}
}
func
AcceptGroupPowerApplyJoinById
(
model
*
domain
.
Model
,
id
uint64
)
error
{
func
OptGroupPowerApplyJoinById
(
model
*
domain
.
Model
,
id
uint64
,
optType
int
)
error
{
err
:=
model
.
Db
.
Exec
(
"update group_power_apply_join set is_accept =
1 where id=?"
,
id
)
.
Error
err
:=
model
.
Db
.
Exec
(
"update group_power_apply_join set is_accept =
? where id=?"
,
optType
,
id
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
return
myerr
.
WrapErr
(
err
)
return
myerr
.
WrapErr
(
err
)
}
}
...
...
route/group_power_r/group_power.go
View file @
5bce9bff
...
@@ -895,8 +895,9 @@ func GroupPowerApplyJoin(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -895,8 +895,9 @@ func GroupPowerApplyJoin(c *gin.Context) (*mycontext.MyContext, error) {
}
}
// @Tags 家族
// @Tags 家族
// @Summary 批准加入家族
// @Summary 审核加入家族申请
// @Param userExtId query string false "用户extId"
// @Param userExtId formData string false "用户extId"
// @Param type formData int true "1.通过,2.不通过"
// @Success 200
// @Success 200
// @Router /v1/groupPower/passApply [post]
// @Router /v1/groupPower/passApply [post]
func
GroupPowerApplyPass
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
func
GroupPowerApplyPass
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
...
@@ -905,6 +906,14 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -905,6 +906,14 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
myContext
,
err
return
myContext
,
err
}
}
optType
,
err
:=
strconv
.
Atoi
(
c
.
PostForm
(
"type"
))
if
err
!=
nil
{
return
myContext
,
bizerr
.
InvalidParameter
}
if
optType
<
1
||
optType
>
2
{
return
myContext
,
bizerr
.
InvalidParameter
}
model
:=
domain
.
CreateModelContext
(
myContext
)
model
:=
domain
.
CreateModelContext
(
myContext
)
// 判断是否加入了家族
// 判断是否加入了家族
...
@@ -929,6 +938,16 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -929,6 +938,16 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
bizerr
.
GroupPowerHaveNoApply
return
myContext
,
bizerr
.
GroupPowerHaveNoApply
}
}
if
optType
==
2
{
// 拒绝
// 更改申请表状态
err
=
groupPower_m
.
OptGroupPowerApplyJoinById
(
model
,
apply
.
Id
,
optType
)
if
err
!=
nil
{
return
myContext
,
err
}
resp
.
ResponseOk
(
c
,
nil
)
return
myContext
,
nil
}
err
=
model
.
Transaction
(
func
(
model
*
domain
.
Model
)
error
{
err
=
model
.
Transaction
(
func
(
model
*
domain
.
Model
)
error
{
txModel
:=
domain
.
CreateModel
(
model
.
CtxAndDb
)
txModel
:=
domain
.
CreateModel
(
model
.
CtxAndDb
)
// 插入家族成员表
// 插入家族成员表
...
@@ -939,7 +958,7 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -939,7 +958,7 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
return
err
return
err
}
}
// 更改申请表状态
// 更改申请表状态
err
=
groupPower_m
.
AcceptGroupPowerApplyJoinById
(
model
,
apply
.
Id
)
err
=
groupPower_m
.
OptGroupPowerApplyJoinById
(
model
,
apply
.
Id
,
optType
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
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