From b8d9f1a496d3f8b7e640066d426ed1e6daa95d35 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Fri, 10 Mar 2023 15:09:49 +0800 Subject: [PATCH] test handelr --- route/group_power_r/inner.go | 21 +++++++++++++++++++++ route/router.go | 1 + 2 files changed, 22 insertions(+) diff --git a/route/group_power_r/inner.go b/route/group_power_r/inner.go index 3e6fbc6..707fdda 100644 --- a/route/group_power_r/inner.go +++ b/route/group_power_r/inner.go @@ -4,10 +4,14 @@ import ( "git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/resource/mysql" + "git.hilo.cn/hilo-common/sdk/emas" "github.com/gin-gonic/gin" "hilo-group/_const/enum/groupPower_e" + "hilo-group/_const/enum/msg_e" "hilo-group/cv/group_power_cv" "hilo-group/domain/model/groupPower_m" + "hilo-group/domain/model/msg_m" + "hilo-group/domain/model/user_m" "hilo-group/resp" ) @@ -67,3 +71,20 @@ func MGetGroupPowers(c *gin.Context) (*mycontext.MyContext, error) { resp.ResponseOk(c, response) return myCtx, nil } + +func Test(c *gin.Context) (*mycontext.MyContext, error) { + var model = domain.CreateModelNil() + if err := msg_m.NewUserRecord(model, 4522, msg_e.GroupPowerUserLeave, "frozen", 4522, "", "", "", "", "").Persistent(); err != nil { + return nil, err + } + mgrUser, _ := user_m.GetUser(model, 4522) + err := msg_m.SendEmasMsgAssistant(model, mgrUser.ExternalId, mgrUser.DeviceType) + if err != nil { + return nil, err + } + err = emas.SendIosMsgAll("全部消息测试") + if err != nil { + return nil, err + } + return nil, nil +} diff --git a/route/router.go b/route/router.go index ebd2854..564bb1d 100644 --- a/route/router.go +++ b/route/router.go @@ -136,6 +136,7 @@ func InitRouter() *gin.Engine { { innerGroupPower.GET("/infos", wrapper(group_power_r.MGetGroupPowers)) } + r.GET("/test", wrapper(group_power_r.Test)) return r } -- 2.22.0