2 Star 5 Fork 7

联犀/中台模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
service
apisvr
datasvr
syssvr
client
domain
etc
internal
config
logic
accessmanage
appmanage
areamanage
common
datamanage
dictmanage
log
modulemanage
notifymanage
ops
projectmanage
rolemanage
tenantmanage
usermanage
assemble.go
common.go
userAreaApplyCreateLogic.go
userCaptchaLogic.go
userChangePwdLogic.go
userChecktokenlogic.go
userCodeToUserIDLogic.go
userForgetPwdLogic.go
userInfoCreateLogic.go
userInfoDeleteLogic.go
userInfoIndexLogic.go
userInfoReadLogic.go
userInfoUpdateLogic.go
userLoginlogic.go
userMessageIndexLogic.go
userMessageMultiIsReadLogic.go
userMessageStatisticsLogic.go
userProfileIndexLogic.go
userProfileReadLogic.go
userProfileUpdateLogic.go
userRegisterLogic.go
userRoleIndexLogic.go
userRoleMultiCreateLogic.go
userRoleMultiUpdateLogic.go
assemble.go
assembleModule.go
assembleTenant.go
auth.go
menu.go
repo
server
startup
svc
pb/sys
proto
sysExport
sysdirect
sys.go
syssvr.exe
系统管理模块-syssvr.md
timed
viewsvr
README.md
shell
tools
.gitignore
.gitmodules
Dockerfile
LICENSE
Makefile
README.md
go.mod
go.sum
克隆/下载
userMessageStatisticsLogic.go 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 4个月前 . feat: 更新mod
package usermanagelogic
import (
"context"
"gitee.com/unitedrhino/core/service/syssvr/internal/repo/relationDB"
"gitee.com/unitedrhino/share/ctxs"
"gitee.com/unitedrhino/core/service/syssvr/internal/svc"
"gitee.com/unitedrhino/core/service/syssvr/pb/sys"
"github.com/zeromicro/go-zero/core/logx"
)
type UserMessageStatisticsLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewUserMessageStatisticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserMessageStatisticsLogic {
return &UserMessageStatisticsLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *UserMessageStatisticsLogic) UserMessageStatistics(in *sys.Empty) (*sys.UserMessageStatisticsResp, error) {
err := UpdateMsg(l.ctx, "", "")
if err != nil {
return nil, err
}
count, err := relationDB.NewUserMessageRepo(l.ctx).CountNotRead(l.ctx, ctxs.GetUserCtx(l.ctx).UserID)
if err != nil {
return nil, err
}
var list []*sys.UserMessageStatistics
for k, v := range count {
list = append(list, &sys.UserMessageStatistics{
Group: k,
Count: v,
})
}
return &sys.UserMessageStatisticsResp{List: list}, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/core.git
git@gitee.com:unitedrhino/core.git
unitedrhino
core
中台模块
v0.2.2

搜索帮助