ID->UID
This commit is contained in:
parent
28381abfee
commit
86919d74fd
@ -23,26 +23,26 @@ func (p *ArtShowProvider) CreateShow(ctx context.Context, req *artShow.SaveShowR
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
res = new(artShow.SaveShowRes)
|
res = new(artShow.SaveShowRes)
|
||||||
err, showID := service.CreateArtShowWithArtworkPrice(req)
|
err, showUID := service.CreateArtShowWithArtworkPrice(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
res.Msg = err.Error()
|
||||||
err = errors.New(m.ERROR_CREATE)
|
err = errors.New(m.ERROR_CREATE)
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
res.Msg = m.CREATE_SUCCESS
|
res.Msg = m.CREATE_SUCCESS
|
||||||
res.ShowID = int64(showID)
|
res.ShowUID = showUID
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) UpdateShow(ctx context.Context, req *artShow.SaveShowReq) (res *artShow.SaveShowRes, err error) {
|
func (p *ArtShowProvider) UpdateShow(ctx context.Context, req *artShow.SaveShowReq) (res *artShow.SaveShowRes, err error) {
|
||||||
if req.ID == 0 {
|
if req.ShowUID == "" {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res = new(artShow.SaveShowRes)
|
res = new(artShow.SaveShowRes)
|
||||||
if req.IsShow == m.ARTSHOW_INSIDE {
|
if req.IsShow == m.ARTSHOW_INSIDE {
|
||||||
showRel := new(model.ShowRel)
|
showRel := new(model.ShowRel)
|
||||||
err, showRel = service.QueryShowRel_showId(req.ID)
|
err, showRel = service.QueryShowRel_showUID(req.ShowUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
@ -52,20 +52,20 @@ func (p *ArtShowProvider) UpdateShow(ctx context.Context, req *artShow.SaveShowR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err, showID := service.UpdateArtShowWithArtworkPrice(req)
|
err, showUID := service.UpdateArtShowWithArtworkPrice(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
res.Msg = err.Error()
|
||||||
err = errors.New(m.UPDATE_FAILED)
|
err = errors.New(m.UPDATE_FAILED)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res.Msg = m.UPDATE_SUCCESS
|
res.Msg = m.UPDATE_SUCCESS
|
||||||
res.ShowID = int64(showID)
|
res.ShowUID = showUID
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) DelShow(ctx context.Context, req *artShow.DelShowReq) (res *artShow.CommonRes, err error) {
|
func (p *ArtShowProvider) DelShow(ctx context.Context, req *artShow.DelShowReq) (res *artShow.CommonRes, err error) {
|
||||||
res = new(artShow.CommonRes)
|
res = new(artShow.CommonRes)
|
||||||
if len(req.ShowID) < 1 {
|
if len(req.ShowUID) < 1 {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ func (p *ArtShowProvider) ShowStatisticalInfo(ctx context.Context, req *artShow.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) ArtworkPrice(ctx context.Context, req *artShow.ArtworkPriceReq) (res *artShow.ArtworkPriceRes, err error) {
|
func (p *ArtShowProvider) ArtworkPrice(ctx context.Context, req *artShow.ArtworkPriceReq) (res *artShow.ArtworkPriceRes, err error) {
|
||||||
if req.ArtworkID == 0 {
|
if req.ArtworkUID == "" {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -18,31 +18,31 @@ func (p *ArtShowProvider) CreateApply(ctx context.Context, req *artShow.SaveAppl
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
res = new(artShow.SaveApplyRes)
|
res = new(artShow.SaveApplyRes)
|
||||||
err, applyID := service.CreateShowApply(req)
|
err, applyUID := service.CreateShowApply(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
res.Msg = err.Error()
|
||||||
err = errors.New(m.ERROR_CREATE)
|
err = errors.New(m.ERROR_CREATE)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res.Msg = m.CREATE_SUCCESS
|
res.Msg = m.CREATE_SUCCESS
|
||||||
res.ApplyID = int64(applyID)
|
res.ApplyUID = applyUID
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) UpdateApply(ctx context.Context, req *artShow.SaveApplyReq) (res *artShow.SaveApplyRes, err error) {
|
func (p *ArtShowProvider) UpdateApply(ctx context.Context, req *artShow.SaveApplyReq) (res *artShow.SaveApplyRes, err error) {
|
||||||
if req.ID == 0 {
|
if req.ApplyUID == "" {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res = new(artShow.SaveApplyRes)
|
res = new(artShow.SaveApplyRes)
|
||||||
err, showID := service.UpdateShowApplyWithShowRel(req)
|
err, applyUID := service.UpdateShowApplyWithShowRel(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
res.Msg = err.Error()
|
||||||
err = errors.New(m.UPDATE_FAILED)
|
err = errors.New(m.UPDATE_FAILED)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res.Msg = m.UPDATE_SUCCESS
|
res.Msg = m.UPDATE_SUCCESS
|
||||||
res.ApplyID = int64(showID)
|
res.ApplyUID = applyUID
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,12 +64,12 @@ func (p *ArtShowProvider) ApplyList(ctx context.Context, req *artShow.ApplyListR
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) ApplyDetail(ctx context.Context, req *artShow.ApplyShowReq) (res *artShow.ApplyShowRes, err error) {
|
func (p *ArtShowProvider) ApplyDetail(ctx context.Context, req *artShow.ApplyShowReq) (res *artShow.ApplyShowRes, err error) {
|
||||||
if req.ApplyID == 0 {
|
if req.ApplyUID == "" {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res = new(artShow.ApplyShowRes)
|
res = new(artShow.ApplyShowRes)
|
||||||
err, res = service.ShowApplyDetail(uint(req.ApplyID))
|
err, res = service.ShowApplyDetail(req.ApplyUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
res.Msg = err.Error()
|
||||||
err = errors.New(m.ERROR_QUERY)
|
err = errors.New(m.ERROR_QUERY)
|
||||||
@ -79,12 +79,12 @@ func (p *ArtShowProvider) ApplyDetail(ctx context.Context, req *artShow.ApplySho
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) DelApply(ctx context.Context, req *artShow.DelApplyReq) (res *artShow.CommonRes, err error) {
|
func (p *ArtShowProvider) DelApply(ctx context.Context, req *artShow.DelApplyReq) (res *artShow.CommonRes, err error) {
|
||||||
if len(req.ApplyID) < 1 {
|
if len(req.ApplyUID) < 1 {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
res = new(artShow.CommonRes)
|
res = new(artShow.CommonRes)
|
||||||
err = service.DelApplyByApplyID(req)
|
err = service.DelApplyByApplyUID(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
res.Msg = err.Error()
|
||||||
err = errors.New(m.ERROR_DELETE)
|
err = errors.New(m.ERROR_DELETE)
|
||||||
@ -95,7 +95,7 @@ func (p *ArtShowProvider) DelApply(ctx context.Context, req *artShow.DelApplyReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ArtShowProvider) UpdateApplyStatus(ctx context.Context, req *artShow.UpdateApplyStatusReq) (res *artShow.CommonRes, err error) {
|
func (p *ArtShowProvider) UpdateApplyStatus(ctx context.Context, req *artShow.UpdateApplyStatusReq) (res *artShow.CommonRes, err error) {
|
||||||
if req.ApplyID == 0 {
|
if req.ApplyUID == "" {
|
||||||
err = errors.New(m.ERROR_INVALID_ID)
|
err = errors.New(m.ERROR_INVALID_ID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -4,18 +4,22 @@ import (
|
|||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
"fonchain-artshow/pkg/db"
|
"fonchain-artshow/pkg/db"
|
||||||
|
"fonchain-artshow/pkg/m"
|
||||||
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"log"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SaveArtShow(tx *gorm.DB, artShow *model.ArtShow) (err error) {
|
func SaveArtShow(tx *gorm.DB, artShow *model.ArtShow) (err error) {
|
||||||
|
uid, err := uuid.NewV4()
|
||||||
if artShow.ID != uint(0) {
|
if err != nil {
|
||||||
err = tx.Model(&model.ArtShow{}).Omit("id").Where("id = ?", artShow.ID).Updates(artShow).Error
|
return nil
|
||||||
} else {
|
|
||||||
err = tx.Model(&model.ArtShow{}).Create(&artShow).Error
|
|
||||||
}
|
}
|
||||||
|
artShow.ShowUID = uid.String()
|
||||||
|
artShow.ShowSeq = strings.Join([]string{m.ARTSHOW_PREFIX, time.Now().Format("20060102150405")}, "")
|
||||||
|
err = tx.Model(&model.ArtShow{}).Create(&artShow).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ArtShow err", zap.Error(err))
|
zap.L().Error("ArtShow err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -24,11 +28,20 @@ func SaveArtShow(tx *gorm.DB, artShow *model.ArtShow) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UpdateArtShow(tx *gorm.DB, artShow *model.ArtShow) (err error) {
|
||||||
|
err = tx.Model(&model.ArtShow{}).Omit("show_uid").Where("show_uid = ?", artShow.ShowUID).Updates(artShow).Error
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("ArtShow err", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func ArtShowList(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShow) {
|
func ArtShowList(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShow) {
|
||||||
queryDB := db.DbArtShow.Model(&model.ArtShow{})
|
queryDB := db.DbArtShow.Model(&model.ArtShow{})
|
||||||
|
|
||||||
if in.ArtistID != "" {
|
if in.ArtistUID != "" {
|
||||||
queryDB = queryDB.Where("artist_id = ? ", in.ArtistID)
|
queryDB = queryDB.Where("artist_uid = ? ", in.ArtistUID)
|
||||||
}
|
}
|
||||||
if in.StartTime != "" && in.EndTime != "" {
|
if in.StartTime != "" && in.EndTime != "" {
|
||||||
queryDB = queryDB.Where("convert(show_time, date) between ? and ?", in.StartTime, in.EndTime)
|
queryDB = queryDB.Where("convert(show_time, date) between ? and ?", in.StartTime, in.EndTime)
|
||||||
@ -53,9 +66,9 @@ func ArtShowList(in *artShow.ShowListReq) (err error, total int64, out []*model.
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArtShowList_apply(applyID uint) (err error, out []*model.ArtShow) {
|
func ArtShowList_apply(applyUID string) (err error, out []*model.ArtShow) {
|
||||||
out = make([]*model.ArtShow, 0)
|
out = make([]*model.ArtShow, 0)
|
||||||
err = db.DbArtShow.Table("art_show as a ").Select("a.*").Distinct("a.id").Joins(" right join show_rel as b on a.id = b.show_id").Where("b.apply_id = ? ", applyID).Find(&out).Error
|
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
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ArtShowList_apply Find err", zap.Error(err))
|
zap.L().Error("ArtShowList_apply Find err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -67,7 +80,7 @@ func ArtShowListByApplyStatus(in *artShow.ShowListReq) (err error, total int64,
|
|||||||
out = make([]*model.ArtShow, 0)
|
out = make([]*model.ArtShow, 0)
|
||||||
tx := db.DbArtShow.Table("art_show as a")
|
tx := db.DbArtShow.Table("art_show as a")
|
||||||
|
|
||||||
tx.Joins(" left join show_rel as b on b.show_id = a.id").Where("a.is_show = ?", in.IsShow)
|
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
|
err = tx.Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ArtShowListByApplyStatus Count err", zap.Error(err))
|
zap.L().Error("ArtShowListByApplyStatus Count err", zap.Error(err))
|
||||||
@ -83,8 +96,8 @@ func ArtShowListByApplyStatus(in *artShow.ShowListReq) (err error, total int64,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DelArtShow(tx *gorm.DB, show_id int64) (err error) {
|
func DelArtShow(tx *gorm.DB, show_uid string) (err error) {
|
||||||
err = tx.Where("id = ?", show_id).Delete(&model.ArtShow{}).Error
|
err = tx.Where("show_uid = ?", show_uid).Delete(&model.ArtShow{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ArtShow delete err", zap.Error(err))
|
zap.L().Error("ArtShow delete err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -92,13 +105,12 @@ func DelArtShow(tx *gorm.DB, show_id int64) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryArtShow(id uint) (err error, out *model.ArtShow) {
|
func QueryArtShow(show_uid string) (err error, out *model.ArtShow) {
|
||||||
err = db.DbArtShow.Model(&model.ArtShow{}).Where("id = ?", id).Find(&out).Error
|
err = db.DbArtShow.Model(&model.ArtShow{}).Where("show_uid = ?", show_uid).Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ArtShow Find err", zap.Error(err))
|
zap.L().Error("ArtShow Find err", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Println(out)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,14 +138,14 @@ func ShowStatistical(isShow int32) (err error, artistNum, packageNum, totalNum,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NotShowNum = 0
|
NotShowNum = 0
|
||||||
err = db.DbArtShow.Table("art_show as a").Distinct("b.artist_name").Joins(" join artwork_price as b on b.show_id = a.id").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)").Count(&NotShowNum).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowStatistical totalNum count err", zap.Error(err))
|
zap.L().Error("ShowStatistical totalNum count err", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowHisNum = 0
|
ShowHisNum = 0
|
||||||
err = db.DbArtShow.Table("art_show as a").Distinct("b.artist_name").Joins(" join artwork_price as b on b.show_id = a.id").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 ").Count(&ShowHisNum).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowStatistical totalNum count err", zap.Error(err))
|
zap.L().Error("ShowStatistical totalNum count err", zap.Error(err))
|
||||||
return
|
return
|
||||||
|
@ -3,37 +3,37 @@ package dao
|
|||||||
import (
|
import (
|
||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pkg/db"
|
"fonchain-artshow/pkg/db"
|
||||||
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SaveArtworkPrice(tx *gorm.DB, artworks []*model.ArtworkPrice) (err error, ids []uint) {
|
func SaveArtworkPrice(tx *gorm.DB, artwork *model.ArtworkPrice) (err error) {
|
||||||
ids = make([]uint, 0) // 用于记录 更新的记录ID
|
uid, err := uuid.NewV4()
|
||||||
|
if err != nil {
|
||||||
for i := 0; i < len(artworks); i++ {
|
return err
|
||||||
if artworks[i].ID != 0 {
|
|
||||||
err = tx.Model(&model.ArtworkPrice{}).Omit("id").Where("id = ?", artworks[i].ID).Updates(artworks[i]).Error
|
|
||||||
} else {
|
|
||||||
artworkPrice := new(model.ArtworkPrice)
|
|
||||||
results := tx.Model(&model.ArtworkPrice{}).Where("show_id = ? and artwork_id = ?", artworks[i].ShowID, artworks[i].ArtworkID).First(&artworkPrice)
|
|
||||||
if results.Error == nil || artworkPrice.ID == 0 {
|
|
||||||
err = tx.Model(&model.ArtworkPrice{}).Create(&artworks[i]).Error
|
|
||||||
} else {
|
|
||||||
err = tx.Model(&model.ArtworkPrice{}).Where("show_id = ? and artwork_id = ?", artworks[i].ShowID, artworks[i].ArtworkID).Updates(artworks[i]).Error
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
artwork.ArtworkPriceUID = uid.String()
|
||||||
|
err = tx.Model(&model.ArtworkPrice{}).Create(&artwork).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Artwork price save err", zap.Error(err))
|
zap.L().Error("Artwork price save err", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ids = append(ids, artworks[i].ID)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func UpdateArtworkPrice(tx *gorm.DB, artwork *model.ArtworkPrice) (err error) {
|
||||||
|
err = tx.Model(&model.ArtworkPrice{}).Omit("artwork_price_uid").Where("artwork_price_uid = ?", artwork.ArtworkPriceUID).Updates(artwork).Error
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("Artwork price save err", zap.Error(err))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArtworkPriceList(showID uint) (err error, out []*model.ArtworkPrice) {
|
func ArtworkPriceList(showUID string) (err error, out []*model.ArtworkPrice) {
|
||||||
out = make([]*model.ArtworkPrice, 0)
|
out = make([]*model.ArtworkPrice, 0)
|
||||||
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("show_id = ? ", showID).Find(&out).Error
|
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("show_uid = ? ", showUID).Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Artwork list err", zap.Error(err))
|
zap.L().Error("Artwork list err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -41,9 +41,9 @@ func ArtworkPriceList(showID uint) (err error, out []*model.ArtworkPrice) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryArtworkPrice_artworkID(artworkID int64) (err error, out *model.ArtworkPrice) {
|
func QueryArtworkPrice_artworkUID(artworkUID string) (err error, out *model.ArtworkPrice) {
|
||||||
out = new(model.ArtworkPrice)
|
out = new(model.ArtworkPrice)
|
||||||
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("artwork_id = ? ", artworkID).Find(&out).Error
|
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("artwork_uid = ? ", artworkUID).Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Artwork price artwork_id query err", zap.Error(err))
|
zap.L().Error("Artwork price artwork_id query err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -51,9 +51,9 @@ func QueryArtworkPrice_artworkID(artworkID int64) (err error, out *model.Artwork
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryArtworkPrice_id(id uint) (err error, out *model.ArtworkPrice) {
|
func QueryArtworkPrice_uid(uid string) (err error, out *model.ArtworkPrice) {
|
||||||
out = new(model.ArtworkPrice)
|
out = new(model.ArtworkPrice)
|
||||||
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("id = ? ", id).Find(&out).Error
|
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("artwork_price_uid = ? ", uid).Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Artwork price id query err", zap.Error(err))
|
zap.L().Error("Artwork price id query err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -61,8 +61,8 @@ func QueryArtworkPrice_id(id uint) (err error, out *model.ArtworkPrice) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DelArtworkPrice(tx *gorm.DB, ids []int64) (err error) {
|
func DelArtworkPrice(tx *gorm.DB, artworkPriceUids []string) (err error) {
|
||||||
err = tx.Where("id in (?)", ids).Delete(&model.ArtworkPrice{}).Error
|
err = tx.Where("artwork_price_uid in (?)", artworkPriceUids).Delete(&model.ArtworkPrice{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Artwork delete err", zap.Error(err))
|
zap.L().Error("Artwork delete err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -70,8 +70,8 @@ func DelArtworkPrice(tx *gorm.DB, ids []int64) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DelArtworkPrice_showId(tx *gorm.DB, id int64) (err error) {
|
func DelArtworkPrice_showUID(tx *gorm.DB, show_uid string) (err error) {
|
||||||
err = tx.Where("show_id = ? ", id).Delete(&model.ArtworkPrice{}).Error
|
err = tx.Where("show_uid = ? ", show_uid).Delete(&model.ArtworkPrice{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("Artwork delete err", zap.Error(err))
|
zap.L().Error("Artwork delete err", zap.Error(err))
|
||||||
return
|
return
|
||||||
|
@ -5,23 +5,36 @@ import (
|
|||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
"fonchain-artshow/pkg/db"
|
"fonchain-artshow/pkg/db"
|
||||||
"fonchain-artshow/pkg/m"
|
"fonchain-artshow/pkg/m"
|
||||||
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SaveShowApply(showApply *model.ShowApply) (tx *gorm.DB, err error) {
|
func SaveShowApply(showApply *model.ShowApply) (err error) {
|
||||||
tx = db.DbArtShow.Begin()
|
uid, err := uuid.NewV4()
|
||||||
|
if err != nil {
|
||||||
if showApply.ID != uint(0) {
|
return err
|
||||||
err = tx.Model(&model.ShowApply{}).Omit("id").Where("id = ?", showApply.ID).Updates(showApply).Error
|
|
||||||
} else {
|
|
||||||
err = tx.Model(&model.ShowApply{}).Create(&showApply).Error
|
|
||||||
}
|
}
|
||||||
|
showApply.ApplyUID = uid.String()
|
||||||
|
showApply.ApplySeq = strings.Join([]string{m.ARTSHOWAPPLY_PREFIX, time.Now().Format("20060102150405")}, "")
|
||||||
|
showApply.Status = m.SHOWAPPLYStatusDoing
|
||||||
|
err = db.DbArtShow.Model(&model.ShowApply{}).Create(&showApply).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowApply err", zap.Error(err))
|
zap.L().Error("ShowApply err", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func UpdateShowApply(showApply *model.ShowApply) (tx *gorm.DB, err error) {
|
||||||
|
tx = db.DbArtShow.Begin()
|
||||||
|
err = tx.Model(&model.ShowApply{}).Omit("apply_uid").Where("apply_uid = ?", showApply.ApplyUID).Updates(showApply).Error
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("ShowApply err", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +42,7 @@ func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*mod
|
|||||||
out = make([]*model.ShowApply, 0)
|
out = make([]*model.ShowApply, 0)
|
||||||
queryDB := db.DbArtShow.Model(&model.ShowApply{})
|
queryDB := db.DbArtShow.Model(&model.ShowApply{})
|
||||||
if in.Status == 0 {
|
if in.Status == 0 {
|
||||||
in.Status = m.SHOWAPPLY_ADD
|
in.Status = m.SHOWAPPLYStatusOk
|
||||||
}
|
}
|
||||||
queryDB.Where("status = ?", in.Status)
|
queryDB.Where("status = ?", in.Status)
|
||||||
|
|
||||||
@ -51,9 +64,9 @@ func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*mod
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ShowApplyDetail(applyID uint) (err error, out *model.ShowApply) {
|
func ShowApplyDetail(applyUID string) (err error, out *model.ShowApply) {
|
||||||
out = new(model.ShowApply)
|
out = new(model.ShowApply)
|
||||||
err = db.DbArtShow.Model(&model.ShowApply{}).Where("id = ?", applyID).Find(&out).Error
|
err = db.DbArtShow.Model(&model.ShowApply{}).Where("apply_uid = ?", applyUID).Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowApplyDetail err", zap.Error(err))
|
zap.L().Error("ShowApplyDetail err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -63,7 +76,7 @@ func ShowApplyDetail(applyID uint) (err error, out *model.ShowApply) {
|
|||||||
|
|
||||||
func DelShowApply(in *artShow.DelApplyReq) (tx *gorm.DB, err error) {
|
func DelShowApply(in *artShow.DelApplyReq) (tx *gorm.DB, err error) {
|
||||||
tx = db.DbArtShow.Begin()
|
tx = db.DbArtShow.Begin()
|
||||||
err = tx.Delete(&model.ShowApply{}, in.ApplyID).Error
|
err = tx.Where("apply_uid = ?", in.ApplyUID).Delete(&model.ShowApply{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowApply delete err", zap.Error(err))
|
zap.L().Error("ShowApply delete err", zap.Error(err))
|
||||||
return
|
return
|
||||||
|
@ -3,35 +3,44 @@ package dao
|
|||||||
import (
|
import (
|
||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pkg/db"
|
"fonchain-artshow/pkg/db"
|
||||||
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SaveShowRels(tx *gorm.DB, showRels []*model.ShowRel) (err error, out []uint) {
|
func SaveShowRels(tx *gorm.DB, showRels []*model.ShowRel) (err error, out []string) {
|
||||||
out = make([]uint, 0)
|
out = make([]string, 0)
|
||||||
for i := 0; i < len(showRels); i++ {
|
for i := 0; i < len(showRels); i++ {
|
||||||
if showRels[i].ID != 0 {
|
uid, err := uuid.NewV4()
|
||||||
err = tx.Model(&model.ShowRel{}).Omit("id").Where("id = ?", showRels[i].ID).Updates(showRels[i]).Error
|
|
||||||
} else {
|
|
||||||
showRel := new(model.ShowRel)
|
|
||||||
results := tx.Model(&model.ArtworkPrice{}).Where("show_id = ? and apply_id = ?", showRels[i].ShowID, showRels[i].ApplyID).First(&showRel)
|
|
||||||
if results.Error == nil || showRel.ID == 0 {
|
|
||||||
err = tx.Model(&model.ArtworkPrice{}).Create(&showRels[i]).Error
|
|
||||||
} else {
|
|
||||||
err = tx.Model(&model.ArtworkPrice{}).Where("show_id = ? and apply_id = ?", showRels[i].ShowID, showRels[i].ApplyID).Updates(showRels[i]).Error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowRels err", zap.Error(err))
|
return err, out
|
||||||
|
}
|
||||||
|
showRels[i].ShowRelUID = uid.String()
|
||||||
|
err = tx.Model(&model.ShowRel{}).Create(&showRels[i]).Error
|
||||||
|
if err != nil {
|
||||||
|
zap.L().Error("ShowRels save err", zap.Error(err))
|
||||||
return err, nil
|
return err, nil
|
||||||
}
|
}
|
||||||
out = append(out, showRels[i].ID)
|
out = append(out, showRels[i].ApplyUID)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func UpdateShowRels(tx *gorm.DB, showRels []*model.ShowRel) (err error, out []string) {
|
||||||
|
out = make([]string, 0)
|
||||||
|
for i := 0; i < len(showRels); i++ {
|
||||||
|
results := tx.Model(&model.ShowRel{}).Where("show_uid = ? and apply_uid = ?", showRels[i].ShowUID, showRels[i].ApplyUID).First(&showRels[i])
|
||||||
|
if results.Error != nil {
|
||||||
|
zap.L().Error("ShowRels updates err", zap.Error(err))
|
||||||
|
return err, nil
|
||||||
|
}
|
||||||
|
out = append(out, showRels[i].ApplyUID)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveShowRel(tx *gorm.DB, showRel *model.ShowRel) (err error) {
|
func SaveShowRel(tx *gorm.DB, showRel *model.ShowRel) (err error) {
|
||||||
err = tx.Model(&model.ShowRel{}).Where("show_id = ?", showRel.ShowID).Updates(showRel).Error
|
err = tx.Model(&model.ShowRel{}).Where("show_uid = ?", showRel.ShowUID).Updates(showRel).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowRel err", zap.Error(err))
|
zap.L().Error("ShowRel err", zap.Error(err))
|
||||||
return err
|
return err
|
||||||
@ -39,8 +48,8 @@ func SaveShowRel(tx *gorm.DB, showRel *model.ShowRel) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DelShowRel(tx *gorm.DB, ids []int64) (err error) {
|
func DelShowRel(tx *gorm.DB, showRelUIDs []string) (err error) {
|
||||||
err = tx.Where("id in (?)", ids).Delete(&model.ShowRel{}).Error
|
err = tx.Where("show_rel_uid in (?)", showRelUIDs).Delete(&model.ShowRel{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowRel delete err", zap.Error(err))
|
zap.L().Error("ShowRel delete err", zap.Error(err))
|
||||||
return
|
return
|
||||||
@ -48,20 +57,20 @@ func DelShowRel(tx *gorm.DB, ids []int64) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DelShowRelByApplyID(tx *gorm.DB, applyID uint) (err error) {
|
func DelShowRelByApplyUID(tx *gorm.DB, applyUID string) (err error) {
|
||||||
err = tx.Where("apply_id = ? ", applyID).Delete(&model.ShowRel{}).Error
|
err = tx.Where("apply_uid = ? ", applyUID).Delete(&model.ShowRel{}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("ShowRel by applyID delete err", zap.Error(err))
|
zap.L().Error("ShowRel by applyUID delete err", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryShowRel_showId(showID int64) (err error, out *model.ShowRel) {
|
func QueryShowRel_showUID(showUID string) (err error, out *model.ShowRel) {
|
||||||
out = new(model.ShowRel)
|
out = new(model.ShowRel)
|
||||||
findDB := db.DbArtShow.Model(&model.ShowRel{})
|
findDB := db.DbArtShow.Model(&model.ShowRel{})
|
||||||
if showID != 0 {
|
if showUID != "" {
|
||||||
findDB = findDB.Where("show_id = ? ", showID)
|
findDB = findDB.Where("show_uid = ? ", showUID)
|
||||||
}
|
}
|
||||||
err = findDB.Find(&out).Error
|
err = findDB.Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -71,11 +80,11 @@ func QueryShowRel_showId(showID int64) (err error, out *model.ShowRel) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryShowRelList(applyID uint) (err error, out []*model.ShowRel) {
|
func QueryShowRelList(applyUID string) (err error, out []*model.ShowRel) {
|
||||||
out = make([]*model.ShowRel, 0)
|
out = make([]*model.ShowRel, 0)
|
||||||
findDB := db.DbArtShow.Model(&model.ShowRel{})
|
findDB := db.DbArtShow.Model(&model.ShowRel{})
|
||||||
if applyID != 0 {
|
if applyUID != "" {
|
||||||
findDB = findDB.Where("apply_id = ? ", applyID)
|
findDB = findDB.Where("apply_uid = ? ", applyUID)
|
||||||
}
|
}
|
||||||
err = findDB.Find(&out).Error
|
err = findDB.Find(&out).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
grpc2 "fonchain-artshow/pb/grpc"
|
grpc2 "fonchain-artshow/pb/grpc"
|
||||||
|
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
@ -5,10 +5,11 @@ import "gorm.io/gorm"
|
|||||||
type ArtShow struct {
|
type ArtShow struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
|
|
||||||
|
ShowUID string `json:"show_uid" gorm:"show_uid"`
|
||||||
ShowSeq string `json:"show_seq" gorm:"show_seq"` // 画展包序列
|
ShowSeq string `json:"show_seq" gorm:"show_seq"` // 画展包序列
|
||||||
ShowName string `json:"show_name" gorm:"show_name"` // 画展包名称
|
ShowName string `json:"show_name" gorm:"show_name"` // 画展包名称
|
||||||
ArtistName string `json:"artist_name" gorm:"artist_name"` // 画家
|
ArtistName string `json:"artist_name" gorm:"artist_name"` // 画家
|
||||||
ArtistID string `json:"artist_id" gorm:"artist_id"` // 画家ID
|
ArtistUID string `json:"artist_uid" gorm:"artist_uid"` // 画家ID
|
||||||
ArtworkNum int32 `json:"artwork_num" gorm:"artwork_num"` // 画作数量
|
ArtworkNum int32 `json:"artwork_num" gorm:"artwork_num"` // 画作数量
|
||||||
Ruler int32 `json:"ruler" gorm:"ruler"` // 画作总平尺
|
Ruler int32 `json:"ruler" gorm:"ruler"` // 画作总平尺
|
||||||
Price int64 `json:"price" gorm:"price"` // 画展包价格
|
Price int64 `json:"price" gorm:"price"` // 画展包价格
|
||||||
|
@ -5,8 +5,9 @@ import "gorm.io/gorm"
|
|||||||
type ArtworkPrice struct {
|
type ArtworkPrice struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
|
|
||||||
ShowID uint `json:"show_id" gorm:"show_id"` // 画展ID
|
ArtworkPriceUID string `json:"artwork_price_uid" gorm:"artwork_price_uid"`
|
||||||
ArtworkID int64 `json:"artwork_id" gorm:"artwork_id"` // 画作ID
|
ShowUID string `json:"show_uid" gorm:"show_uid"` // 画展ID
|
||||||
|
ArtworkUID string `json:"artwork_uid" gorm:"artwork_uid"` // 画作ID
|
||||||
ArtworkName string `json:"artwork_name" gorm:"artwork_name"` // 画作名称
|
ArtworkName string `json:"artwork_name" gorm:"artwork_name"` // 画作名称
|
||||||
ArtistName string `json:"artist_name" gorm:"artist_name"` // 画家名称
|
ArtistName string `json:"artist_name" gorm:"artist_name"` // 画家名称
|
||||||
SmallPic string `json:"small_pic" gorm:"small_pic"` // 画作小图
|
SmallPic string `json:"small_pic" gorm:"small_pic"` // 画作小图
|
||||||
|
@ -7,9 +7,10 @@ import (
|
|||||||
type ShowApply struct {
|
type ShowApply struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
|
|
||||||
|
ApplyUID string `json:"apply_uid" gorm:"apply_uid"`
|
||||||
ApplySeq string `json:"apply_seq" gorm:"apply_seq"` // 画展包申请序列号
|
ApplySeq string `json:"apply_seq" gorm:"apply_seq"` // 画展包申请序列号
|
||||||
Applicant string `json:"applicant" gorm:"applicant"` // 申请人
|
Applicant string `json:"applicant" gorm:"applicant"` // 申请人
|
||||||
ApplicantID uint `json:"applicant_id" gorm:"applicant_id"` // 申请人
|
ApplicantID string `json:"applicant_id" gorm:"applicant_id"` // 申请人
|
||||||
Num int32 `json:"num" gorm:"num"` // 申请画展包数量
|
Num int32 `json:"num" gorm:"num"` // 申请画展包数量
|
||||||
ApplyTime string `json:"apply_time" gorm:"apply_time"` // 申请时间
|
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"` // 申请画展包状态 10,创建 11,数量审批 12,数量审批驳回 13,关联画展包 14,画展包关联审批 15,关联审批驳回 16,可展
|
||||||
|
@ -5,12 +5,13 @@ import "gorm.io/gorm"
|
|||||||
type ShowRel struct {
|
type ShowRel struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
|
|
||||||
//ShowSeq string `json:"show_seq" gorm:"show_seq"` // 画展包序列
|
ShowRelUID string `json:"show_rel_uid" gorm:"show_rel_uid"` // 画展包申请关联画展UID
|
||||||
ShowID uint `json:"show_id" gorm:"show_id"` // 画展包ID
|
ShowUID string `json:"show_uid" gorm:"show_uid"` // 画展包ID
|
||||||
//ApplySeq string `json:"apply_seq" gorm:"apply_seq"` // 申请序列
|
ApplyUID string `json:"apply_uid" gorm:"show_uid"` // 申请ID
|
||||||
ApplyID uint `json:"apply_id" gorm:"apply_id"` // 申请ID
|
|
||||||
Index int32 `json:"index" gorm:"index"` // 申请下标
|
Index int32 `json:"index" gorm:"index"` // 申请下标
|
||||||
Address string `json:"address" gorm:"address"` // 参展地址
|
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、可展
|
//Status int32 `json:"status" gorm:"status"` // 参展状态 1、待展 2、驳回 3、可展
|
||||||
//Remark string `json:"remark" gorm:"remark"` // 备注
|
//Remark string `json:"remark" gorm:"remark"` // 备注
|
||||||
}
|
}
|
||||||
|
3
cmd/runtime/log/artwork_server.log
Normal file
3
cmd/runtime/log/artwork_server.log
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{"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'"}
|
@ -2,7 +2,6 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"fonchain-artshow/cmd/dao"
|
"fonchain-artshow/cmd/dao"
|
||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
@ -11,7 +10,8 @@ import (
|
|||||||
"fonchain-artshow/pkg/serializer"
|
"fonchain-artshow/pkg/serializer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID uint) {
|
// 创建 画展包 及 关联画作
|
||||||
|
func CreateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showUID string) {
|
||||||
artShowM := serializer.BuildArtShowM(in)
|
artShowM := serializer.BuildArtShowM(in)
|
||||||
|
|
||||||
tx := db.DbArtShow.Begin()
|
tx := db.DbArtShow.Begin()
|
||||||
@ -23,7 +23,7 @@ func CreateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID u
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(in.ShowArtwork) > 0 {
|
if len(in.ShowArtwork) > 0 {
|
||||||
artworks := serializer.BuildShowArtworkM(in.ShowArtwork, artShowM.ID)
|
artworks := serializer.BuildShowArtworkM(in.ShowArtwork, artShowM.ShowUID)
|
||||||
|
|
||||||
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
||||||
|
|
||||||
@ -31,35 +31,42 @@ func CreateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID u
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
for i := 0; i < len(artworks); i++ {
|
||||||
err, _ = dao.SaveArtworkPrice(tx, artworks)
|
err = dao.SaveArtworkPrice(tx, artworks[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = tx.Commit().Error
|
err = tx.Commit().Error
|
||||||
|
|
||||||
return err, artShowM.ID
|
return err, artShowM.ShowUID
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID uint) {
|
// 更新 画展包 及 关联画作
|
||||||
|
func UpdateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showUID string) {
|
||||||
err, artworkPrices := dao.ArtworkPriceList(uint(in.ID))
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
tx := db.DbArtShow.Begin()
|
tx := db.DbArtShow.Begin()
|
||||||
artShowM := serializer.BuildArtShowM(in) // 构建画展包数据
|
artShowM := serializer.BuildArtShowM(in) // 构建画展包数据
|
||||||
artworks := make([]*model.ArtworkPrice, 0)
|
artworks := make([]*model.ArtworkPrice, 0)
|
||||||
if len(in.ShowArtwork) < 1 && (in.Price != 0 || in.Reward != 0) {
|
|
||||||
artworks = artworkPrices
|
// 查询是否已有画作存在
|
||||||
} else {
|
err, artworkPrices := dao.ArtworkPriceList(in.ShowUID)
|
||||||
artworks = serializer.BuildShowArtworkM(in.ShowArtwork, uint(in.ID))
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(artworkPrices) > 0 {
|
||||||
|
artworks = append(artworks, artworkPrices...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断是否有新增画作
|
||||||
|
if len(in.ShowArtwork) > 0 {
|
||||||
|
showArtwork := serializer.BuildShowArtworkM(in.ShowArtwork, in.ShowUID)
|
||||||
|
artworks = append(artworks, showArtwork...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新 画作
|
||||||
if len(artworks) > 0 {
|
if len(artworks) > 0 {
|
||||||
if in.Price != 0 {
|
if in.Price != 0 {
|
||||||
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
artworks = serializer.CalcPrice(artShowM.Price, artShowM.Ruler, artworks)
|
||||||
@ -70,54 +77,66 @@ func UpdateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID u
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(artworks); i++ {
|
||||||
|
if artworks[i].ArtworkPriceUID != "" {
|
||||||
// 更新画作价格
|
// 更新画作价格
|
||||||
err, _ := dao.SaveArtworkPrice(tx, artworks)
|
err := dao.UpdateArtworkPrice(tx, artworks[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return err, 0
|
return err, ""
|
||||||
}
|
}
|
||||||
// 删除旧画作
|
} else {
|
||||||
//_, del, _ := utils.BeUniqueSlice_uint(serializer.BuildArtworkPriceIDs(artworkPrices), newIDs)
|
err = dao.SaveArtworkPrice(tx, artworks[i])
|
||||||
if len(in.DelShowArtwork) > 0 {
|
|
||||||
del := make([]int64, 0)
|
|
||||||
for i := 0; i < len(in.DelShowArtwork); i++ {
|
|
||||||
del = append(del, in.DelShowArtwork[i].ID)
|
|
||||||
}
|
|
||||||
err = dao.DelArtworkPrice(tx, del)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return err, 0
|
return err, ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除旧画作
|
||||||
|
if len(in.DelShowArtwork) > 0 {
|
||||||
|
del := make([]string, 0)
|
||||||
|
for i := 0; i < len(in.DelShowArtwork); i++ {
|
||||||
|
del = append(del, in.DelShowArtwork[i].ArtworkPriceUID)
|
||||||
|
}
|
||||||
|
err = dao.DelArtworkPrice(tx, del)
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return err, ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 更新画展包
|
// 更新画展包
|
||||||
err = dao.SaveArtShow(tx, artShowM)
|
err = dao.UpdateArtShow(tx, artShowM)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tx.Commit().Error
|
err = tx.Commit().Error
|
||||||
return err, artShowM.ID
|
return err, artShowM.ShowUID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除画展包
|
||||||
func DelArtShow(in *artShow.DelShowReq) (err error) {
|
func DelArtShow(in *artShow.DelShowReq) (err error) {
|
||||||
tx := db.DbArtShow.Begin()
|
tx := db.DbArtShow.Begin()
|
||||||
for i := 0; i < len(in.ShowID); i++ {
|
for i := 0; i < len(in.ShowUID); i++ {
|
||||||
queryShowRelErr, show_rel := dao.QueryShowRel_showId(in.ShowID[i])
|
queryShowRelErr, show_rel := dao.QueryShowRel_showUID(in.ShowUID[i])
|
||||||
if queryShowRelErr == nil && show_rel.ID == 0 {
|
if queryShowRelErr == nil && show_rel.ID == 0 {
|
||||||
delArtShowErr := dao.DelArtShow(tx, in.ShowID[i])
|
delArtShowErr := dao.DelArtShow(tx, in.ShowUID[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return delArtShowErr
|
return delArtShowErr
|
||||||
}
|
}
|
||||||
delArtworkPriceErr := dao.DelArtworkPrice_showId(tx, in.ShowID[i])
|
delArtworkPriceErr := dao.DelArtworkPrice_showUID(tx, in.ShowUID[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return delArtworkPriceErr
|
return delArtworkPriceErr
|
||||||
}
|
}
|
||||||
} else if show_rel.ShowID != 0 {
|
} else if show_rel.ShowUID != "" {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return errors.New("存在画展包被使用,无法删除")
|
return errors.New("存在画展包被使用,无法删除")
|
||||||
}
|
}
|
||||||
@ -127,6 +146,7 @@ func DelArtShow(in *artShow.DelShowReq) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 画展包列表
|
||||||
func ArtShowList(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes) {
|
func ArtShowList(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes) {
|
||||||
out = new(artShow.ShowListRes)
|
out = new(artShow.ShowListRes)
|
||||||
artShows := make([]*model.ArtShow, 0)
|
artShows := make([]*model.ArtShow, 0)
|
||||||
@ -142,10 +162,11 @@ func ArtShowList(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 画展包关联画作信息
|
||||||
func ShowArtworkInfo(in *artShow.ShowDetailReq) (err error, out *artShow.ShowArtworkDetailRes) {
|
func ShowArtworkInfo(in *artShow.ShowDetailReq) (err error, out *artShow.ShowArtworkDetailRes) {
|
||||||
out = new(artShow.ShowArtworkDetailRes)
|
out = new(artShow.ShowArtworkDetailRes)
|
||||||
artworkPriceS := make([]*model.ArtworkPrice, 0)
|
artworkPriceS := make([]*model.ArtworkPrice, 0)
|
||||||
err, artworkPriceS = dao.ArtworkPriceList(uint(in.ShowID))
|
err, artworkPriceS = dao.ArtworkPriceList(in.ShowUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -153,15 +174,15 @@ func ShowArtworkInfo(in *artShow.ShowDetailReq) (err error, out *artShow.ShowArt
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 画展包详情
|
||||||
func ShowDetail(in *artShow.ShowDetailReq) (err error, out *artShow.ShowDetailRes) {
|
func ShowDetail(in *artShow.ShowDetailReq) (err error, out *artShow.ShowDetailRes) {
|
||||||
out = new(artShow.ShowDetailRes)
|
out = new(artShow.ShowDetailRes)
|
||||||
show := new(model.ArtShow)
|
show := new(model.ArtShow)
|
||||||
err, show = dao.QueryArtShow(uint(in.ShowID))
|
err, show = dao.QueryArtShow(in.ShowUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out.Data = serializer.BuildArtShowRpc(show)
|
out.Data = serializer.BuildArtShowRpc(show)
|
||||||
fmt.Println(out.Data)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,95 +1,91 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"fonchain-artshow/cmd/dao"
|
"fonchain-artshow/cmd/dao"
|
||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
"fonchain-artshow/pkg/m"
|
"fonchain-artshow/pkg/m"
|
||||||
"fonchain-artshow/pkg/serializer"
|
"fonchain-artshow/pkg/serializer"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateShowApply(in *artShow.SaveApplyReq) (err error, applyID uint) {
|
// 创建画展包申请
|
||||||
|
func CreateShowApply(in *artShow.SaveApplyReq) (err error, applyUID string) {
|
||||||
showApply := serializer.BuildShowApply(in)
|
showApply := serializer.BuildShowApply(in)
|
||||||
|
err = dao.SaveShowApply(showApply)
|
||||||
tx, err := dao.SaveShowApply(showApply)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = tx.Commit().Error
|
return err, showApply.ApplyUID
|
||||||
|
|
||||||
// 申请画展包时,暂时不携带画展包信息
|
|
||||||
/* showRels := serializer.BuildShowRel(in.Rel, showApply.ID)
|
|
||||||
err = dao.SaveShowRels(tx, showRels)
|
|
||||||
if err != nil {
|
|
||||||
tx.Rollback()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
err = tx.Commit().Error*/
|
|
||||||
return err, showApply.ID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateShowApplyWithShowRel(in *artShow.SaveApplyReq) (err error, applyID uint) {
|
// 更新画展包申请 及 关联记录
|
||||||
|
func UpdateShowApplyWithShowRel(in *artShow.SaveApplyReq) (err error, applyUID string) {
|
||||||
|
|
||||||
// 更新画展包申请
|
// 更新画展包申请
|
||||||
showApply := serializer.BuildShowApply(in)
|
showApply := serializer.BuildShowApply(in)
|
||||||
tx, err := dao.SaveShowApply(showApply)
|
tx, err := dao.UpdateShowApply(showApply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新画展包申请关系
|
// 更新 关联的 画展包的状态 为 已展
|
||||||
if len(in.Rel) > 0 {
|
if len(in.Rel) > 0 {
|
||||||
// 保存 新 show_rel
|
// 保存 新 show_rel
|
||||||
newShowRelS := serializer.BuildShowRelM(in.Rel, showApply.ID)
|
newShowRelS := serializer.BuildShowRelM(in.Rel, showApply.ApplyUID)
|
||||||
err, _ := dao.SaveShowRels(tx, newShowRelS)
|
err, _ := dao.SaveShowRels(tx, newShowRelS)
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return err, showApply.ApplyUID
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < len(newShowRelS); i++ {
|
for i := 0; i < len(newShowRelS); i++ {
|
||||||
// 更新 画展包状态 为 已展
|
// 更新 画展包状态 为 已展
|
||||||
show := serializer.BuildArtShowIsShowM(newShowRelS[i].ShowID, m.ARTSHOW_SHOWING)
|
show := serializer.BuildArtShowIsShowM(newShowRelS[i].ShowUID, m.ARTSHOW_SHOWING)
|
||||||
err := dao.SaveArtShow(tx, show)
|
err := dao.UpdateArtShow(tx, show)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return err, showApply.ID
|
return err, showApply.ApplyUID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(in.DelRel) > 0 { // 如果 旧 show_rel 有数据 则 删除 旧记录(去除 保留下来的)
|
// 更新 取消关联的 画展包的状态 为 可展
|
||||||
del := make([]int64, 0)
|
if len(in.DelRel) > 0 {
|
||||||
|
del := make([]string, 0)
|
||||||
for i := 0; i < len(in.DelRel); i++ {
|
for i := 0; i < len(in.DelRel); i++ {
|
||||||
del = append(del, in.DelRel[i].ID)
|
del = append(del, in.DelRel[i].ShowRelUID)
|
||||||
|
|
||||||
// 更新 画展包状态 为 可展
|
// 更新 画展包状态 为 可展
|
||||||
show := serializer.BuildArtShowIsShowM(newShowRelS[i].ShowID, m.ARTSHOW_PASS)
|
show := serializer.BuildArtShowIsShowM(in.DelRel[i].ShowUID, m.ARTSHOW_PASS)
|
||||||
err := dao.SaveArtShow(tx, show)
|
err := dao.UpdateArtShow(tx, show)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return err, showApply.ID
|
return err, showApply.ApplyUID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除关联记录
|
||||||
err = dao.DelShowRel(tx, del)
|
err = dao.DelShowRel(tx, del)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return err, showApply.ID
|
return err, showApply.ApplyUID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err = tx.Commit().Error
|
err = tx.Commit().Error
|
||||||
return err, showApply.ID
|
return err, showApply.ApplyUID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新画展包申请状态
|
||||||
func UpdateShowApplyStatus(in *artShow.UpdateApplyStatusReq) (err error) {
|
func UpdateShowApplyStatus(in *artShow.UpdateApplyStatusReq) (err error) {
|
||||||
|
|
||||||
// 更新画展包申请 状态
|
|
||||||
showApply := &model.ShowApply{
|
showApply := &model.ShowApply{
|
||||||
Model: gorm.Model{ID: uint(in.ApplyID)},
|
ApplyUID: in.ApplyUID,
|
||||||
Status: int(in.Status),
|
Status: int(in.Status),
|
||||||
Remark: in.Remark,
|
Remark: in.Remark,
|
||||||
}
|
}
|
||||||
tx, err := dao.SaveShowApply(showApply)
|
tx, err := dao.UpdateShowApply(showApply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return
|
return
|
||||||
@ -98,6 +94,7 @@ func UpdateShowApplyStatus(in *artShow.UpdateApplyStatusReq) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询画展包申请列表
|
||||||
func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*artShow.ApplyDetail) {
|
func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*artShow.ApplyDetail) {
|
||||||
out = make([]*artShow.ApplyDetail, 0)
|
out = make([]*artShow.ApplyDetail, 0)
|
||||||
err, total, applyList := dao.ShowApplyList(in)
|
err, total, applyList := dao.ShowApplyList(in)
|
||||||
@ -113,44 +110,65 @@ func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*art
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ShowApplyDetail(applyID uint) (err error, out *artShow.ApplyShowRes) {
|
// 查询画展包申请详情
|
||||||
|
func ShowApplyDetail(applyUID string) (err error, out *artShow.ApplyShowRes) {
|
||||||
out = new(artShow.ApplyShowRes)
|
out = new(artShow.ApplyShowRes)
|
||||||
|
|
||||||
err, showApply := dao.ShowApplyDetail(applyID)
|
err, showApply := dao.ShowApplyDetail(applyUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out.Apply = serializer.BuildShowApplyRes(showApply)
|
out.Apply = serializer.BuildShowApplyRes(showApply)
|
||||||
|
|
||||||
err, artShow := dao.ArtShowList_apply(applyID)
|
err, artShow := dao.ArtShowList_apply(applyUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out.Show = serializer.BuildArtShowListRes(artShow)
|
out.Show = serializer.BuildArtShowListRes(artShow)
|
||||||
|
fmt.Println(out.Show)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DelApplyByApplyID(in *artShow.DelApplyReq) (err error) {
|
// 删除画展包申请记录
|
||||||
|
func DelApplyByApplyUID(in *artShow.DelApplyReq) (err error) {
|
||||||
tx, err := dao.DelShowApply(in)
|
tx, err := dao.DelShowApply(in)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(in.ApplyID); i++ {
|
for i := 0; i < len(in.ApplyUID); i++ {
|
||||||
err = dao.DelShowRelByApplyID(tx, uint(in.ApplyID[i]))
|
err = dao.DelShowRelByApplyUID(tx, in.ApplyUID[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
queryShowRelErr, showRels := dao.QueryShowRelList(in.ApplyUID[i])
|
||||||
|
if queryShowRelErr != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return queryShowRelErr
|
||||||
|
}
|
||||||
|
if len(showRels) > 0 {
|
||||||
|
for i := 0; i < len(showRels); i++ {
|
||||||
|
// 更新 画展包状态 为 可展
|
||||||
|
show := serializer.BuildArtShowIsShowM(showRels[i].ShowUID, m.ARTSHOW_PASS)
|
||||||
|
updateArtShowErr := dao.UpdateArtShow(tx, show)
|
||||||
|
if updateArtShowErr != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return updateArtShowErr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
err = tx.Commit().Error
|
err = tx.Commit().Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryShowRel_showId(showID int64) (err error, out *model.ShowRel) {
|
// 查询画展包申请关联记录
|
||||||
|
func QueryShowRel_showUID(showUID string) (err error, out *model.ShowRel) {
|
||||||
out = new(model.ShowRel)
|
out = new(model.ShowRel)
|
||||||
err, out = dao.QueryShowRel_showId(showID)
|
err, out = dao.QueryShowRel_showUID(showUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err, nil
|
return err, nil
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func ArtworkPriceInfo(in *artShow.ArtworkPriceReq) (err error, artworkPriceRes *artShow.ArtworkPriceRes) {
|
func ArtworkPriceInfo(in *artShow.ArtworkPriceReq) (err error, artworkPriceRes *artShow.ArtworkPriceRes) {
|
||||||
err, artworkPrice := dao.QueryArtworkPrice_artworkID(in.ArtworkID)
|
err, artworkPrice := dao.QueryArtworkPrice_artworkUID(in.ArtworkUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
mode = dev #正式prod #测试dev
|
mode = dev #正式prod #测试dev
|
||||||
|
|
||||||
;本地测试
|
;本地测试
|
||||||
;[mysql]
|
[mysql]
|
||||||
;Db = mysql
|
Db = mysql
|
||||||
;DbHost = 127.0.0.1
|
DbHost = 127.0.0.1
|
||||||
;DbPort = 3306
|
DbPort = 3306
|
||||||
;DbUser = root
|
DbUser = root
|
||||||
;DbPassWord = 123456
|
DbPassWord = 123456
|
||||||
;DbName = art_show
|
DbName = art_show
|
||||||
|
|
||||||
;正式服
|
;正式服
|
||||||
;[mysql]
|
;[mysql]
|
||||||
@ -30,13 +30,13 @@ mode = dev #正式prod #测试dev
|
|||||||
;DbName = art_show
|
;DbName = art_show
|
||||||
|
|
||||||
;214
|
;214
|
||||||
[mysql]
|
;[mysql]
|
||||||
Db = mysql
|
;Db = mysql
|
||||||
DbHost = 172.16.100.99 #214
|
;DbHost = 172.16.100.99 #214
|
||||||
DbPort = 9007
|
;DbPort = 9007
|
||||||
DbUser = artuser
|
;DbUser = artuser
|
||||||
DbPassWord = "C250PflXIWv2SQm8"
|
;DbPassWord = "C250PflXIWv2SQm8"
|
||||||
DbName = art_show
|
;DbName = art_show
|
||||||
|
|
||||||
;[mysql]
|
;[mysql]
|
||||||
;Db = mysql
|
;Db = mysql
|
||||||
|
@ -3,8 +3,8 @@ dubbo:
|
|||||||
demoZK:
|
demoZK:
|
||||||
protocol: zookeeper
|
protocol: zookeeper
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
# address: zookeeper:2181
|
# address: zookeeper:2181 # 正式服务
|
||||||
address: 127.0.0.1:2181
|
address: 127.0.0.1:2181 # 测试服务
|
||||||
protocols:
|
protocols:
|
||||||
triple: #triple
|
triple: #triple
|
||||||
name: tri
|
name: tri
|
||||||
|
2
go.mod
2
go.mod
@ -6,6 +6,7 @@ replace github.com/fonchain_enterprise/utils/aes => ../utils/aes
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
dubbo.apache.org/dubbo-go/v3 v3.0.2
|
dubbo.apache.org/dubbo-go/v3 v3.0.2
|
||||||
|
github.com/360EntSecGroup-Skylar/excelize v1.4.1
|
||||||
github.com/dubbogo/grpc-go v1.42.10
|
github.com/dubbogo/grpc-go v1.42.10
|
||||||
github.com/dubbogo/triple v1.1.8
|
github.com/dubbogo/triple v1.1.8
|
||||||
github.com/fonchain_enterprise/utils/aes v0.0.0-00010101000000-000000000000
|
github.com/fonchain_enterprise/utils/aes v0.0.0-00010101000000-000000000000
|
||||||
@ -96,6 +97,7 @@ require (
|
|||||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||||
github.com/mschoch/smat v0.2.0 // indirect
|
github.com/mschoch/smat v0.2.0 // indirect
|
||||||
github.com/nacos-group/nacos-sdk-go v1.1.1 // indirect
|
github.com/nacos-group/nacos-sdk-go v1.1.1 // indirect
|
||||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||||
|
5
go.sum
5
go.sum
@ -37,6 +37,8 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZ
|
|||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
dubbo.apache.org/dubbo-go/v3 v3.0.2 h1:+WuMFN6RSjXHT41QS1Xi5tFfaPuczIVoeQuKq7pISYI=
|
dubbo.apache.org/dubbo-go/v3 v3.0.2 h1:+WuMFN6RSjXHT41QS1Xi5tFfaPuczIVoeQuKq7pISYI=
|
||||||
dubbo.apache.org/dubbo-go/v3 v3.0.2/go.mod h1:bODgByAf72kzG/5YIfZIODXx81pY3gaAdIQ8B4mN/Yk=
|
dubbo.apache.org/dubbo-go/v3 v3.0.2/go.mod h1:bODgByAf72kzG/5YIfZIODXx81pY3gaAdIQ8B4mN/Yk=
|
||||||
|
github.com/360EntSecGroup-Skylar/excelize v1.4.1 h1:l55mJb6rkkaUzOpSsgEeKYtS6/0gHwBYyfo5Jcjv/Ks=
|
||||||
|
github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE=
|
||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
@ -567,6 +569,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
|
|||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||||
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||||
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||||
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
|
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
|
||||||
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
|
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
|
||||||
@ -740,6 +744,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||||||
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
|
github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
|
File diff suppressed because it is too large
Load Diff
3750
pb/artShow/artshow.pb.validate.go
Normal file
3750
pb/artShow/artshow.pb.validate.go
Normal file
File diff suppressed because it is too large
Load Diff
609
pb/artShow/artshow_grpc.pb.go
Normal file
609
pb/artShow/artshow_grpc.pb.go
Normal file
@ -0,0 +1,609 @@
|
|||||||
|
// 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",
|
||||||
|
}
|
@ -25,7 +25,7 @@ service ArtShow {
|
|||||||
message SaveShowReq {
|
message SaveShowReq {
|
||||||
string ShowName = 1 [json_name = "show_name"];
|
string ShowName = 1 [json_name = "show_name"];
|
||||||
string ArtistName = 2 [json_name = "artist_name"];
|
string ArtistName = 2 [json_name = "artist_name"];
|
||||||
string ArtistID = 3 [json_name = "artist_id"];
|
string ArtistUID = 3 [json_name = "artist_uid"];
|
||||||
int32 ArtworkNum = 4 [json_name = "artwork_num"];
|
int32 ArtworkNum = 4 [json_name = "artwork_num"];
|
||||||
int32 Ruler = 5 [json_name = "ruler"];
|
int32 Ruler = 5 [json_name = "ruler"];
|
||||||
int64 Price = 6 [json_name = "price"];
|
int64 Price = 6 [json_name = "price"];
|
||||||
@ -33,15 +33,16 @@ message SaveShowReq {
|
|||||||
int32 IsShow = 8 [json_name = "is_show"];
|
int32 IsShow = 8 [json_name = "is_show"];
|
||||||
string ShowTime = 9 [json_name = "show_time"];
|
string ShowTime = 9 [json_name = "show_time"];
|
||||||
|
|
||||||
repeated ShowArtworkDetail ShowArtwork = 10 [json_name = "show_artwork"];
|
string ShowUID = 10 [json_name = "id"];
|
||||||
repeated DelArtworkDetail DelShowArtwork = 11 [json_name = "del_show_artwork"];
|
|
||||||
|
repeated ShowArtworkDetail ShowArtwork = 11 [json_name = "show_artwork"];
|
||||||
|
repeated DelArtworkDetail DelShowArtwork = 12 [json_name = "del_show_artwork"];
|
||||||
|
|
||||||
int64 ID = 12 [json_name = "id"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message SaveShowRes {
|
message SaveShowRes {
|
||||||
string Msg = 1 [json_name = "msg"];
|
string Msg = 1 [json_name = "msg"];
|
||||||
int64 ShowID = 2 [json_name = "show_id"];
|
string ShowUID = 2 [json_name = "show_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message CommonRes {
|
message CommonRes {
|
||||||
@ -50,15 +51,15 @@ message CommonRes {
|
|||||||
|
|
||||||
// 画展包详情
|
// 画展包详情
|
||||||
message ShowDetailReq {
|
message ShowDetailReq {
|
||||||
int64 ShowID = 1 [json_name = "show_id"];
|
string ShowUID = 1 [json_name = "show_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ShowDetail {
|
message ShowDetail {
|
||||||
int64 ID = 1 [json_name = "id"];
|
string ShowUID = 1 [json_name = "show_uid"];
|
||||||
string ShowSeq = 2 [json_name = "show_seq"];
|
string ShowSeq = 2 [json_name = "show_seq"];
|
||||||
string ShowName = 3 [json_name = "show_name"];
|
string ShowName = 3 [json_name = "show_name"];
|
||||||
string ArtistName = 4 [json_name = "artist_name"];
|
string ArtistName = 4 [json_name = "artist_name"];
|
||||||
string ArtistID = 5 [json_name = "artist_id"];
|
string ArtistUID = 5 [json_name = "artist_uid"];
|
||||||
int32 ArtworkNum = 6 [json_name = "artwork_num"];
|
int32 ArtworkNum = 6 [json_name = "artwork_num"];
|
||||||
int32 Ruler = 7 [json_name = "ruler"];
|
int32 Ruler = 7 [json_name = "ruler"];
|
||||||
int64 Price = 8 [json_name = "price"];
|
int64 Price = 8 [json_name = "price"];
|
||||||
@ -84,7 +85,7 @@ message ShowListReq {
|
|||||||
|
|
||||||
string StartTime = 3 [json_name = "start_time"];
|
string StartTime = 3 [json_name = "start_time"];
|
||||||
string EndTime = 4 [json_name = "end_time"];
|
string EndTime = 4 [json_name = "end_time"];
|
||||||
string ArtistID = 5 [json_name = "artist_id"];
|
string ArtistUID = 5 [json_name = "artist_uid"];
|
||||||
int32 IsShow = 6 [json_name = "is_show"];
|
int32 IsShow = 6 [json_name = "is_show"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,14 +100,14 @@ message ShowListRes {
|
|||||||
|
|
||||||
// 删除画展包
|
// 删除画展包
|
||||||
message DelShowReq {
|
message DelShowReq {
|
||||||
repeated int64 ShowID = 1 [json_name = "show_id"];
|
repeated string ShowUID = 1 [json_name = "show_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 画展包中画作详情 除价格
|
// 画展包中画作详情 除价格
|
||||||
message ShowArtworkDetail {
|
message ShowArtworkDetail {
|
||||||
int64 ID = 1 [json_name = "id"];
|
string ArtworkPriceUID = 1 [json_name = "artwork_price_uid"];
|
||||||
int64 ShowID =2 [json_name = "show_id"];
|
string ShowUID =2 [json_name = "show_uid"];
|
||||||
int64 ArtworkID = 3 [json_name = "artwork_id"];
|
string ArtworkUID = 3 [json_name = "artwork_uid"];
|
||||||
string ArtworkName = 4 [json_name = "artwork_name"];
|
string ArtworkName = 4 [json_name = "artwork_name"];
|
||||||
string ArtistName = 5 [json_name = "artist_name"];
|
string ArtistName = 5 [json_name = "artist_name"];
|
||||||
int32 Length = 6 [json_name = "length"];
|
int32 Length = 6 [json_name = "length"];
|
||||||
@ -117,8 +118,8 @@ message ShowArtworkDetail {
|
|||||||
|
|
||||||
// 画展包 删除的画作信息
|
// 画展包 删除的画作信息
|
||||||
message DelArtworkDetail {
|
message DelArtworkDetail {
|
||||||
int64 ID = 1 [json_name = "id"];
|
string ArtworkPriceUID = 1 [json_name = "artwork_price_uid"];
|
||||||
int64 ArtworkID = 2 [json_name = "artwork_id"];
|
string ArtworkUID = 2 [json_name = "artwork_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 画展包 画家 画作 统计数据
|
// 画展包 画家 画作 统计数据
|
||||||
@ -140,7 +141,7 @@ message ShowStatisticalInfoRes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ArtworkPriceReq {
|
message ArtworkPriceReq {
|
||||||
int64 ArtworkID = 1 [json_name = "artwork_id"];
|
string ArtworkUID = 1 [json_name = "artwork_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ArtworkPriceRes {
|
message ArtworkPriceRes {
|
||||||
@ -157,25 +158,25 @@ message ArtworkPriceRes {
|
|||||||
|
|
||||||
|
|
||||||
message ShowRel {
|
message ShowRel {
|
||||||
int64 ID = 1 [json_name = "id"];
|
string ShowRelUID = 1 [json_name = "show_rel_uid"];
|
||||||
int64 ApplyID = 2 [json_name = "apply_id"];
|
string ApplyUID = 2 [json_name = "apply_uid"];
|
||||||
int64 ShowID = 3 [json_name = "show_id"];
|
string ShowUID = 3 [json_name = "show_uid"];
|
||||||
int32 Index = 4 [json_name = "index"];
|
int32 Index = 4 [json_name = "index"];
|
||||||
string Address = 5 [json_name = "address"];
|
string Address = 5 [json_name = "address"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message DelShowRel {
|
message DelShowRel {
|
||||||
int64 ID = 1 [json_name = "id"];
|
string ShowRelUID = 1 [json_name = "show_rel_uid"];
|
||||||
int64 ShowID = 2 [json_name = "show_id"];
|
string ShowUID = 2 [json_name = "show_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message SaveApplyReq {
|
message SaveApplyReq {
|
||||||
string Applicant = 1 [json_name = "applicant"];
|
string Applicant = 1 [json_name = "applicant"];
|
||||||
int64 ApplicantID = 2 [json_name = "applicant_id"];
|
string ApplicantID = 2 [json_name = "applicant_id"];
|
||||||
int32 Num = 3 [json_name = "num"];
|
int32 Num = 3 [json_name = "num"];
|
||||||
string ApplyTime = 4 [json_name = "apply_time"];
|
string ApplyTime = 4 [json_name = "apply_time"];
|
||||||
int64 ID = 5 [json_name = "id"];
|
string ApplyUID = 5 [json_name = "apply_uid"];
|
||||||
int32 Status = 6 [json_name = "status"];
|
int32 Status = 6 [json_name = "status"];
|
||||||
string Remark = 7 [json_name = "remark"];
|
string Remark = 7 [json_name = "remark"];
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ message SaveApplyReq {
|
|||||||
|
|
||||||
message SaveApplyRes {
|
message SaveApplyRes {
|
||||||
string Msg = 1 [json_name = "msg"];
|
string Msg = 1 [json_name = "msg"];
|
||||||
int64 ApplyID = 2 [json_name = "apply_id"];
|
string ApplyUID = 2 [json_name = "apply_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ApplyListReq {
|
message ApplyListReq {
|
||||||
@ -201,7 +202,7 @@ message ApplyListRes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ApplyShowReq {
|
message ApplyShowReq {
|
||||||
int64 ApplyID = 1 [json_name = "apply_id"];
|
string ApplyUID = 1 [json_name = "apply_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ApplyShowRes {
|
message ApplyShowRes {
|
||||||
@ -211,10 +212,10 @@ message ApplyShowRes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ApplyDetail {
|
message ApplyDetail {
|
||||||
int64 ID = 1 [json_name = "id"];
|
string ApplyUID = 1 [json_name = "apply_uid"];
|
||||||
string ApplySeq = 2 [json_name = "apply_seq"];
|
string ApplySeq = 2 [json_name = "apply_seq"];
|
||||||
string Applicant = 3 [json_name = "applicant"];
|
string Applicant = 3 [json_name = "applicant"];
|
||||||
int64 ApplicantID = 4 [json_name = "applicant_id"];
|
string ApplicantID = 4 [json_name = "applicant_id"];
|
||||||
int32 Num = 5 [json_name = "num"];
|
int32 Num = 5 [json_name = "num"];
|
||||||
string ApplyTime = 6 [json_name = "apply_time"];
|
string ApplyTime = 6 [json_name = "apply_time"];
|
||||||
int32 Status = 7 [json_name = "status"];
|
int32 Status = 7 [json_name = "status"];
|
||||||
@ -222,7 +223,7 @@ message ApplyDetail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ShowRelListReq {
|
message ShowRelListReq {
|
||||||
int64 ApplyID = 1 [json_name = "apply_id"];
|
string ApplyUID = 1 [json_name = "apply_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ShowRelListRes {
|
message ShowRelListRes {
|
||||||
@ -233,9 +234,9 @@ message ShowRelListRes {
|
|||||||
message UpdateApplyStatusReq {
|
message UpdateApplyStatusReq {
|
||||||
int32 Status = 1 [json_name = "status"];
|
int32 Status = 1 [json_name = "status"];
|
||||||
string Remark = 2 [json_name = "remark"];
|
string Remark = 2 [json_name = "remark"];
|
||||||
int64 ApplyID = 3 [json_name = "apply_id"];
|
string ApplyUID = 3 [json_name = "apply_uid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message DelApplyReq {
|
message DelApplyReq {
|
||||||
repeated int64 ApplyID = 1 [json_name = "apply_id"];
|
repeated string ApplyUID = 1 [json_name = "apply_uid"];
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,10 @@ const (
|
|||||||
SHOWAPPLY_SHOW // 画展包关联审批
|
SHOWAPPLY_SHOW // 画展包关联审批
|
||||||
SHOWAPPLY_SHOW_REJECT // 关联审批驳回
|
SHOWAPPLY_SHOW_REJECT // 关联审批驳回
|
||||||
SHOWAPPLY_PASS // 可展
|
SHOWAPPLY_PASS // 可展
|
||||||
|
|
||||||
|
SHOWAPPLYStatusDoing = 1
|
||||||
|
SHOWAPPLYStatusOk = 2
|
||||||
|
SHOWAPPLYStatusFail = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,20 +4,15 @@ import (
|
|||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
"fonchain-artshow/pkg/m"
|
"fonchain-artshow/pkg/m"
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildArtShowM(in *artShow.SaveShowReq) (out *model.ArtShow) {
|
func BuildArtShowM(in *artShow.SaveShowReq) (out *model.ArtShow) {
|
||||||
out = new(model.ArtShow)
|
out = new(model.ArtShow)
|
||||||
if in.ID == 0 {
|
|
||||||
out.ShowSeq = strings.Join([]string{m.ARTSHOW_PREFIX, time.Now().Format("20060102150405")}, "")
|
out.ShowUID = in.ShowUID
|
||||||
} else {
|
|
||||||
out.ID = uint(in.ID)
|
|
||||||
}
|
|
||||||
out.ShowName = in.ShowName
|
out.ShowName = in.ShowName
|
||||||
out.ArtistName = in.ArtistName
|
out.ArtistName = in.ArtistName
|
||||||
out.ArtistID = in.ArtistID
|
out.ArtistUID = in.ArtistUID
|
||||||
out.ArtworkNum = in.ArtworkNum
|
out.ArtworkNum = in.ArtworkNum
|
||||||
out.Price = in.Price
|
out.Price = in.Price
|
||||||
out.Ruler = in.Ruler
|
out.Ruler = in.Ruler
|
||||||
@ -43,11 +38,11 @@ func BuildArtShowListRes(artShows []*model.ArtShow) (out []*artShow.ShowDetail)
|
|||||||
|
|
||||||
func BuildArtShowRpc(artShowM *model.ArtShow) (out *artShow.ShowDetail) {
|
func BuildArtShowRpc(artShowM *model.ArtShow) (out *artShow.ShowDetail) {
|
||||||
out = new(artShow.ShowDetail)
|
out = new(artShow.ShowDetail)
|
||||||
out.ID = int64(artShowM.ID)
|
out.ShowUID = artShowM.ShowUID
|
||||||
out.ShowSeq = artShowM.ShowSeq
|
out.ShowSeq = artShowM.ShowSeq
|
||||||
out.ShowName = artShowM.ShowName
|
out.ShowName = artShowM.ShowName
|
||||||
out.ArtistName = artShowM.ArtistName
|
out.ArtistName = artShowM.ArtistName
|
||||||
out.ArtistID = artShowM.ArtistID
|
out.ArtistUID = artShowM.ArtistUID
|
||||||
out.ArtworkNum = artShowM.ArtworkNum
|
out.ArtworkNum = artShowM.ArtworkNum
|
||||||
out.Ruler = artShowM.Ruler
|
out.Ruler = artShowM.Ruler
|
||||||
out.Price = artShowM.Price
|
out.Price = artShowM.Price
|
||||||
@ -57,9 +52,9 @@ func BuildArtShowRpc(artShowM *model.ArtShow) (out *artShow.ShowDetail) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildArtShowIsShowM(artShowIds uint, isShow int8) (out *model.ArtShow) {
|
func BuildArtShowIsShowM(show_uid string, isShow int8) (out *model.ArtShow) {
|
||||||
out = new(model.ArtShow)
|
out = new(model.ArtShow)
|
||||||
out.ID = artShowIds
|
out.ShowUID = show_uid
|
||||||
out.IsShow = isShow
|
out.IsShow = isShow
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -5,24 +5,22 @@ import (
|
|||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildShowArtworkM(in []*artShow.ShowArtworkDetail, showID uint) (out []*model.ArtworkPrice) {
|
func BuildShowArtworkM(in []*artShow.ShowArtworkDetail, showUID string) (out []*model.ArtworkPrice) {
|
||||||
out = make([]*model.ArtworkPrice, len(in))
|
out = make([]*model.ArtworkPrice, len(in))
|
||||||
for i := 0; i < len(in); i++ {
|
for i := 0; i < len(in); i++ {
|
||||||
artworkPrice := new(model.ArtworkPrice)
|
artworkPrice := new(model.ArtworkPrice)
|
||||||
artworkPrice.ArtworkID = in[i].ArtworkID
|
artworkPrice.ArtworkUID = in[i].ArtworkUID
|
||||||
artworkPrice.ArtworkName = in[i].ArtworkName
|
artworkPrice.ArtworkName = in[i].ArtworkName
|
||||||
artworkPrice.ArtistName = in[i].ArtistName
|
artworkPrice.ArtistName = in[i].ArtistName
|
||||||
artworkPrice.SmallPic = in[i].SmallPic
|
artworkPrice.SmallPic = in[i].SmallPic
|
||||||
artworkPrice.Ruler = in[i].Ruler
|
artworkPrice.Ruler = in[i].Ruler
|
||||||
artworkPrice.Length = in[i].Length
|
artworkPrice.Length = in[i].Length
|
||||||
artworkPrice.Width = in[i].Width
|
artworkPrice.Width = in[i].Width
|
||||||
if in[i].ID != 0 {
|
artworkPrice.ArtworkPriceUID = in[i].ArtworkPriceUID
|
||||||
artworkPrice.ID = uint(in[i].ID)
|
if showUID != "" {
|
||||||
}
|
artworkPrice.ShowUID = showUID
|
||||||
if in[i].ShowID == 0 {
|
|
||||||
artworkPrice.ShowID = showID
|
|
||||||
} else {
|
} else {
|
||||||
artworkPrice.ShowID = uint(in[i].ShowID)
|
artworkPrice.ShowUID = in[i].ShowUID
|
||||||
}
|
}
|
||||||
out[i] = artworkPrice
|
out[i] = artworkPrice
|
||||||
}
|
}
|
||||||
@ -33,9 +31,9 @@ func BuildShowArtworkRpc(in []*model.ArtworkPrice) (out []*artShow.ShowArtworkDe
|
|||||||
out = make([]*artShow.ShowArtworkDetail, len(in))
|
out = make([]*artShow.ShowArtworkDetail, len(in))
|
||||||
for i := 0; i < len(in); i++ {
|
for i := 0; i < len(in); i++ {
|
||||||
artworkPrice := new(artShow.ShowArtworkDetail)
|
artworkPrice := new(artShow.ShowArtworkDetail)
|
||||||
artworkPrice.ID = int64(in[i].ID)
|
artworkPrice.ArtworkPriceUID = in[i].ArtworkPriceUID
|
||||||
artworkPrice.ShowID = int64(in[i].ShowID)
|
artworkPrice.ShowUID = in[i].ShowUID
|
||||||
artworkPrice.ArtworkID = in[i].ArtworkID
|
artworkPrice.ArtworkUID = in[i].ArtworkUID
|
||||||
artworkPrice.ArtworkName = in[i].ArtworkName
|
artworkPrice.ArtworkName = in[i].ArtworkName
|
||||||
artworkPrice.ArtistName = in[i].ArtistName
|
artworkPrice.ArtistName = in[i].ArtistName
|
||||||
artworkPrice.SmallPic = in[i].SmallPic
|
artworkPrice.SmallPic = in[i].SmallPic
|
||||||
@ -59,18 +57,18 @@ func BuildArtworkPriceRes(artworkPrice *model.ArtworkPrice) (out *artShow.Artwor
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildArtworkPriceIDs(in []*model.ArtworkPrice) (out []uint) {
|
func BuildArtworkPriceIDs(in []*model.ArtworkPrice) (out []string) {
|
||||||
out = make([]uint, len(in))
|
out = make([]string, len(in))
|
||||||
for i := 0; i < len(in); i++ {
|
for i := 0; i < len(in); i++ {
|
||||||
out[i] = in[i].ID
|
out[i] = in[i].ArtworkPriceUID
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildArtworkIDs(in []*model.ArtworkPrice) (out []int64) {
|
func BuildArtworkIDs(in []*model.ArtworkPrice) (out []string) {
|
||||||
out = make([]int64, len(in))
|
out = make([]string, len(in))
|
||||||
for i := 0; i < len(in); i++ {
|
for i := 0; i < len(in); i++ {
|
||||||
out[i] = in[i].ArtworkID
|
out[i] = in[i].ArtworkUID
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,21 +3,14 @@ package serializer
|
|||||||
import (
|
import (
|
||||||
"fonchain-artshow/cmd/model"
|
"fonchain-artshow/cmd/model"
|
||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
"fonchain-artshow/pkg/m"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildShowApply(in *artShow.SaveApplyReq) (out *model.ShowApply) {
|
func BuildShowApply(in *artShow.SaveApplyReq) (out *model.ShowApply) {
|
||||||
out = new(model.ShowApply)
|
out = new(model.ShowApply)
|
||||||
if in.ID == 0 {
|
out.ApplyUID = in.ApplyUID
|
||||||
out.ApplySeq = strings.Join([]string{m.ARTSHOWAPPLY_PREFIX, time.Now().Format("20060102150405")}, "")
|
out.Status = int(in.Status)
|
||||||
out.Status = m.SHOWAPPLY_ADD
|
|
||||||
} else {
|
|
||||||
out.ID = uint(in.ID)
|
|
||||||
}
|
|
||||||
out.Applicant = in.Applicant
|
out.Applicant = in.Applicant
|
||||||
out.ApplicantID = uint(in.ApplicantID)
|
out.ApplicantID = in.ApplicantID
|
||||||
out.Num = in.Num
|
out.Num = in.Num
|
||||||
out.ApplyTime = in.ApplyTime
|
out.ApplyTime = in.ApplyTime
|
||||||
out.Remark = in.Remark
|
out.Remark = in.Remark
|
||||||
@ -28,10 +21,10 @@ func BuildShowApply(in *artShow.SaveApplyReq) (out *model.ShowApply) {
|
|||||||
func BuildShowApplyRes(in *model.ShowApply) (out *artShow.ApplyDetail) {
|
func BuildShowApplyRes(in *model.ShowApply) (out *artShow.ApplyDetail) {
|
||||||
out = new(artShow.ApplyDetail)
|
out = new(artShow.ApplyDetail)
|
||||||
|
|
||||||
out.ID = int64(in.ID)
|
out.ApplyUID = in.ApplyUID
|
||||||
out.ApplySeq = in.ApplySeq
|
out.ApplySeq = in.ApplySeq
|
||||||
out.Applicant = in.Applicant
|
out.Applicant = in.Applicant
|
||||||
out.ApplicantID = int64(in.ApplicantID)
|
out.ApplicantID = in.ApplicantID
|
||||||
out.Num = in.Num
|
out.Num = in.Num
|
||||||
out.ApplyTime = in.ApplyTime
|
out.ApplyTime = in.ApplyTime
|
||||||
out.Status = int32(in.Status)
|
out.Status = int32(in.Status)
|
||||||
|
@ -5,16 +5,16 @@ import (
|
|||||||
"fonchain-artshow/pb/artShow"
|
"fonchain-artshow/pb/artShow"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildShowRelM(in []*artShow.ShowRel, applyID uint) (out []*model.ShowRel) {
|
func BuildShowRelM(in []*artShow.ShowRel, applyUID string) (out []*model.ShowRel) {
|
||||||
for i := 0; i < len(in); i++ {
|
for i := 0; i < len(in); i++ {
|
||||||
showRel := &model.ShowRel{
|
showRel := &model.ShowRel{
|
||||||
ShowID: uint(in[i].ShowID),
|
ShowUID: in[i].ShowUID,
|
||||||
ApplyID: applyID,
|
ApplyUID: applyUID,
|
||||||
Index: in[i].Index,
|
Index: in[i].Index,
|
||||||
Address: in[i].Address,
|
Address: in[i].Address,
|
||||||
}
|
}
|
||||||
if in[i].ID != 0 {
|
if in[i].ShowRelUID != "" {
|
||||||
showRel.ID = uint(in[i].ID)
|
showRel.ShowRelUID = in[i].ShowRelUID
|
||||||
}
|
}
|
||||||
out = append(out, showRel)
|
out = append(out, showRel)
|
||||||
}
|
}
|
||||||
@ -24,9 +24,9 @@ func BuildShowRelM(in []*artShow.ShowRel, applyID uint) (out []*model.ShowRel) {
|
|||||||
func BuildShowRelRes(in []*model.ShowRel) (out []*artShow.ShowRel) {
|
func BuildShowRelRes(in []*model.ShowRel) (out []*artShow.ShowRel) {
|
||||||
for i := 0; i < len(in); i++ {
|
for i := 0; i < len(in); i++ {
|
||||||
showRel := &artShow.ShowRel{
|
showRel := &artShow.ShowRel{
|
||||||
ID: int64(in[i].ID),
|
ShowRelUID: in[i].ShowRelUID,
|
||||||
ApplyID: int64(in[i].ApplyID),
|
ApplyUID: in[i].ApplyUID,
|
||||||
ShowID: int64(in[i].ShowID),
|
ShowUID: in[i].ShowUID,
|
||||||
Index: in[i].Index,
|
Index: in[i].Index,
|
||||||
Address: in[i].Address,
|
Address: in[i].Address,
|
||||||
}
|
}
|
||||||
|
BIN
template/applyInfo.xlsx
Normal file
BIN
template/applyInfo.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user