work_moments

This commit is contained in:
wangchuxiao 2022-04-25 10:07:14 +08:00
parent 30df45ef2e
commit bccaf16343
2 changed files with 2 additions and 3 deletions

View File

@ -201,8 +201,7 @@ func GetWorkMomentByID(c *gin.Context) {
if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}
//resp.Data.WorkMoment = respPb.WorkMoment
resp.Data.WorkMoment = &apiStruct.WorkMoment{}
resp.Data.WorkMoment = &apiStruct.WorkMoment{LikeUserList: []*apiStruct.WorkMomentUser{}, Comments: []*apiStruct.Comment{}, AtUserList: []*apiStruct.WorkMomentUser{}}
if err := utils.CopyStructFields(&resp.Data.WorkMoment, respPb.WorkMoment); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
}

View File

@ -73,7 +73,7 @@ func init() {
cCommentMsgModels := []mongo.IndexModel{
{
Keys: bson.M{"create_time": -1, "user_id": -1},
Keys: bson.A{bson.D{{"create_time", -1}, {"user_id", -1}}},
},
}
result, err := dataBase.Collection(cCommentMsg).Indexes().CreateMany(context.Background(), cCommentMsgModels, opts)