feat-IRONFANS-212-Robin #919

Merged
chenhao merged 2 commits from feat-IRONFANS-212-Robin into test 2024-12-19 15:07:28 +08:00
4 changed files with 26 additions and 11 deletions

View File

@ -6742,11 +6742,11 @@ func (m *Mongo) GetNotifRecentReceive(ctx *gin.Context, id string) (recentReceiv
func (m *Mongo) GetAndUpdateNotifRecentReceive(ctx *gin.Context, id string, upd *dbstruct.NotifRecentReceive) (recentReceive *dbstruct.NotifRecentReceive, err error) {
col := m.getColNotifRecentReceive()
// 如果库中最近接收时间小于目标接收时间,则认为应该更新
// 如果库中最近接收时间小于等于目标接收时间,则认为应该更新(等于的情况以后更新为准)
filter := qmgo.M{
"_id": id,
"rt": qmgo.M{
"$lt": upd.Rt,
"$lte": upd.Rt,
},
}
@ -6761,7 +6761,11 @@ func (m *Mongo) GetAndUpdateNotifRecentReceive(ctx *gin.Context, id string, upd
}
recentReceiveInstance := dbstruct.NotifRecentReceive{}
if err = col.Find(ctx, filter).Apply(change, &recentReceiveInstance); err != nil {
err = col.Find(ctx, filter).Apply(change, &recentReceiveInstance)
if qmgo.IsDup(err) {
err = nil
}
if err != nil {
logger.Error("change error : %v", err)
return
}

View File

@ -3347,6 +3347,7 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
req.ZoneMoment.ManuallyReviewOpinion = goproto.String("") // 信息抹除
req.ZoneMoment.ManuallyReviewOperator = goproto.Int64(0) // 信息抹除
req.ZoneMoment.IsReedited = goproto.Int64(consts.IsReedited_Yes) // 已重新编辑
req.ZoneMoment.ReeditTime = goproto.Int64(time.Now().Unix())
}
err = _DefaultZoneMoment.OpUpdate(ctx, &zonemomentproto.OpUpdateReq{

View File

@ -175,8 +175,10 @@ func (handler *NotifBuilderHandler) handleSyncNotifBcstVersForUser() {
func (handler *NotifBuilderHandler) handleSyncNotifBcstVersForStreamer() {
handler.handlerMap[consts.CtrlNotifTemp_SyncNotifBcstVersForStreamer] = func(ctx *gin.Context, args ...any) {
account := args[0].(*dbstruct.Account)
DefaultService.utilWriteNotifInfo(ctx, consts.CtrlNotifTemp_SyncNotifBcstVersForStreamer, account.GetMid())
mids := args[0].([]int64)
for _, mid := range mids {
DefaultService.utilWriteNotifInfo(ctx, consts.CtrlNotifTemp_SyncNotifBcstVersForStreamer, mid)
}
}
}
@ -515,14 +517,14 @@ func (handler *NotifBuilderHandler) handleAudProfileChangeApplied() {
func (handler *NotifBuilderHandler) handleAudProfilePassed() {
handler.handlerMap[consts.AudNotifTemp_ProfilePassed] = func(ctx *gin.Context, args ...any) {
task := args[0].(*dbstruct.ImageAuditTask)
task := args[0].(*dbstruct.TextAuditTask)
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ProfilePassed, task.GetMid())
}
}
func (handler *NotifBuilderHandler) handleAudProfileRejected() {
handler.handlerMap[consts.AudNotifTemp_ProfileRejected] = func(ctx *gin.Context, args ...any) {
task := args[0].(*dbstruct.ImageAuditTask)
task := args[0].(*dbstruct.TextAuditTask)
remarks := args[1].(string)
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ProfileRejected, task.GetMid(), remarks)
}
@ -651,10 +653,10 @@ func (handler *NotifBuilderHandler) handleAudZoneMomentReeditionPassed() {
if zonemoment.GetIsReedited() != consts.IsReedited_Yes {
return
}
ctStr := util.FormatTsAsNotifT(zonemoment.GetCt())
reeditTimeStr := util.FormatTsAsNotifT(zonemoment.GetReeditTime())
cTypeDesc := consts.ZoneMomentCTypeDescMap[zonemoment.GetCType()]
mTypeDesc := consts.MTypeDescMap[zonemoment.GetMType()]
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ZoneMomentReeditionPassed, zonemoment.GetMid(), ctStr, cTypeDesc, mTypeDesc)
DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ZoneMomentReeditionPassed, zonemoment.GetMid(), reeditTimeStr, cTypeDesc, mTypeDesc)
}
}
@ -680,11 +682,11 @@ func (handler *NotifBuilderHandler) handleAudZoneMomentReeditionRejected() {
preview.ImageIds = util.Int64Slice(coverIds)
}
ctStr := util.FormatTsAsNotifT(zonemoment.GetCt())
reeditTimeStr := util.FormatTsAsNotifT(zonemoment.GetReeditTime())
cTypeDesc := consts.ZoneMomentCTypeDescMap[zonemoment.GetCType()]
mTypeDesc := consts.MTypeDescMap[zonemoment.GetMType()]
argsMap := make(map[string]any)
argsMap["template_params"] = []any{ctStr, cTypeDesc, mTypeDesc, remarks}
argsMap["template_params"] = []any{reeditTimeStr, cTypeDesc, mTypeDesc, remarks}
argsMap["thumbnail"] = preview
argsMap["build_hyperlink"] = DefaultService.utilBuildInwardHyperLink
argsMap["hyperlink_params_map"] = util.NewHyperLinkParamsMapBuilder().NewEnds("app", "h5").WriteParamToAllEnd("id", zonemoment.GetId()).Map()

View File

@ -31,6 +31,7 @@ type ZoneMoment struct {
ManuallyReviewOperator *int64 `json:"manually_review_operator" bson:"manually_review_operator"` // 人工复审操作人
IsHeaded *int64 `json:"is_headed" bson:"is_headed"` // 是否已置顶
IsReedited *int64 `json:"is_reedited" bson:"is_reedited"` // 是否已重新编辑
ReeditTime *int64 `json:"reedit_time" bson:"reedit_time"` // 重新编辑时间
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
@ -146,6 +147,13 @@ func (p *ZoneMoment) GetIsReedited() int64 {
return 0
}
func (p *ZoneMoment) GetReeditTime() int64 {
if p != nil && p.ReeditTime != nil {
return *p.ReeditTime
}
return 0
}
type ZoneMomentStatInfo struct {
Mid *int64 `json:"id" bson:"_id"` // mid
Count *int64 `json:"count" bson:"count"` // count