service/app/mix/service/video_moderation_service.go

28 lines
903 B
Go

package service
import (
"service/api/consts"
"service/dbstruct"
"github.com/gin-gonic/gin"
goproto "google.golang.org/protobuf/proto"
)
func (s *Service) CreateZoneMomentVideoModeration(ctx *gin.Context, newZoneMoment *dbstruct.ZoneMoment) (tasks []*dbstruct.VideoModerationTask) {
if newZoneMoment.MediaComp != nil && len(newZoneMoment.MediaComp.GetVideoIds()) > 0 {
tasks = append(tasks, &dbstruct.VideoModerationTask{
RouteUrl: goproto.String(ctx.Request.URL.Path),
AssociativeDatabase: goproto.String("zone_moment"),
AssociativeTableName: goproto.String("zone_moment"),
AssociativeTableId: newZoneMoment.Id,
AssociativeTableColumn: goproto.String("media_component"),
AuditedMedia: newZoneMoment.MediaComp,
OldMedia: nil,
IsAligned: goproto.Int64(consts.VideoModerationIsAligned_Yes),
})
}
return
}