From bc0f15f77e878139d55ac3e190d9ea0b26720952 Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Tue, 28 Mar 2023 13:38:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=BB=E4=BD=9C?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=88=97=E8=A1=A8=E7=9A=84=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/artistinfo_artwork.go | 13 ++++-- pb/artistInfoArtwork/artistinfoArtwork.pb.go | 40 ++++++++++++++----- .../artistinfoArtwork.pb.validate.go | 4 +- pb/artistinfoArtwork.proto | 4 +- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/cmd/internal/dao/artistinfo_artwork.go b/cmd/internal/dao/artistinfo_artwork.go index f858b0b..dcaeee4 100644 --- a/cmd/internal/dao/artistinfo_artwork.go +++ b/cmd/internal/dao/artistinfo_artwork.go @@ -10,6 +10,8 @@ import ( "context" "errors" "fmt" + "time" + "github.com/fonchain/fonchain-artistinfo/cmd/model" "github.com/fonchain/fonchain-artistinfo/pb/artistInfoArtwork" "github.com/fonchain/fonchain-artistinfo/pb/artwork_query" @@ -17,7 +19,6 @@ import ( "github.com/fonchain/fonchain-artistinfo/pkg/service" "github.com/fonchain/fonchain-artistinfo/pkg/util/stime" "gorm.io/gorm" - "time" ) func CreateArtworkLockRecord(in *model.ArtworkLockRecord) error { @@ -142,8 +143,14 @@ func GetArtworkLockRecords(req *artistInfoArtwork.GetArtworkLockRecordsRequest) case artistInfoArtwork.ArtworkQueryMode_AllAuditPassArtwork: //所有审核通过的画作 tx = tx.Where("supplement_audit_status = 4").Order("lock_time desc") } - if req.AuditStatus != 0 { - tx = tx.Where("audit_status = ?", req.AuditStatus) + if req.BaseAuditStatus != 0 { + tx = tx.Where("base_audit_status = ?", req.BaseAuditStatus) + } + if req.SupplementAuditStatus != 0 { + tx = tx.Where("supplement_audit_status = ?", req.SupplementAuditStatus) + } + if len(req.ArtworkUids) > 0 { + tx = tx.Where("artwork_uid in ?", req.ArtworkUids) } err = tx.Find(&datas).Error for _, v := range datas { diff --git a/pb/artistInfoArtwork/artistinfoArtwork.pb.go b/pb/artistInfoArtwork/artistinfoArtwork.pb.go index 3ff72b1..4d395bb 100644 --- a/pb/artistInfoArtwork/artistinfoArtwork.pb.go +++ b/pb/artistInfoArtwork/artistinfoArtwork.pb.go @@ -362,9 +362,11 @@ type GetArtworkLockRecordsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ArtistUid string `protobuf:"bytes,1,opt,name=artistUid,proto3" json:"artistUid,omitempty"` //画家uid - QueryType ArtworkQueryMode `protobuf:"varint,2,opt,name=queryType,proto3,enum=artistinfo.ArtworkQueryMode" json:"queryType,omitempty"` //查询模式 - AuditStatus int64 `protobuf:"varint,3,opt,name=AuditStatus,proto3" json:"AuditStatus,omitempty"` //审批状态 可选 + ArtistUid string `protobuf:"bytes,1,opt,name=artistUid,proto3" json:"artistUid,omitempty"` //画家uid + QueryType ArtworkQueryMode `protobuf:"varint,2,opt,name=queryType,proto3,enum=artistinfo.ArtworkQueryMode" json:"queryType,omitempty"` //查询模式 + BaseAuditStatus int64 `protobuf:"varint,3,opt,name=baseAuditStatus,proto3" json:"baseAuditStatus,omitempty"` //基本信息审批状态 可选 + SupplementAuditStatus int64 `protobuf:"varint,4,opt,name=supplementAuditStatus,proto3" json:"supplementAuditStatus,omitempty"` //基本信息审批状态 可选 + ArtworkUids []string `protobuf:"bytes,5,rep,name=artworkUids,proto3" json:"artworkUids,omitempty"` //画作uid列表 } func (x *GetArtworkLockRecordsRequest) Reset() { @@ -413,13 +415,27 @@ func (x *GetArtworkLockRecordsRequest) GetQueryType() ArtworkQueryMode { return ArtworkQueryMode_Non } -func (x *GetArtworkLockRecordsRequest) GetAuditStatus() int64 { +func (x *GetArtworkLockRecordsRequest) GetBaseAuditStatus() int64 { if x != nil { - return x.AuditStatus + return x.BaseAuditStatus } return 0 } +func (x *GetArtworkLockRecordsRequest) GetSupplementAuditStatus() int64 { + if x != nil { + return x.SupplementAuditStatus + } + return 0 +} + +func (x *GetArtworkLockRecordsRequest) GetArtworkUids() []string { + if x != nil { + return x.ArtworkUids + } + return nil +} + type ArtistLockInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1595,7 +1611,7 @@ var file_pb_artistinfoArtwork_proto_rawDesc = []byte{ 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, - 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, + 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x86, 0x02, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0xe9, 0xc0, @@ -1603,9 +1619,15 @@ var file_pb_artistinfoArtwork_proto_rawDesc = []byte{ 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, - 0x6f, 0x64, 0x65, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x41, 0x75, 0x64, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0b, 0x41, 0x75, 0x64, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x6f, 0x64, 0x65, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, + 0x0a, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x41, 0x75, 0x64, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x41, 0x75, 0x64, + 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, + 0x0a, 0x0b, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x73, 0x22, 0xec, 0x04, 0x0a, 0x0e, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, diff --git a/pb/artistInfoArtwork/artistinfoArtwork.pb.validate.go b/pb/artistInfoArtwork/artistinfoArtwork.pb.validate.go index e4ac39d..31347e7 100644 --- a/pb/artistInfoArtwork/artistinfoArtwork.pb.validate.go +++ b/pb/artistInfoArtwork/artistinfoArtwork.pb.validate.go @@ -587,7 +587,9 @@ func (m *GetArtworkLockRecordsRequest) validate(all bool) error { // no validation rules for QueryType - // no validation rules for AuditStatus + // no validation rules for BaseAuditStatus + + // no validation rules for SupplementAuditStatus if len(errors) > 0 { return GetArtworkLockRecordsRequestMultiError(errors) diff --git a/pb/artistinfoArtwork.proto b/pb/artistinfoArtwork.proto index cc18fa2..34297d6 100644 --- a/pb/artistinfoArtwork.proto +++ b/pb/artistinfoArtwork.proto @@ -54,7 +54,9 @@ enum ArtworkQueryMode { message GetArtworkLockRecordsRequest{ string artistUid =1 [(validate.rules).message.required = true];//画家uid ArtworkQueryMode queryType =2 ; //查询模式 - int64 AuditStatus =3; //审批状态 可选 + int64 baseAuditStatus =3; //基本信息审批状态 可选 + int64 supplementAuditStatus =4; //基本信息审批状态 可选 + repeated string artworkUids=5; //画作uid列表 } message ArtistLockInfo{ From 4dd5ff48da568e53868c9f1385db75be710c100b Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Tue, 28 Mar 2023 13:51:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/artistinfo_artshow_video.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/internal/dao/artistinfo_artshow_video.go b/cmd/internal/dao/artistinfo_artshow_video.go index d8044fb..2ec3b55 100644 --- a/cmd/internal/dao/artistinfo_artshow_video.go +++ b/cmd/internal/dao/artistinfo_artshow_video.go @@ -8,6 +8,7 @@ package dao import ( "errors" + "github.com/fonchain/fonchain-artistinfo/cmd/model" "github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow" db "github.com/fonchain/fonchain-artistinfo/pkg/db" @@ -75,10 +76,12 @@ func (a artistinfoArtshowVideo) GetDataList(req *artistinfoArtshow.GetArtshowVid tx = tx.Where("lock_time = ?", req.LockTime) } if req.ArtistName != "" { - tx = tx.Clauses(clause.Like{ - Column: "artist_name", - Value: "%" + req.ArtistName + "%", - }) + // tx = tx.Clauses(clause.Like{ + // Column: "artist_name", + // Value: "%" + req.ArtistName + "%", + // }) + var searchName = "%" + req.ArtistName + "%" + tx = tx.Where("artist_name LIKE ? OR artist_uid LIKE ?", searchName, searchName) } if req.Status != 0 { tx = tx.Where("status = ?", req.Status) From a7bdbf39a1317f354e3ff24b0d997c7fc5cbb928 Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Tue, 28 Mar 2023 14:01:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96url=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/artistinfo_artshow_video.go | 1 - cmd/model/artshow_video.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/internal/dao/artistinfo_artshow_video.go b/cmd/internal/dao/artistinfo_artshow_video.go index 2ec3b55..d2bcad1 100644 --- a/cmd/internal/dao/artistinfo_artshow_video.go +++ b/cmd/internal/dao/artistinfo_artshow_video.go @@ -13,7 +13,6 @@ import ( "github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow" db "github.com/fonchain/fonchain-artistinfo/pkg/db" "gorm.io/gorm" - "gorm.io/gorm/clause" ) var ArtistinfoArtshowVideo = new(artistinfoArtshowVideo) diff --git a/cmd/model/artshow_video.go b/cmd/model/artshow_video.go index 9bf0cd6..bbff871 100644 --- a/cmd/model/artshow_video.go +++ b/cmd/model/artshow_video.go @@ -15,7 +15,7 @@ type ArtshowVideoRecord struct { //AccountId int64 `json:"accountId" gorm:"column:account_id;comment:"` ArtistName string `json:"artistName" gorm:"column:artist_name;comment:"` - VideoUrl string `json:"videoUrl" gorm:"column:video_url;comment:"` + VideoUrl string `json:"videoUrl" gorm:"column:video_url;type:varchar(2000);comment:"` //审批字段 AuditStatus AuditStatus `json:"auditStatus" gorm:"column:audit_status;comment:审核状态:2= 待审核,3= 审核失败,4= 审核通过,5= 待补充"`