diff --git a/api/cast/cast.pb.go b/api/cast/cast.pb.go index a748115..5a69de1 100644 --- a/api/cast/cast.pb.go +++ b/api/cast/cast.pb.go @@ -653,6 +653,7 @@ type UpdateMediaAccountReq struct { ManagerUuid string `protobuf:"bytes,8,opt,name=managerUuid,proto3" json:"managerUuid"` ManagerUserName string `protobuf:"bytes,9,opt,name=managerUserName,proto3" json:"managerUserName"` ArtistPhoneAreaCode string `protobuf:"bytes,10,opt,name=artistPhoneAreaCode,proto3" json:"artistPhoneAreaCode"` + ArtistSubNum string `protobuf:"bytes,11,opt,name=artistSubNum,proto3" json:"artistSubNum"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -757,6 +758,13 @@ func (x *UpdateMediaAccountReq) GetArtistPhoneAreaCode() string { return "" } +func (x *UpdateMediaAccountReq) GetArtistSubNum() string { + if x != nil { + return x.ArtistSubNum + } + return "" +} + type UpdateMediaAccountResp struct { state protoimpl.MessageState `protogen:"open.v1"` MediaAccountUuid string `protobuf:"bytes,1,opt,name=mediaAccountUuid,proto3" json:"mediaAccountUuid"` @@ -12168,7 +12176,7 @@ const file_pb_fiee_cast_proto_rawDesc = "" + "authStatus\"R\n" + "\x11MediaUserListResp\x12'\n" + "\x04data\x18\x01 \x03(\v2\x13.Cast.MediaUserInfoR\x04data\x12\x14\n" + - "\x05count\x18\x02 \x01(\x03R\x05count\"\xad\x03\n" + + "\x05count\x18\x02 \x01(\x03R\x05count\"\xd1\x03\n" + "\x15UpdateMediaAccountReq\x124\n" + "\n" + "platformID\x18\x01 \x01(\x0e2\x14.Cast.PlatformIDENUMR\n" + @@ -12186,7 +12194,8 @@ const file_pb_fiee_cast_proto_rawDesc = "" + "\vmanagerUuid\x18\b \x01(\tR\vmanagerUuid\x12(\n" + "\x0fmanagerUserName\x18\t \x01(\tR\x0fmanagerUserName\x120\n" + "\x13artistPhoneAreaCode\x18\n" + - " \x01(\tR\x13artistPhoneAreaCode\"D\n" + + " \x01(\tR\x13artistPhoneAreaCode\x12\"\n" + + "\fartistSubNum\x18\v \x01(\tR\fartistSubNum\"D\n" + "\x16UpdateMediaAccountResp\x12*\n" + "\x10mediaAccountUuid\x18\x01 \x01(\tR\x10mediaAccountUuid\">\n" + "\x10UnbindManagerReq\x12*\n" + diff --git a/api/cast/cast.pb.validate.go b/api/cast/cast.pb.validate.go index 550ab24..9f8a915 100644 --- a/api/cast/cast.pb.validate.go +++ b/api/cast/cast.pb.validate.go @@ -457,6 +457,8 @@ func (m *UpdateMediaAccountReq) validate(all bool) error { // no validation rules for ArtistPhoneAreaCode + // no validation rules for ArtistSubNum + if len(errors) > 0 { return UpdateMediaAccountReqMultiError(errors) } diff --git a/pkg/service/cast/media.go b/pkg/service/cast/media.go index a2a7ec3..05a6209 100644 --- a/pkg/service/cast/media.go +++ b/pkg/service/cast/media.go @@ -140,8 +140,6 @@ func UpdateMediaAccount(ctx *gin.Context) { service.Error(ctx, errors.New("用户不存在")) return } - - //TODO 判断是否注册ay if err = CheckAsProfile(infoResp); err != nil { service.Error(ctx, err) return @@ -149,6 +147,7 @@ func UpdateMediaAccount(ctx *gin.Context) { req.ArtistName = infoResp.Name req.ArtistPhone = infoResp.TelNum req.ArtistPhoneAreaCode = infoResp.TelAreaCode + req.ArtistSubNum = infoResp.SubNum if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok { service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams))) return diff --git a/pkg/service/check/security.go b/pkg/service/check/security.go index 8c5b371..b048f51 100644 --- a/pkg/service/check/security.go +++ b/pkg/service/check/security.go @@ -54,15 +54,15 @@ func ImageCheckByte(file *multipart.FileHeader) (bool, error) { return false, nil } -func SecurityFile(fileUrl string) (bool, error) { - if fileUrl == "" { +func SecurityFile(textVal string) (bool, error) { + if textVal == "" { return true, nil } var fileInfo modelSecurity.FileInfo - fileInfo.FileName = fileUrl - fileInfo.FileUrl = fileUrl + fileInfo.FileName = textVal + fileInfo.FileUrl = textVal //获取文件名称后缀 - extension := filepath.Ext(fileUrl) + extension := filepath.Ext(textVal) switch extension { case ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp": fileInfo.FileType = "image" @@ -189,3 +189,25 @@ func handleImageScan(config *security.Config, fileInfo *modelSecurity.FileInfo) } return nil } + +func handleTextScan(config *security.Config, textVal string) (err error) { + fmt.Println("\n=== 图片内容安全审核 ===") + + scanner, err := security.NewTextScanner(config) + if err != nil { + fmt.Printf("创建扫描器失败:%v", err) + return errors.New("创建扫描器失败") + } + + serviceType := security.TextBaselineCheckGlobal + + fmt.Println("正在扫描图片...") + result, err := scanner.ScanText(textVal, "image_"+time.Now().Format("20060102150405"), serviceType) + if err != nil { + fmt.Printf("扫描失败: %v\n", err) + return errors.New("扫描失败") + } + scanner.PrintResult(result) + fmt.Println(result) + return nil +}