by Robin at 20240711

This commit is contained in:
Leufolium 2024-07-11 15:43:23 +08:00
parent b4418e23bb
commit 3af5833d73
3 changed files with 21 additions and 4 deletions

View File

@ -41,7 +41,7 @@ func (s *Service) CreateUpdateAccountImageAudit(ctx *gin.Context, oldAccount *db
func (s *Service) CreateUpdateStreamerImageAudit(ctx *gin.Context, oldStreamer *dbstruct.Streamer, newStreamer *dbstruct.Streamer) (tasks []*dbstruct.ImageAuditTask) {
tasks = make([]*dbstruct.ImageAuditTask, 0)
if newStreamer.Cover != nil && util.IsInt64SliceEqualAsSet(oldStreamer.Cover.GetImageIds(), newStreamer.Cover.GetImageIds()) {
if newStreamer.Cover != nil && !util.IsInt64SliceEqualAsSet(oldStreamer.Cover.GetImageIds(), newStreamer.Cover.GetImageIds()) {
tasks = append(tasks, &dbstruct.ImageAuditTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
AssociativeDatabase: goproto.String("streamer"),
@ -53,7 +53,7 @@ func (s *Service) CreateUpdateStreamerImageAudit(ctx *gin.Context, oldStreamer *
})
}
if newStreamer.Album != nil && oldStreamer.Cover != nil && util.IsInt64SliceEqualAsSet(oldStreamer.Album.GetImageIds(), newStreamer.Album.GetImageIds()) {
if newStreamer.Album != nil && !util.IsInt64SliceEqualAsSet(oldStreamer.Album.GetImageIds(), newStreamer.Album.GetImageIds()) {
tasks = append(tasks, &dbstruct.ImageAuditTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
AssociativeDatabase: goproto.String("streamer"),

View File

@ -18,6 +18,9 @@ func (s *Service) CreateUpdateAccountTextAudit(ctx *gin.Context, oldAccount *dbs
if newAccount.Name == nil {
return
}
if oldAccount.GetName() == newAccount.GetName() {
return
}
tasks = append(tasks, &dbstruct.TextAuditTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
@ -37,7 +40,7 @@ func (s *Service) CreateUpdateAccountTextAudit(ctx *gin.Context, oldAccount *dbs
func (s *Service) CreateUpdateStreamerTextAudit(ctx *gin.Context, oldStreamer *dbstruct.Streamer, newStreamer *dbstruct.Streamer) (tasks []*dbstruct.TextAuditTask) {
tasks = make([]*dbstruct.TextAuditTask, 0)
if newStreamer.Bio != nil {
if newStreamer.Bio != nil && oldStreamer.GetBio() != newStreamer.GetBio() {
tasks = append(tasks, &dbstruct.TextAuditTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
@ -50,7 +53,7 @@ func (s *Service) CreateUpdateStreamerTextAudit(ctx *gin.Context, oldStreamer *d
})
}
if newStreamer.AutoResponseMessage != nil {
if newStreamer.AutoResponseMessage != nil && oldStreamer.GetAutoResponseMessage() != newStreamer.GetAutoResponseMessage() {
tasks = append(tasks, &dbstruct.TextAuditTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),

View File

@ -33,3 +33,17 @@ func (p *Streamer) GetMid() int64 {
}
return *p.Mid
}
func (p *Streamer) GetBio() string {
if p == nil || p.Bio == nil {
return ""
}
return *p.Bio
}
func (p *Streamer) GetAutoResponseMessage() string {
if p == nil || p.AutoResponseMessage == nil {
return ""
}
return *p.AutoResponseMessage
}