diff --git a/app/mix/service/imageauditservice.go b/app/mix/service/imageauditservice.go index 291aa462..9166bda6 100644 --- a/app/mix/service/imageauditservice.go +++ b/app/mix/service/imageauditservice.go @@ -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"), diff --git a/app/mix/service/textauditservice.go b/app/mix/service/textauditservice.go index 7bb9335b..c7b08cbb 100644 --- a/app/mix/service/textauditservice.go +++ b/app/mix/service/textauditservice.go @@ -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), diff --git a/dbstruct/streamer.go b/dbstruct/streamer.go index 9d7dfcf9..41d61527 100644 --- a/dbstruct/streamer.go +++ b/dbstruct/streamer.go @@ -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 +}