调整画展包列表
This commit is contained in:
parent
86919d74fd
commit
e51a1fcb2b
2
clear.sh
Normal file
2
clear.sh
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
ls pb/artShow/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';
|
@ -18,7 +18,7 @@ func (p *ArtShowProvider) CreateShow(ctx context.Context, req *artShow.SaveShowR
|
||||
err = errors.New(m.ERROR_SHOW_NAME)
|
||||
return nil, err
|
||||
}
|
||||
if req.ShowTime == "" {
|
||||
if req.CreateTime == "" {
|
||||
err = errors.New(m.ERROR_TIME)
|
||||
return nil, err
|
||||
}
|
||||
@ -162,3 +162,20 @@ func (p *ArtShowProvider) ShowListWithApply(ctx context.Context, req *artShow.Sh
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ShowListForArtwork(ctx context.Context, req *artShow.ShowListForArtworkReq) (res *artShow.ShowListForArtworkRes, err error) {
|
||||
if req.Page == 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
if req.PageSize == 0 {
|
||||
req.Page = 10
|
||||
}
|
||||
res = new(artShow.ShowListForArtworkRes)
|
||||
err, res = service.QueryArtShowForArtwork(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
err = errors.New(m.ERROR_QUERY)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/db"
|
||||
@ -37,38 +38,41 @@ func UpdateArtShow(tx *gorm.DB, artShow *model.ArtShow) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowList(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShow) {
|
||||
queryDB := db.DbArtShow.Model(&model.ArtShow{})
|
||||
func ArtShowList(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShowRes) {
|
||||
queryDB := db.DbArtShow.Table("art_show as a ").Distinct("a.id").
|
||||
Select("a.show_uid, a.show_seq, a.show_name, a.artist_name, a.artist_uid, a.artwork_num, a.ruler, a.price, a.create_time, a.is_show, c.address ,c.show_time").
|
||||
Joins("left join artwork_price as b on a.show_uid = b.show_uid").
|
||||
Joins("left join show_rel as c on a.show_uid = c.show_uid ")
|
||||
|
||||
if in.ArtistUID != "" {
|
||||
queryDB = queryDB.Where("artist_uid = ? ", in.ArtistUID)
|
||||
}
|
||||
if in.StartTime != "" && in.EndTime != "" {
|
||||
queryDB = queryDB.Where("convert(show_time, date) between ? and ?", in.StartTime, in.EndTime)
|
||||
if in.Name != "" {
|
||||
queryDB.Where(" a.artist_name like ? or a.show_name like ? or b.artwork_name like ? ", "%"+in.Name+"%", "%"+in.Name+"%", "%"+in.Name+"%")
|
||||
}
|
||||
if in.IsShow != 0 {
|
||||
queryDB = queryDB.Where("is_show = ?", in.IsShow)
|
||||
queryDB.Where(" a.is_show = ?", in.IsShow)
|
||||
}
|
||||
if in.StartTime != "" && in.EndTime != "" {
|
||||
queryDB.Where("convert(a.create_time, date) between ? and ?", in.StartTime, in.EndTime)
|
||||
}
|
||||
|
||||
err = queryDB.Count(&total).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowList Count err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
||||
out = make([]*model.ArtShow, 0)
|
||||
err = queryDB.Offset(int((in.Page - 1) * in.PageSize)).
|
||||
out = make([]*model.ArtShowRes, 0)
|
||||
err = queryDB.Where("a.deleted_at is null").Offset(int((in.Page - 1) * in.PageSize)).
|
||||
Limit(int(in.PageSize)).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowList Find err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
||||
err = queryDB.Where("a.deleted_at is null").Group("a.id").Count(&total).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowList Count err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowList_apply(applyUID string) (err error, out []*model.ArtShow) {
|
||||
out = make([]*model.ArtShow, 0)
|
||||
err = db.DbArtShow.Table("art_show as a ").Distinct("a.show_uid").Select("a.show_uid,a.show_seq,a.show_name,a.artist_name,a.artist_uid,a.artwork_num,a.ruler,a.price,a.reward,a.show_time,a.is_show").Joins(" right join show_rel as b on a.show_uid = b.show_uid").Where("b.apply_uid = ? ", applyUID).Find(&out).Error
|
||||
func ArtShowList_apply(applyUID string) (err error, out []*model.ArtShowRes) {
|
||||
out = make([]*model.ArtShowRes, 0)
|
||||
err = db.DbArtShow.Table("art_show as a ").Distinct("a.show_uid").Select("a.show_uid, a.show_seq, a.show_name, a.artist_name, a.artist_uid, a.artwork_num, a.ruler, a.price, a.reward, a.create_time, a.is_show, b.address ,b.show_time").Joins(" right join show_rel as b on a.show_uid = b.show_uid").Where("b.apply_uid = ? ", applyUID).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowList_apply Find err", zap.Error(err))
|
||||
return
|
||||
@ -76,18 +80,16 @@ func ArtShowList_apply(applyUID string) (err error, out []*model.ArtShow) {
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowListByApplyStatus(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShow) {
|
||||
out = make([]*model.ArtShow, 0)
|
||||
tx := db.DbArtShow.Table("art_show as a")
|
||||
|
||||
tx.Joins(" left join show_rel as b on b.show_uid = a.show_uid").Where("a.is_show = ?", in.IsShow)
|
||||
err = tx.Count(&total).Error
|
||||
func ArtShowListByApplyStatus(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShowRes) {
|
||||
out = make([]*model.ArtShowRes, 0)
|
||||
queryDB := db.DbArtShow.Table("art_show as a").Select("a.show_uid, a.show_seq, a.show_name, a.artist_name, a.artist_uid, a.artwork_num, a.ruler, a.price, a.create_time, a.is_show, b.address ,b.show_time").Joins(" left join show_rel as b on b.show_uid = a.show_uid").Where("a.is_show = ?", in.IsShow)
|
||||
err = queryDB.Count(&total).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowListByApplyStatus Count err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
||||
err = tx.Offset(int((in.Page - 1) * in.PageSize)).
|
||||
err = queryDB.Offset(int((in.Page - 1) * in.PageSize)).
|
||||
Limit(int(in.PageSize)).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowListByApplyStatus Find err", zap.Error(err))
|
||||
@ -105,12 +107,13 @@ func DelArtShow(tx *gorm.DB, show_uid string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func QueryArtShow(show_uid string) (err error, out *model.ArtShow) {
|
||||
err = db.DbArtShow.Model(&model.ArtShow{}).Where("show_uid = ?", show_uid).Find(&out).Error
|
||||
func QueryArtShow(show_uid string) (err error, out *model.ArtShowRes) {
|
||||
err = db.DbArtShow.Table("art_show as a ").Select("a.show_uid, a.show_seq, a.show_name, a.artist_name, a.artist_uid, a.artwork_num, a.ruler, a.price, a.create_time, a.is_show, b.address ,b.show_time").Joins("left join show_rel as b on a.show_uid = b.show_uid").Where("a.show_uid = ?", show_uid).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShow Find err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
fmt.Printf("%+v\n", out)
|
||||
return
|
||||
}
|
||||
|
||||
@ -138,17 +141,36 @@ func ShowStatistical(isShow int32) (err error, artistNum, packageNum, totalNum,
|
||||
}
|
||||
|
||||
NotShowNum = 0
|
||||
err = db.DbArtShow.Table("art_show as a").Distinct("a.artist_uid").Joins(" join artwork_price as b on b.show_uid = a.show_uid").Where("a.is_show in (1,2)").Count(&NotShowNum).Error
|
||||
err = db.DbArtShow.Table("art_show as a").Distinct("a.artist_uid").Joins(" join artwork_price as b on b.show_uid = a.show_uid").Where("a.is_show in (1,2) and a.deleted_at is null").Count(&NotShowNum).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ShowStatistical totalNum count err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
||||
ShowHisNum = 0
|
||||
err = db.DbArtShow.Table("art_show as a").Distinct("a.artist_uid").Joins(" join artwork_price as b on b.show_uid = a.show_uid").Where("a.is_show = 3 ").Count(&ShowHisNum).Error
|
||||
err = db.DbArtShow.Table("art_show as a").Distinct("a.artist_uid").Joins(" join artwork_price as b on b.show_uid = a.show_uid").Where("a.is_show = 3 and a.deleted_at is null").Count(&ShowHisNum).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ShowStatistical totalNum count err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func QueryArtShowForArtwork(in *artShow.ShowListForArtworkReq) (err error, total int64, out []*model.ArtShowRes) {
|
||||
// 查询 画家已出展 画展包
|
||||
queryDB := db.DbArtShow.Table("art_show as a ").Select("a.show_uid, a.show_seq, a.show_name, a.artist_name, a.artist_uid, a.artwork_num, a.ruler, a.price, a.create_time, a.is_show, b.address ,b.show_time").Joins("left join show_rel as b on a.show_uid = b.show_uid").Where("a.artist_uid = ? and a.is_show = ?", in.ArtistUID, 3)
|
||||
|
||||
err = queryDB.Count(&total).Error
|
||||
if err != nil {
|
||||
zap.L().Error("QueryArtShowForArtwork count err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
out = make([]*model.ArtShowRes, 0)
|
||||
err = queryDB.Offset(int((in.Page - 1) * in.PageSize)).
|
||||
Limit(int(in.PageSize)).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("QueryArtShowForArtwork err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -14,6 +14,22 @@ type ArtShow struct {
|
||||
Ruler int32 `json:"ruler" gorm:"ruler"` // 画作总平尺
|
||||
Price int64 `json:"price" gorm:"price"` // 画展包价格
|
||||
Reward int64 `json:"reward" gorm:"reward"` // 润格
|
||||
ShowTime string `json:"show_time" gorm:"show_time"` // 画展时间
|
||||
CreateTime string `json:"create_time" gorm:"create_time"` // 创建时间
|
||||
IsShow int8 `json:"is_show" gorm:"is_show"` // 是否出展 1,内部(default) 2,可展 3,已展
|
||||
}
|
||||
|
||||
type ArtShowRes struct {
|
||||
ShowUID string `json:"show_uid" gorm:"show_uid"`
|
||||
ShowSeq string `json:"show_seq" gorm:"show_seq"` // 画展包序列
|
||||
ShowName string `json:"show_name" gorm:"show_name"` // 画展包名称
|
||||
ArtistName string `json:"artist_name" gorm:"artist_name"` // 画家
|
||||
ArtistUID string `json:"artist_uid" gorm:"artist_uid"` // 画家ID
|
||||
ArtworkNum int32 `json:"artwork_num" gorm:"artwork_num"` // 画作数量
|
||||
Ruler int32 `json:"ruler" gorm:"ruler"` // 画作总平尺
|
||||
Price int64 `json:"price" gorm:"price"` // 画展包价格
|
||||
CreateTime string `json:"create_time" gorm:"create_time"` // 创建时间
|
||||
IsShow int8 `json:"is_show" gorm:"is_show"` // 是否出展 1,内部(default) 2,可展 3,已展
|
||||
|
||||
Address string `json:"address" gorm:"address"` // 地点
|
||||
ShowTime string `json:"show_time" gorm:"show_time"` // 时间
|
||||
}
|
||||
|
@ -13,6 +13,6 @@ type ShowApply struct {
|
||||
ApplicantID string `json:"applicant_id" gorm:"applicant_id"` // 申请人
|
||||
Num int32 `json:"num" gorm:"num"` // 申请画展包数量
|
||||
ApplyTime string `json:"apply_time" gorm:"apply_time"` // 申请时间
|
||||
Status int `json:"status" gorm:"status"` // 申请画展包状态 10,创建 11,数量审批 12,数量审批驳回 13,关联画展包 14,画展包关联审批 15,关联审批驳回 16,可展
|
||||
Status int `json:"status" gorm:"status"` // 申请画展包状态
|
||||
Remark string `json:"remark" gorm:"remark"` // 备注
|
||||
}
|
||||
|
@ -10,8 +10,5 @@ type ShowRel struct {
|
||||
ApplyUID string `json:"apply_uid" gorm:"show_uid"` // 申请ID
|
||||
Index int32 `json:"index" gorm:"index"` // 申请下标
|
||||
Address string `json:"address" gorm:"address"` // 参展地址
|
||||
//ShowSeq string `json:"show_seq" gorm:"show_seq"` // 画展包序列
|
||||
//ApplySeq string `json:"apply_seq" gorm:"apply_seq"` // 申请序列
|
||||
//Status int32 `json:"status" gorm:"status"` // 参展状态 1、待展 2、驳回 3、可展
|
||||
//Remark string `json:"remark" gorm:"remark"` // 备注
|
||||
ShowTime string `json:"show_time" gorm:"show_time"` // 画展时间
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
{"level":"ERROR","time":"2022-11-08T10:50:49.304+0800","caller":"dao/art_show.go:144","msg":"ShowStatistical totalNum count err","error":"Error 1054: Unknown column 'b.show_id' in 'on clause'"}
|
||||
{"level":"ERROR","time":"2022-11-08T10:56:33.377+0800","caller":"dao/art_show.go:144","msg":"ShowStatistical totalNum count err","error":"Error 1054: Unknown column 'b.artist_uid' in 'field list'"}
|
||||
{"level":"ERROR","time":"2022-11-08T16:51:33.241+0800","caller":"dao/art_show.go:73","msg":"ArtShowList_apply Find err","error":"Error 1054: Unknown column 'b.show_id' in 'on clause'"}
|
@ -22,14 +22,10 @@ func CreateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showUID
|
||||
return
|
||||
}
|
||||
|
||||
if len(in.ShowArtwork) > 0 {
|
||||
artworks := serializer.BuildShowArtworkM(in.ShowArtwork, artShowM.ShowUID)
|
||||
|
||||
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
||||
|
||||
err, artworks = serializer.CalcReward(artworks, artShowM.Reward)
|
||||
if err != nil {
|
||||
return
|
||||
if len(in.Artwork) > 0 {
|
||||
artworks := serializer.BuildShowArtworkM(in.Artwork, artShowM.ShowUID)
|
||||
if in.Price > 0 && in.Ruler > 0 {
|
||||
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
||||
}
|
||||
for i := 0; i < len(artworks); i++ {
|
||||
err = dao.SaveArtworkPrice(tx, artworks[i])
|
||||
@ -61,22 +57,16 @@ func UpdateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showUID
|
||||
}
|
||||
|
||||
// 判断是否有新增画作
|
||||
if len(in.ShowArtwork) > 0 {
|
||||
showArtwork := serializer.BuildShowArtworkM(in.ShowArtwork, in.ShowUID)
|
||||
if len(in.Artwork) > 0 {
|
||||
showArtwork := serializer.BuildShowArtworkM(in.Artwork, in.ShowUID)
|
||||
artworks = append(artworks, showArtwork...)
|
||||
}
|
||||
|
||||
// 更新 画作
|
||||
if len(artworks) > 0 {
|
||||
if in.Price != 0 {
|
||||
if in.Price > 0 && in.Ruler > 0 {
|
||||
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
||||
}
|
||||
if in.Reward != 0 {
|
||||
err, artworks = serializer.CalcReward(artworks, artShowM.Reward)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < len(artworks); i++ {
|
||||
if artworks[i].ArtworkPriceUID != "" {
|
||||
@ -97,10 +87,10 @@ func UpdateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showUID
|
||||
}
|
||||
|
||||
// 删除旧画作
|
||||
if len(in.DelShowArtwork) > 0 {
|
||||
if len(in.DelArtwork) > 0 {
|
||||
del := make([]string, 0)
|
||||
for i := 0; i < len(in.DelShowArtwork); i++ {
|
||||
del = append(del, in.DelShowArtwork[i].ArtworkPriceUID)
|
||||
for i := 0; i < len(in.DelArtwork); i++ {
|
||||
del = append(del, in.DelArtwork[i].ArtworkPriceUID)
|
||||
}
|
||||
err = dao.DelArtworkPrice(tx, del)
|
||||
if err != nil {
|
||||
@ -149,7 +139,7 @@ func DelArtShow(in *artShow.DelShowReq) (err error) {
|
||||
// 画展包列表
|
||||
func ArtShowList(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes) {
|
||||
out = new(artShow.ShowListRes)
|
||||
artShows := make([]*model.ArtShow, 0)
|
||||
artShows := make([]*model.ArtShowRes, 0)
|
||||
err, out.Total, artShows = dao.ArtShowList(in)
|
||||
if err != nil {
|
||||
return
|
||||
@ -177,7 +167,7 @@ func ShowArtworkInfo(in *artShow.ShowDetailReq) (err error, out *artShow.ShowArt
|
||||
// 画展包详情
|
||||
func ShowDetail(in *artShow.ShowDetailReq) (err error, out *artShow.ShowDetailRes) {
|
||||
out = new(artShow.ShowDetailRes)
|
||||
show := new(model.ArtShow)
|
||||
show := new(model.ArtShowRes)
|
||||
err, show = dao.QueryArtShow(in.ShowUID)
|
||||
if err != nil {
|
||||
return
|
||||
@ -188,7 +178,7 @@ func ShowDetail(in *artShow.ShowDetailReq) (err error, out *artShow.ShowDetailRe
|
||||
|
||||
func ArtShowListWithApply(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes) {
|
||||
out = new(artShow.ShowListRes)
|
||||
artShows := make([]*model.ArtShow, 0)
|
||||
artShows := make([]*model.ArtShowRes, 0)
|
||||
err, out.Total, artShows = dao.ArtShowListByApplyStatus(in)
|
||||
err, out.TotalArtistNum, out.TotalPackageNum, _, _, _ = dao.ShowStatistical(m.ARTSHOW_PASS)
|
||||
if err != nil {
|
||||
@ -206,3 +196,16 @@ func ShowStatisticalInfo(in *artShow.ShowStatisticalInfoReq) (err error, out *ar
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func QueryArtShowForArtwork(in *artShow.ShowListForArtworkReq) (err error, out *artShow.ShowListForArtworkRes) {
|
||||
out = new(artShow.ShowListForArtworkRes)
|
||||
err, total, shows := dao.QueryArtShowForArtwork(in)
|
||||
if err != nil {
|
||||
return err, out
|
||||
}
|
||||
if len(shows) > 0 {
|
||||
out.Total = total
|
||||
out.Data = serializer.BuildArtShowListRes(shows)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/m"
|
||||
"fonchain-artshow/pkg/serializer"
|
||||
"log"
|
||||
)
|
||||
|
||||
// 创建画展包申请
|
||||
@ -34,6 +35,10 @@ func UpdateShowApplyWithShowRel(in *artShow.SaveApplyReq) (err error, applyUID s
|
||||
if len(in.Rel) > 0 {
|
||||
// 保存 新 show_rel
|
||||
newShowRelS := serializer.BuildShowRelM(in.Rel, showApply.ApplyUID)
|
||||
for i := 0; i < len(newShowRelS); i++ {
|
||||
log.Printf("%+v\n", newShowRelS[i])
|
||||
}
|
||||
|
||||
err, _ := dao.SaveShowRels(tx, newShowRelS)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
|
@ -54,7 +54,7 @@ RedisDBNAme =
|
||||
|
||||
[zap_log]
|
||||
level: "info"
|
||||
filename: "./runtime/log/artwork_server.log"
|
||||
filename: "./runtime/log/artshow_server.log"
|
||||
max_size: 200
|
||||
max_age: 30
|
||||
max_backups: 7
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -16,17 +16,17 @@ var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
func (this *SaveShowReq) Validate() error {
|
||||
for _, item := range this.ShowArtwork {
|
||||
for _, item := range this.Artwork {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ShowArtwork", err)
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Artwork", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, item := range this.DelShowArtwork {
|
||||
for _, item := range this.DelArtwork {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DelShowArtwork", err)
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DelArtwork", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,6 +65,9 @@ func (this *ShowArtworkDetailRes) Validate() error {
|
||||
func (this *ShowListReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ShowListForArtworkReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ShowListRes) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
@ -75,10 +78,20 @@ func (this *ShowListRes) Validate() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ShowListForArtworkRes) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DelShowReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ShowArtworkDetail) Validate() error {
|
||||
func (this *ArtworkDetail) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *DelArtworkDetail) Validate() error {
|
||||
|
@ -1,609 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.10.1
|
||||
// source: pb/artshow.proto
|
||||
|
||||
package artShow
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ArtShowClient is the client API for ArtShow service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ArtShowClient interface {
|
||||
CreateShow(ctx context.Context, in *SaveShowReq, opts ...grpc.CallOption) (*SaveShowRes, error)
|
||||
UpdateShow(ctx context.Context, in *SaveShowReq, opts ...grpc.CallOption) (*SaveShowRes, error)
|
||||
DelShow(ctx context.Context, in *DelShowReq, opts ...grpc.CallOption) (*CommonRes, error)
|
||||
ShowList(ctx context.Context, in *ShowListReq, opts ...grpc.CallOption) (*ShowListRes, error)
|
||||
ShowArtworkInfo(ctx context.Context, in *ShowDetailReq, opts ...grpc.CallOption) (*ShowArtworkDetailRes, error)
|
||||
ShowDetail(ctx context.Context, in *ShowDetailReq, opts ...grpc.CallOption) (*ShowDetailRes, error)
|
||||
ShowStatisticalInfo(ctx context.Context, in *ShowStatisticalInfoReq, opts ...grpc.CallOption) (*ShowStatisticalInfoRes, error)
|
||||
ArtworkPrice(ctx context.Context, in *ArtworkPriceReq, opts ...grpc.CallOption) (*ArtworkPriceRes, error)
|
||||
CreateApply(ctx context.Context, in *SaveApplyReq, opts ...grpc.CallOption) (*SaveApplyRes, error)
|
||||
UpdateApply(ctx context.Context, in *SaveApplyReq, opts ...grpc.CallOption) (*SaveApplyRes, error)
|
||||
DelApply(ctx context.Context, in *DelApplyReq, opts ...grpc.CallOption) (*CommonRes, error)
|
||||
ShowListWithApply(ctx context.Context, in *ShowListReq, opts ...grpc.CallOption) (*ShowListRes, error)
|
||||
UpdateApplyStatus(ctx context.Context, in *UpdateApplyStatusReq, opts ...grpc.CallOption) (*CommonRes, error)
|
||||
ApplyList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListRes, error)
|
||||
ApplyDetail(ctx context.Context, in *ApplyShowReq, opts ...grpc.CallOption) (*ApplyShowRes, error)
|
||||
}
|
||||
|
||||
type artShowClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewArtShowClient(cc grpc.ClientConnInterface) ArtShowClient {
|
||||
return &artShowClient{cc}
|
||||
}
|
||||
|
||||
func (c *artShowClient) CreateShow(ctx context.Context, in *SaveShowReq, opts ...grpc.CallOption) (*SaveShowRes, error) {
|
||||
out := new(SaveShowRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/CreateShow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) UpdateShow(ctx context.Context, in *SaveShowReq, opts ...grpc.CallOption) (*SaveShowRes, error) {
|
||||
out := new(SaveShowRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/UpdateShow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) DelShow(ctx context.Context, in *DelShowReq, opts ...grpc.CallOption) (*CommonRes, error) {
|
||||
out := new(CommonRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/DelShow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowList(ctx context.Context, in *ShowListReq, opts ...grpc.CallOption) (*ShowListRes, error) {
|
||||
out := new(ShowListRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowArtworkInfo(ctx context.Context, in *ShowDetailReq, opts ...grpc.CallOption) (*ShowArtworkDetailRes, error) {
|
||||
out := new(ShowArtworkDetailRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowArtworkInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowDetail(ctx context.Context, in *ShowDetailReq, opts ...grpc.CallOption) (*ShowDetailRes, error) {
|
||||
out := new(ShowDetailRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowDetail", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowStatisticalInfo(ctx context.Context, in *ShowStatisticalInfoReq, opts ...grpc.CallOption) (*ShowStatisticalInfoRes, error) {
|
||||
out := new(ShowStatisticalInfoRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowStatisticalInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ArtworkPrice(ctx context.Context, in *ArtworkPriceReq, opts ...grpc.CallOption) (*ArtworkPriceRes, error) {
|
||||
out := new(ArtworkPriceRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ArtworkPrice", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) CreateApply(ctx context.Context, in *SaveApplyReq, opts ...grpc.CallOption) (*SaveApplyRes, error) {
|
||||
out := new(SaveApplyRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/CreateApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) UpdateApply(ctx context.Context, in *SaveApplyReq, opts ...grpc.CallOption) (*SaveApplyRes, error) {
|
||||
out := new(SaveApplyRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/UpdateApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) DelApply(ctx context.Context, in *DelApplyReq, opts ...grpc.CallOption) (*CommonRes, error) {
|
||||
out := new(CommonRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/DelApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowListWithApply(ctx context.Context, in *ShowListReq, opts ...grpc.CallOption) (*ShowListRes, error) {
|
||||
out := new(ShowListRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowListWithApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) UpdateApplyStatus(ctx context.Context, in *UpdateApplyStatusReq, opts ...grpc.CallOption) (*CommonRes, error) {
|
||||
out := new(CommonRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/UpdateApplyStatus", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ApplyList(ctx context.Context, in *ApplyListReq, opts ...grpc.CallOption) (*ApplyListRes, error) {
|
||||
out := new(ApplyListRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ApplyList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ApplyDetail(ctx context.Context, in *ApplyShowReq, opts ...grpc.CallOption) (*ApplyShowRes, error) {
|
||||
out := new(ApplyShowRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ApplyDetail", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ArtShowServer is the server API for ArtShow service.
|
||||
// All implementations must embed UnimplementedArtShowServer
|
||||
// for forward compatibility
|
||||
type ArtShowServer interface {
|
||||
CreateShow(context.Context, *SaveShowReq) (*SaveShowRes, error)
|
||||
UpdateShow(context.Context, *SaveShowReq) (*SaveShowRes, error)
|
||||
DelShow(context.Context, *DelShowReq) (*CommonRes, error)
|
||||
ShowList(context.Context, *ShowListReq) (*ShowListRes, error)
|
||||
ShowArtworkInfo(context.Context, *ShowDetailReq) (*ShowArtworkDetailRes, error)
|
||||
ShowDetail(context.Context, *ShowDetailReq) (*ShowDetailRes, error)
|
||||
ShowStatisticalInfo(context.Context, *ShowStatisticalInfoReq) (*ShowStatisticalInfoRes, error)
|
||||
ArtworkPrice(context.Context, *ArtworkPriceReq) (*ArtworkPriceRes, error)
|
||||
CreateApply(context.Context, *SaveApplyReq) (*SaveApplyRes, error)
|
||||
UpdateApply(context.Context, *SaveApplyReq) (*SaveApplyRes, error)
|
||||
DelApply(context.Context, *DelApplyReq) (*CommonRes, error)
|
||||
ShowListWithApply(context.Context, *ShowListReq) (*ShowListRes, error)
|
||||
UpdateApplyStatus(context.Context, *UpdateApplyStatusReq) (*CommonRes, error)
|
||||
ApplyList(context.Context, *ApplyListReq) (*ApplyListRes, error)
|
||||
ApplyDetail(context.Context, *ApplyShowReq) (*ApplyShowRes, error)
|
||||
mustEmbedUnimplementedArtShowServer()
|
||||
}
|
||||
|
||||
// UnimplementedArtShowServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedArtShowServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedArtShowServer) CreateShow(context.Context, *SaveShowReq) (*SaveShowRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateShow not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) UpdateShow(context.Context, *SaveShowReq) (*SaveShowRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateShow not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) DelShow(context.Context, *DelShowReq) (*CommonRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DelShow not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowList(context.Context, *ShowListReq) (*ShowListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowList not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowArtworkInfo(context.Context, *ShowDetailReq) (*ShowArtworkDetailRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowArtworkInfo not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowDetail(context.Context, *ShowDetailReq) (*ShowDetailRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowDetail not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowStatisticalInfo(context.Context, *ShowStatisticalInfoReq) (*ShowStatisticalInfoRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowStatisticalInfo not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ArtworkPrice(context.Context, *ArtworkPriceReq) (*ArtworkPriceRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ArtworkPrice not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) CreateApply(context.Context, *SaveApplyReq) (*SaveApplyRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) UpdateApply(context.Context, *SaveApplyReq) (*SaveApplyRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) DelApply(context.Context, *DelApplyReq) (*CommonRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DelApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowListWithApply(context.Context, *ShowListReq) (*ShowListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowListWithApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) UpdateApplyStatus(context.Context, *UpdateApplyStatusReq) (*CommonRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateApplyStatus not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ApplyList(context.Context, *ApplyListReq) (*ApplyListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ApplyList not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ApplyDetail(context.Context, *ApplyShowReq) (*ApplyShowRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ApplyDetail not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) mustEmbedUnimplementedArtShowServer() {}
|
||||
|
||||
// UnsafeArtShowServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ArtShowServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeArtShowServer interface {
|
||||
mustEmbedUnimplementedArtShowServer()
|
||||
}
|
||||
|
||||
func RegisterArtShowServer(s grpc.ServiceRegistrar, srv ArtShowServer) {
|
||||
s.RegisterService(&ArtShow_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ArtShow_CreateShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SaveShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).CreateShow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/CreateShow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).CreateShow(ctx, req.(*SaveShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_UpdateShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SaveShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).UpdateShow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/UpdateShow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).UpdateShow(ctx, req.(*SaveShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_DelShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DelShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).DelShow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/DelShow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).DelShow(ctx, req.(*DelShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowList(ctx, req.(*ShowListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowArtworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowDetailReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowArtworkInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowArtworkInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowArtworkInfo(ctx, req.(*ShowDetailReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowDetailReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowDetail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowDetail",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowDetail(ctx, req.(*ShowDetailReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowStatisticalInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowStatisticalInfoReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowStatisticalInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowStatisticalInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowStatisticalInfo(ctx, req.(*ShowStatisticalInfoReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ArtworkPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ArtworkPriceReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ArtworkPrice(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ArtworkPrice",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ArtworkPrice(ctx, req.(*ArtworkPriceReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_CreateApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SaveApplyReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).CreateApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/CreateApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).CreateApply(ctx, req.(*SaveApplyReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_UpdateApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SaveApplyReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).UpdateApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/UpdateApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).UpdateApply(ctx, req.(*SaveApplyReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_DelApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DelApplyReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).DelApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/DelApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).DelApply(ctx, req.(*DelApplyReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowListWithApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowListWithApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowListWithApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowListWithApply(ctx, req.(*ShowListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_UpdateApplyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateApplyStatusReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).UpdateApplyStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/UpdateApplyStatus",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).UpdateApplyStatus(ctx, req.(*UpdateApplyStatusReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ApplyListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ApplyList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ApplyList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ApplyList(ctx, req.(*ApplyListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ApplyDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ApplyShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ApplyDetail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ApplyDetail",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ApplyDetail(ctx, req.(*ApplyShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ArtShow_ServiceDesc is the grpc.ServiceDesc for ArtShow service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ArtShow_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ArtShow.ArtShow",
|
||||
HandlerType: (*ArtShowServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateShow",
|
||||
Handler: _ArtShow_CreateShow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateShow",
|
||||
Handler: _ArtShow_UpdateShow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DelShow",
|
||||
Handler: _ArtShow_DelShow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowList",
|
||||
Handler: _ArtShow_ShowList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowArtworkInfo",
|
||||
Handler: _ArtShow_ShowArtworkInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowDetail",
|
||||
Handler: _ArtShow_ShowDetail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowStatisticalInfo",
|
||||
Handler: _ArtShow_ShowStatisticalInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ArtworkPrice",
|
||||
Handler: _ArtShow_ArtworkPrice_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateApply",
|
||||
Handler: _ArtShow_CreateApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateApply",
|
||||
Handler: _ArtShow_UpdateApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DelApply",
|
||||
Handler: _ArtShow_DelApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowListWithApply",
|
||||
Handler: _ArtShow_ShowListWithApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateApplyStatus",
|
||||
Handler: _ArtShow_UpdateApplyStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApplyList",
|
||||
Handler: _ArtShow_ApplyList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApplyDetail",
|
||||
Handler: _ArtShow_ApplyDetail_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "pb/artshow.proto",
|
||||
}
|
@ -32,6 +32,7 @@ type ArtShowClient interface {
|
||||
UpdateShow(ctx context.Context, in *SaveShowReq, opts ...grpc_go.CallOption) (*SaveShowRes, common.ErrorWithAttachment)
|
||||
DelShow(ctx context.Context, in *DelShowReq, opts ...grpc_go.CallOption) (*CommonRes, common.ErrorWithAttachment)
|
||||
ShowList(ctx context.Context, in *ShowListReq, opts ...grpc_go.CallOption) (*ShowListRes, common.ErrorWithAttachment)
|
||||
ShowListForArtwork(ctx context.Context, in *ShowListForArtworkReq, opts ...grpc_go.CallOption) (*ShowListForArtworkRes, common.ErrorWithAttachment)
|
||||
ShowArtworkInfo(ctx context.Context, in *ShowDetailReq, opts ...grpc_go.CallOption) (*ShowArtworkDetailRes, common.ErrorWithAttachment)
|
||||
ShowDetail(ctx context.Context, in *ShowDetailReq, opts ...grpc_go.CallOption) (*ShowDetailRes, common.ErrorWithAttachment)
|
||||
ShowStatisticalInfo(ctx context.Context, in *ShowStatisticalInfoReq, opts ...grpc_go.CallOption) (*ShowStatisticalInfoRes, common.ErrorWithAttachment)
|
||||
@ -54,6 +55,7 @@ type ArtShowClientImpl struct {
|
||||
UpdateShow func(ctx context.Context, in *SaveShowReq) (*SaveShowRes, error)
|
||||
DelShow func(ctx context.Context, in *DelShowReq) (*CommonRes, error)
|
||||
ShowList func(ctx context.Context, in *ShowListReq) (*ShowListRes, error)
|
||||
ShowListForArtwork func(ctx context.Context, in *ShowListForArtworkReq) (*ShowListForArtworkRes, error)
|
||||
ShowArtworkInfo func(ctx context.Context, in *ShowDetailReq) (*ShowArtworkDetailRes, error)
|
||||
ShowDetail func(ctx context.Context, in *ShowDetailReq) (*ShowDetailRes, error)
|
||||
ShowStatisticalInfo func(ctx context.Context, in *ShowStatisticalInfoReq) (*ShowStatisticalInfoRes, error)
|
||||
@ -103,6 +105,12 @@ func (c *artShowClient) ShowList(ctx context.Context, in *ShowListReq, opts ...g
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ShowList", in, out)
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowListForArtwork(ctx context.Context, in *ShowListForArtworkReq, opts ...grpc_go.CallOption) (*ShowListForArtworkRes, common.ErrorWithAttachment) {
|
||||
out := new(ShowListForArtworkRes)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ShowListForArtwork", in, out)
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowArtworkInfo(ctx context.Context, in *ShowDetailReq, opts ...grpc_go.CallOption) (*ShowArtworkDetailRes, common.ErrorWithAttachment) {
|
||||
out := new(ShowArtworkDetailRes)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -177,6 +185,7 @@ type ArtShowServer interface {
|
||||
UpdateShow(context.Context, *SaveShowReq) (*SaveShowRes, error)
|
||||
DelShow(context.Context, *DelShowReq) (*CommonRes, error)
|
||||
ShowList(context.Context, *ShowListReq) (*ShowListRes, error)
|
||||
ShowListForArtwork(context.Context, *ShowListForArtworkReq) (*ShowListForArtworkRes, error)
|
||||
ShowArtworkInfo(context.Context, *ShowDetailReq) (*ShowArtworkDetailRes, error)
|
||||
ShowDetail(context.Context, *ShowDetailReq) (*ShowDetailRes, error)
|
||||
ShowStatisticalInfo(context.Context, *ShowStatisticalInfoReq) (*ShowStatisticalInfoRes, error)
|
||||
@ -208,6 +217,9 @@ func (UnimplementedArtShowServer) DelShow(context.Context, *DelShowReq) (*Common
|
||||
func (UnimplementedArtShowServer) ShowList(context.Context, *ShowListReq) (*ShowListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowList not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowListForArtwork(context.Context, *ShowListForArtworkReq) (*ShowListForArtworkRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowListForArtwork not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowArtworkInfo(context.Context, *ShowDetailReq) (*ShowArtworkDetailRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowArtworkInfo not implemented")
|
||||
}
|
||||
@ -385,6 +397,35 @@ func _ArtShow_ShowList_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowListForArtwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowListForArtworkReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("ShowListForArtwork", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowArtworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ShowDetailReq)
|
||||
if err := dec(in); err != nil {
|
||||
@ -727,6 +768,10 @@ var ArtShow_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "ShowList",
|
||||
Handler: _ArtShow_ShowList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowListForArtwork",
|
||||
Handler: _ArtShow_ShowListForArtwork_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowArtworkInfo",
|
||||
Handler: _ArtShow_ShowArtworkInfo_Handler,
|
||||
|
@ -8,6 +8,7 @@ service ArtShow {
|
||||
rpc UpdateShow (SaveShowReq) returns (SaveShowRes) {} // 画展包更新操作
|
||||
rpc DelShow (DelShowReq) returns (CommonRes) {} // 画展包删除操作
|
||||
rpc ShowList (ShowListReq) returns (ShowListRes) {} // 画展包列表展示
|
||||
rpc ShowListForArtwork (ShowListForArtworkReq) returns (ShowListForArtworkRes) {} // 画展包列表展示 画作使用
|
||||
rpc ShowArtworkInfo (ShowDetailReq) returns (ShowArtworkDetailRes) {} // 画展包画作展示
|
||||
rpc ShowDetail (ShowDetailReq) returns (ShowDetailRes) {} // 画展包展示
|
||||
rpc ShowStatisticalInfo (ShowStatisticalInfoReq) returns (ShowStatisticalInfoRes) {} // 画展统计(画作数量、画家数量)
|
||||
@ -31,12 +32,12 @@ message SaveShowReq {
|
||||
int64 Price = 6 [json_name = "price"];
|
||||
int64 Reward = 7 [json_name = "reward"];
|
||||
int32 IsShow = 8 [json_name = "is_show"];
|
||||
string ShowTime = 9 [json_name = "show_time"];
|
||||
string CreateTime = 9 [json_name = "create_time"];
|
||||
|
||||
string ShowUID = 10 [json_name = "id"];
|
||||
|
||||
repeated ShowArtworkDetail ShowArtwork = 11 [json_name = "show_artwork"];
|
||||
repeated DelArtworkDetail DelShowArtwork = 12 [json_name = "del_show_artwork"];
|
||||
repeated ArtworkDetail Artwork = 11 [json_name = "show_artwork"];
|
||||
repeated DelArtworkDetail DelArtwork = 12 [json_name = "del_show_artwork"];
|
||||
|
||||
}
|
||||
|
||||
@ -64,8 +65,11 @@ message ShowDetail {
|
||||
int32 Ruler = 7 [json_name = "ruler"];
|
||||
int64 Price = 8 [json_name = "price"];
|
||||
int64 Reward = 9 [json_name = "reward"];
|
||||
string ShowTime = 10 [json_name = "show_time"];
|
||||
string CreateTime = 10 [json_name = "create_time"];
|
||||
int32 IsShow = 11 [json_name = "is_show"];
|
||||
|
||||
string ShowTime = 12 [json_name = "show_time"];
|
||||
string Address = 13 [json_name = "address"];
|
||||
}
|
||||
|
||||
message ShowDetailRes {
|
||||
@ -74,7 +78,7 @@ message ShowDetailRes {
|
||||
}
|
||||
|
||||
message ShowArtworkDetailRes {
|
||||
repeated ShowArtworkDetail data = 1 [json_name = "data"];
|
||||
repeated ArtworkDetail data = 1 [json_name = "data"];
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
}
|
||||
|
||||
@ -85,10 +89,17 @@ message ShowListReq {
|
||||
|
||||
string StartTime = 3 [json_name = "start_time"];
|
||||
string EndTime = 4 [json_name = "end_time"];
|
||||
string ArtistUID = 5 [json_name = "artist_uid"];
|
||||
string Name = 5 [json_name = "name"];
|
||||
int32 IsShow = 6 [json_name = "is_show"];
|
||||
}
|
||||
|
||||
message ShowListForArtworkReq {
|
||||
int32 Page = 1 [json_name = "page"];
|
||||
int32 PageSize = 2 [json_name = "page_size"];
|
||||
|
||||
string ArtistUID = 3 [json_name = "artist_uid"];
|
||||
}
|
||||
|
||||
message ShowListRes {
|
||||
int64 Total = 1 [json_name = "total"];
|
||||
int64 TotalPackageNum = 2 [json_name = "total_package_num"];
|
||||
@ -98,13 +109,20 @@ message ShowListRes {
|
||||
string Msg = 5 [json_name = "msg"];
|
||||
}
|
||||
|
||||
message ShowListForArtworkRes {
|
||||
int64 Total = 1 [json_name = "total"];
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
repeated ShowDetail Data = 3 [json_name = "data"];
|
||||
}
|
||||
|
||||
|
||||
// 删除画展包
|
||||
message DelShowReq {
|
||||
repeated string ShowUID = 1 [json_name = "show_uid"];
|
||||
}
|
||||
|
||||
// 画展包中画作详情 除价格
|
||||
message ShowArtworkDetail {
|
||||
message ArtworkDetail {
|
||||
string ArtworkPriceUID = 1 [json_name = "artwork_price_uid"];
|
||||
string ShowUID =2 [json_name = "show_uid"];
|
||||
string ArtworkUID = 3 [json_name = "artwork_uid"];
|
||||
@ -163,6 +181,7 @@ message ShowRel {
|
||||
string ShowUID = 3 [json_name = "show_uid"];
|
||||
int32 Index = 4 [json_name = "index"];
|
||||
string Address = 5 [json_name = "address"];
|
||||
string ShowTime = 6 [json_name = "show_time"];
|
||||
}
|
||||
|
||||
message DelShowRel {
|
||||
|
@ -27,6 +27,7 @@ type ArtShowClient interface {
|
||||
UpdateShow(ctx context.Context, in *artShow.SaveShowReq, opts ...grpc.CallOption) (*artShow.SaveShowRes, error)
|
||||
DelShow(ctx context.Context, in *artShow.DelShowReq, opts ...grpc.CallOption) (*artShow.CommonRes, error)
|
||||
ShowList(ctx context.Context, in *artShow.ShowListReq, opts ...grpc.CallOption) (*artShow.ShowListRes, error)
|
||||
ShowListForArtwork(ctx context.Context, in *artShow.ShowListForArtworkReq, opts ...grpc.CallOption) (*artShow.ShowListForArtworkRes, error)
|
||||
ShowArtworkInfo(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowArtworkDetailRes, error)
|
||||
ShowDetail(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowDetailRes, error)
|
||||
ShowStatisticalInfo(ctx context.Context, in *artShow.ShowStatisticalInfoReq, opts ...grpc.CallOption) (*artShow.ShowStatisticalInfoRes, error)
|
||||
@ -84,6 +85,15 @@ func (c *artShowClient) ShowList(ctx context.Context, in *artShow.ShowListReq, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowListForArtwork(ctx context.Context, in *artShow.ShowListForArtworkReq, opts ...grpc.CallOption) (*artShow.ShowListForArtworkRes, error) {
|
||||
out := new(artShow.ShowListForArtworkRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowListForArtwork", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowArtworkInfo(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowArtworkDetailRes, error) {
|
||||
out := new(artShow.ShowArtworkDetailRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowArtworkInfo", in, out, opts...)
|
||||
@ -191,6 +201,7 @@ type ArtShowServer interface {
|
||||
UpdateShow(context.Context, *artShow.SaveShowReq) (*artShow.SaveShowRes, error)
|
||||
DelShow(context.Context, *artShow.DelShowReq) (*artShow.CommonRes, error)
|
||||
ShowList(context.Context, *artShow.ShowListReq) (*artShow.ShowListRes, error)
|
||||
ShowListForArtwork(context.Context, *artShow.ShowListForArtworkReq) (*artShow.ShowListForArtworkRes, error)
|
||||
ShowArtworkInfo(context.Context, *artShow.ShowDetailReq) (*artShow.ShowArtworkDetailRes, error)
|
||||
ShowDetail(context.Context, *artShow.ShowDetailReq) (*artShow.ShowDetailRes, error)
|
||||
ShowStatisticalInfo(context.Context, *artShow.ShowStatisticalInfoReq) (*artShow.ShowStatisticalInfoRes, error)
|
||||
@ -221,6 +232,9 @@ func (UnimplementedArtShowServer) DelShow(context.Context, *artShow.DelShowReq)
|
||||
func (UnimplementedArtShowServer) ShowList(context.Context, *artShow.ShowListReq) (*artShow.ShowListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowList not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowListForArtwork(context.Context, *artShow.ShowListForArtworkReq) (*artShow.ShowListForArtworkRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowListForArtwork not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowArtworkInfo(context.Context, *artShow.ShowDetailReq) (*artShow.ShowArtworkDetailRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowArtworkInfo not implemented")
|
||||
}
|
||||
@ -339,6 +353,24 @@ func _ArtShow_ShowList_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowListForArtwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowListForArtworkReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowListForArtwork(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowListForArtwork",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowListForArtwork(ctx, req.(*artShow.ShowListForArtworkReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowArtworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowDetailReq)
|
||||
if err := dec(in); err != nil {
|
||||
@ -560,6 +592,10 @@ var ArtShow_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "ShowList",
|
||||
Handler: _ArtShow_ShowList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowListForArtwork",
|
||||
Handler: _ArtShow_ShowListForArtwork_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowArtworkInfo",
|
||||
Handler: _ArtShow_ShowArtworkInfo_Handler,
|
||||
|
@ -17,7 +17,7 @@ func BuildArtShowM(in *artShow.SaveShowReq) (out *model.ArtShow) {
|
||||
out.Price = in.Price
|
||||
out.Ruler = in.Ruler
|
||||
out.Reward = in.Reward
|
||||
out.ShowTime = in.ShowTime
|
||||
out.CreateTime = in.CreateTime
|
||||
if in.IsShow == 0 {
|
||||
out.IsShow = m.ARTSHOW_INSIDE
|
||||
} else {
|
||||
@ -27,7 +27,7 @@ func BuildArtShowM(in *artShow.SaveShowReq) (out *model.ArtShow) {
|
||||
return
|
||||
}
|
||||
|
||||
func BuildArtShowListRes(artShows []*model.ArtShow) (out []*artShow.ShowDetail) {
|
||||
func BuildArtShowListRes(artShows []*model.ArtShowRes) (out []*artShow.ShowDetail) {
|
||||
out = make([]*artShow.ShowDetail, 0)
|
||||
for i := 0; i < len(artShows); i++ {
|
||||
artShowM := BuildArtShowRpc(artShows[i])
|
||||
@ -36,7 +36,7 @@ func BuildArtShowListRes(artShows []*model.ArtShow) (out []*artShow.ShowDetail)
|
||||
return
|
||||
}
|
||||
|
||||
func BuildArtShowRpc(artShowM *model.ArtShow) (out *artShow.ShowDetail) {
|
||||
func BuildArtShowRpc(artShowM *model.ArtShowRes) (out *artShow.ShowDetail) {
|
||||
out = new(artShow.ShowDetail)
|
||||
out.ShowUID = artShowM.ShowUID
|
||||
out.ShowSeq = artShowM.ShowSeq
|
||||
@ -46,9 +46,10 @@ func BuildArtShowRpc(artShowM *model.ArtShow) (out *artShow.ShowDetail) {
|
||||
out.ArtworkNum = artShowM.ArtworkNum
|
||||
out.Ruler = artShowM.Ruler
|
||||
out.Price = artShowM.Price
|
||||
out.Reward = artShowM.Reward
|
||||
out.ShowTime = artShowM.ShowTime
|
||||
out.CreateTime = artShowM.CreateTime
|
||||
out.IsShow = int32(artShowM.IsShow)
|
||||
out.Address = artShowM.Address
|
||||
out.ShowTime = artShowM.ShowTime
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"fonchain-artshow/pb/artShow"
|
||||
)
|
||||
|
||||
func BuildShowArtworkM(in []*artShow.ShowArtworkDetail, showUID string) (out []*model.ArtworkPrice) {
|
||||
func BuildShowArtworkM(in []*artShow.ArtworkDetail, showUID string) (out []*model.ArtworkPrice) {
|
||||
out = make([]*model.ArtworkPrice, len(in))
|
||||
for i := 0; i < len(in); i++ {
|
||||
artworkPrice := new(model.ArtworkPrice)
|
||||
@ -27,10 +27,10 @@ func BuildShowArtworkM(in []*artShow.ShowArtworkDetail, showUID string) (out []*
|
||||
return
|
||||
}
|
||||
|
||||
func BuildShowArtworkRpc(in []*model.ArtworkPrice) (out []*artShow.ShowArtworkDetail) {
|
||||
out = make([]*artShow.ShowArtworkDetail, len(in))
|
||||
func BuildShowArtworkRpc(in []*model.ArtworkPrice) (out []*artShow.ArtworkDetail) {
|
||||
out = make([]*artShow.ArtworkDetail, len(in))
|
||||
for i := 0; i < len(in); i++ {
|
||||
artworkPrice := new(artShow.ShowArtworkDetail)
|
||||
artworkPrice := new(artShow.ArtworkDetail)
|
||||
artworkPrice.ArtworkPriceUID = in[i].ArtworkPriceUID
|
||||
artworkPrice.ShowUID = in[i].ShowUID
|
||||
artworkPrice.ArtworkUID = in[i].ArtworkUID
|
||||
|
@ -12,6 +12,7 @@ func BuildShowRelM(in []*artShow.ShowRel, applyUID string) (out []*model.ShowRel
|
||||
ApplyUID: applyUID,
|
||||
Index: in[i].Index,
|
||||
Address: in[i].Address,
|
||||
ShowTime: in[i].ShowTime,
|
||||
}
|
||||
if in[i].ShowRelUID != "" {
|
||||
showRel.ShowRelUID = in[i].ShowRelUID
|
||||
@ -29,6 +30,7 @@ func BuildShowRelRes(in []*model.ShowRel) (out []*artShow.ShowRel) {
|
||||
ShowUID: in[i].ShowUID,
|
||||
Index: in[i].Index,
|
||||
Address: in[i].Address,
|
||||
ShowTime: in[i].ShowTime,
|
||||
}
|
||||
out = append(out, showRel)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user