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
916acd72
Commit
916acd72
authored
Apr 23, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
家族小助手
parent
28fd870d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
group_power.go
domain/service/group_power_s/group_power.go
+34
-0
group_power.go
route/group_power_r/group_power.go
+4
-1
No files found.
domain/service/group_power_s/group_power.go
View file @
916acd72
...
@@ -4,11 +4,14 @@ import (
...
@@ -4,11 +4,14 @@ import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/utils"
"hilo-group/_const/enum/groupPower_e"
"hilo-group/_const/enum/groupPower_e"
"hilo-group/cv/group_power_cv"
"hilo-group/cv/group_power_cv"
"hilo-group/domain/event/group_power_ev"
"hilo-group/domain/event/group_power_ev"
"hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/msg_m"
"hilo-group/domain/model/noble_m"
"hilo-group/domain/model/noble_m"
"hilo-group/domain/model/user_m"
)
)
type
GroupPowerService
struct
{
type
GroupPowerService
struct
{
...
@@ -93,3 +96,34 @@ func GetGroupPowerMaxMemberNum(model *domain.Model, familyId uint64, groupPowerG
...
@@ -93,3 +96,34 @@ func GetGroupPowerMaxMemberNum(model *domain.Model, familyId uint64, groupPowerG
}
}
return
return
}
}
// 检查需不需要通知用户拉取家族小助手消息
func
CheckoutSendMsgToMgr
(
myContext
*
mycontext
.
MyContext
,
groupPowerId
uint64
)
{
defer
utils
.
CheckGoPanic
()
model
:=
domain
.
CreateModelContext
(
myContext
)
//// 申请人数
//cnt, err := groupPower_m.CountGroupPowerApply(model, groupPowerId, 0)
//if err != nil {
// model.Log.Errorf("CheckoutSendMsgToMgr err:%v, id:%v", err, groupPowerId)
// return
//}
//if cnt <= 0 {
// return
//}
// 找到家族管理员们
mgrList
,
err
:=
groupPower_m
.
GetGroupPowerMgrList
(
model
,
groupPowerId
)
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"CheckoutSendMsgToMgr err:%v, id:%v"
,
err
,
groupPowerId
)
return
}
userMap
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
mgrList
)
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"CheckoutSendMsgToMgr err:%v, id:%v"
,
err
,
groupPowerId
)
return
}
for
_
,
v
:=
range
mgrList
{
if
user
,
ok
:=
userMap
[
v
];
ok
{
msg_m
.
SendEmasMsgAssistant
(
model
,
user
.
ExternalId
,
user
.
DeviceType
)
}
}
}
route/group_power_r/group_power.go
View file @
916acd72
...
@@ -1099,6 +1099,8 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -1099,6 +1099,8 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
err
return
myContext
,
err
}
}
resp
.
ResponseOk
(
c
,
nil
)
resp
.
ResponseOk
(
c
,
nil
)
// 家族小助手通知
go
group_power_s
.
CheckoutSendMsgToMgr
(
myContext
,
myGroupPUser
.
GroupPowerId
)
return
myContext
,
nil
return
myContext
,
nil
}
}
// 判断家族是否满人了
// 判断家族是否满人了
...
@@ -1156,6 +1158,8 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -1156,6 +1158,8 @@ func GroupPowerApplyPass(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"GroupPowerApplyPass msg err:%v"
,
err
)
model
.
Log
.
Errorf
(
"GroupPowerApplyPass msg err:%v"
,
err
)
}
}
// 家族小助手通知
go
group_power_s
.
CheckoutSendMsgToMgr
(
myContext
,
myGroupPUser
.
GroupPowerId
)
resp
.
ResponseOk
(
c
,
nil
)
resp
.
ResponseOk
(
c
,
nil
)
return
myContext
,
nil
return
myContext
,
nil
...
@@ -1590,7 +1594,6 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -1590,7 +1594,6 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
myContext
,
myerr
.
WrapErr
(
err
)
return
myContext
,
myerr
.
WrapErr
(
err
)
}
}
groupPowerGrade
,
err
:=
groupPower_m
.
MGetGroupPowerGrade
(
model
,
[]
mysql
.
ID
{
gp
.
ID
})
gradeM
,
err
:=
groupPower_m
.
MGetGroupPowerGrade
(
model
,
[]
mysql
.
ID
{
gp
.
ID
})
gradeM
,
err
:=
groupPower_m
.
MGetGroupPowerGrade
(
model
,
[]
mysql
.
ID
{
gp
.
ID
})
if
err
!=
nil
{
if
err
!=
nil
{
return
myContext
,
err
return
myContext
,
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