conflict-test-feat-20240117-001 #88
|
@ -74,3 +74,10 @@ const (
|
||||||
Feedback_Invalid = 3 //无效
|
Feedback_Invalid = 3 //无效
|
||||||
Feedback_RelatedToIteration = 4 //迭代相关
|
Feedback_RelatedToIteration = 4 //迭代相关
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 动态表status状态
|
||||||
|
const (
|
||||||
|
Moment_Private = 0 //仅自己可见
|
||||||
|
Moment_OpenToCircles = 1 //仅朋友圈可见
|
||||||
|
Moment_Public = 2 //公开
|
||||||
|
)
|
||||||
|
|
|
@ -56,3 +56,20 @@ func (s *Service) CreateUpdateStreamerImageAudit(ctx *gin.Context, oldStreamer *
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Service) CreateMomentImageAudit(ctx *gin.Context, newMoment *dbstruct.Moment) (tasks []*dbstruct.ImageAuditTask) {
|
||||||
|
|
||||||
|
if newMoment.MediaComp != nil {
|
||||||
|
tasks = append(tasks, &dbstruct.ImageAuditTask{
|
||||||
|
RouteUrl: goproto.String(ctx.Request.URL.Path),
|
||||||
|
AssociativeDatabase: goproto.String("moment"),
|
||||||
|
AssociativeTableName: goproto.String("moment"),
|
||||||
|
AssociativeTableId: newMoment.Id,
|
||||||
|
AssociativeTableColumn: goproto.String("media_component"),
|
||||||
|
AuditedMedia: newMoment.MediaComp,
|
||||||
|
OldMedia: nil,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
@ -4,11 +4,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"service/api/consts"
|
"service/api/consts"
|
||||||
accountproto "service/api/proto/account/proto"
|
accountproto "service/api/proto/account/proto"
|
||||||
|
momentproto "service/api/proto/moment/proto"
|
||||||
streamerproto "service/api/proto/streamer/proto"
|
streamerproto "service/api/proto/streamer/proto"
|
||||||
"service/bizcommon/util"
|
"service/bizcommon/util"
|
||||||
"service/dbstruct"
|
"service/dbstruct"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
goproto "google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var DefaultImageAuditTaskResultHandler *ImageAuditTaskResultHandler
|
var DefaultImageAuditTaskResultHandler *ImageAuditTaskResultHandler
|
||||||
|
@ -34,6 +36,7 @@ func (handler *ImageAuditTaskResultHandler) initImageAuditTaskUpdateFuncGenerato
|
||||||
handler.generateAccountAvatarUpdateFunc()
|
handler.generateAccountAvatarUpdateFunc()
|
||||||
handler.generateStreamerCoverUpdateFunc()
|
handler.generateStreamerCoverUpdateFunc()
|
||||||
handler.generateStreamerAlbumUpdateFunc()
|
handler.generateStreamerAlbumUpdateFunc()
|
||||||
|
handler.generateMomentMediaComponentUpdateFunc()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (handler *ImageAuditTaskResultHandler) getImageAuditTaskUpdateFunc(ctx *gin.Context, task *dbstruct.ImageAuditTask, option int) func() error {
|
func (handler *ImageAuditTaskResultHandler) getImageAuditTaskUpdateFunc(ctx *gin.Context, task *dbstruct.ImageAuditTask, option int) func() error {
|
||||||
|
@ -112,3 +115,24 @@ func (handler *ImageAuditTaskResultHandler) generateStreamerAlbumUpdateFunc() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 动态表->图像内容,若不通过,则将状态设置为仅自己可见
|
||||||
|
func (handler *ImageAuditTaskResultHandler) generateMomentMediaComponentUpdateFunc() {
|
||||||
|
handler.imageAuditTaskUpdateFuncGeneratorMap["moment|moment|media_component"] = func(ctx *gin.Context, task *dbstruct.ImageAuditTask, option int) func() error {
|
||||||
|
return func() error {
|
||||||
|
momentId := task.AssociativeTableId
|
||||||
|
var status int64
|
||||||
|
if option == consts.ImageAuditTaskUpdate_Pass {
|
||||||
|
status = consts.Moment_Public
|
||||||
|
} else {
|
||||||
|
status = consts.Moment_Private
|
||||||
|
}
|
||||||
|
return _DefaultMoment.OpUpdate(ctx, &momentproto.OpUpdateReq{
|
||||||
|
Moment: &dbstruct.Moment{
|
||||||
|
Id: momentId,
|
||||||
|
Status: goproto.Int64(status),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -58,3 +58,20 @@ func (s *Service) CreateUpdateStreamerTextAudit(ctx *gin.Context, oldStreamer *d
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Service) CreateMomentTextAudit(ctx *gin.Context, newMoment *dbstruct.Moment) (tasks []*dbstruct.TextAuditTask) {
|
||||||
|
|
||||||
|
if newMoment.Text != nil {
|
||||||
|
tasks = append(tasks, &dbstruct.TextAuditTask{
|
||||||
|
RouteUrl: goproto.String(ctx.Request.URL.Path),
|
||||||
|
AssociativeDatabase: goproto.String("moment"),
|
||||||
|
AssociativeTableName: goproto.String("moment"),
|
||||||
|
AssociativeTableId: newMoment.Id,
|
||||||
|
AssociativeTableColumn: goproto.String("text"),
|
||||||
|
AuditedText: newMoment.Text,
|
||||||
|
OldText: nil,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
@ -4,11 +4,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"service/api/consts"
|
"service/api/consts"
|
||||||
accountproto "service/api/proto/account/proto"
|
accountproto "service/api/proto/account/proto"
|
||||||
|
momentproto "service/api/proto/moment/proto"
|
||||||
streamerproto "service/api/proto/streamer/proto"
|
streamerproto "service/api/proto/streamer/proto"
|
||||||
"service/bizcommon/util"
|
"service/bizcommon/util"
|
||||||
"service/dbstruct"
|
"service/dbstruct"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
goproto "google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var DefaultTextAuditTaskResultHandler *TextAuditTaskResultHandler
|
var DefaultTextAuditTaskResultHandler *TextAuditTaskResultHandler
|
||||||
|
@ -34,6 +36,7 @@ func (handler *TextAuditTaskResultHandler) initTextAuditTaskUpdateFuncGeneratorM
|
||||||
handler.generateAccountNameUpdateFunc()
|
handler.generateAccountNameUpdateFunc()
|
||||||
handler.generateStreamerBioUpdateFunc()
|
handler.generateStreamerBioUpdateFunc()
|
||||||
handler.generateStreamerAutoResponseMessageUpdateFunc()
|
handler.generateStreamerAutoResponseMessageUpdateFunc()
|
||||||
|
handler.generateMomentTextUpdateFunc()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (handler *TextAuditTaskResultHandler) getTextAuditTaskUpdateFunc(ctx *gin.Context, task *dbstruct.TextAuditTask, option int) func() error {
|
func (handler *TextAuditTaskResultHandler) getTextAuditTaskUpdateFunc(ctx *gin.Context, task *dbstruct.TextAuditTask, option int) func() error {
|
||||||
|
@ -112,3 +115,24 @@ func (handler *TextAuditTaskResultHandler) generateStreamerAutoResponseMessageUp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 动态表->文字内容,若不通过,则将状态设置为仅自己可见
|
||||||
|
func (handler *TextAuditTaskResultHandler) generateMomentTextUpdateFunc() {
|
||||||
|
handler.textAuditTaskUpdateFuncGeneratorMap["moment|moment|text"] = func(ctx *gin.Context, task *dbstruct.TextAuditTask, option int) func() error {
|
||||||
|
return func() error {
|
||||||
|
momentId := task.AssociativeTableId
|
||||||
|
var status int64
|
||||||
|
if option == consts.ImageAuditTaskUpdate_Pass {
|
||||||
|
status = consts.Moment_Public
|
||||||
|
} else {
|
||||||
|
status = consts.Moment_Private
|
||||||
|
}
|
||||||
|
return _DefaultMoment.OpUpdate(ctx, &momentproto.OpUpdateReq{
|
||||||
|
Moment: &dbstruct.Moment{
|
||||||
|
Id: momentId,
|
||||||
|
Status: goproto.Int64(status),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue