tag and set private tips

This commit is contained in:
wangchuxiao 2022-04-01 15:59:49 +08:00
parent 77c6120014
commit 2b03b57b5c
2 changed files with 12 additions and 6 deletions

View File

@ -46,7 +46,11 @@ func GetUserTags(c *gin.Context) {
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
resp.Data.Tags = respPb.Tags
if respPb.Tags != nil {
resp.Data.Tags = respPb.Tags
} else {
resp.Data.Tags = []*pbOffice.Tag{}
}
c.JSON(http.StatusOK, resp)
}
@ -229,7 +233,11 @@ func GetTagSendLogs(c *gin.Context) {
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
resp.Data.Logs = respPb.TagSendLogs
if respPb.TagSendLogs != nil {
resp.Data.Logs = respPb.TagSendLogs
} else {
resp.Data.Logs = []*pbOffice.TagSendLog{}
}
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
c.JSON(http.StatusOK, resp)

View File

@ -70,9 +70,8 @@ func (s *officeServer) GetUserTags(_ context.Context, req *pbOffice.GetUserTagsR
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req ", req.String())
resp = &pbOffice.GetUserTagsResp{
CommonResp: &pbOffice.CommonResp{},
//Tags: []*pbOffice.Tag{},
Tags: []*pbOffice.Tag{},
}
resp.Tags = make([]*pbOffice.Tag, 0)
tags, err := db.DB.GetUserTags(req.UserID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error())
@ -217,9 +216,8 @@ func (s *officeServer) GetTagSendLogs(_ context.Context, req *pbOffice.GetTagSen
CurrentPage: req.Pagination.PageNumber,
ShowNumber: req.Pagination.ShowNumber,
},
//TagSendLogs: []*pbOffice.TagSendLog{},
TagSendLogs: []*pbOffice.TagSendLog{},
}
resp.TagSendLogs = make([]*pbOffice.TagSendLog, 0)
tagSendLogs, err := db.DB.GetTagSendLogs(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagSendLogs", err.Error())