提交
This commit is contained in:
parent
5d1dcf3cc7
commit
f56a5cbe97
@ -5,15 +5,15 @@ import (
|
||||
"errors"
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/cmd/service"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/m"
|
||||
)
|
||||
|
||||
type ArtShowProvider struct {
|
||||
test.UnimplementedArtShowServer
|
||||
artShow.UnimplementedArtShowServer
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) CreateShow(ctx context.Context, req *test.SaveShowReq) (res *test.SaveShowRes, err error) {
|
||||
func (p *ArtShowProvider) CreateShow(ctx context.Context, req *artShow.SaveShowReq) (res *artShow.SaveShowRes, err error) {
|
||||
if req.ShowName == "" {
|
||||
err = errors.New(m.ERROR_SHOW_NAME)
|
||||
return nil, err
|
||||
@ -22,7 +22,7 @@ func (p *ArtShowProvider) CreateShow(ctx context.Context, req *test.SaveShowReq)
|
||||
err = errors.New(m.ERROR_TIME)
|
||||
return nil, err
|
||||
}
|
||||
res = new(test.SaveShowRes)
|
||||
res = new(artShow.SaveShowRes)
|
||||
err, showID := service.CreateArtShowWithArtworkPrice(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -34,12 +34,12 @@ func (p *ArtShowProvider) CreateShow(ctx context.Context, req *test.SaveShowReq)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) UpdateShow(ctx context.Context, req *test.SaveShowReq) (res *test.SaveShowRes, err error) {
|
||||
func (p *ArtShowProvider) UpdateShow(ctx context.Context, req *artShow.SaveShowReq) (res *artShow.SaveShowRes, err error) {
|
||||
if req.ID == 0 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
}
|
||||
res = new(test.SaveShowRes)
|
||||
res = new(artShow.SaveShowRes)
|
||||
if req.IsShow == m.ARTSHOW_INSIDE {
|
||||
showRel := new(model.ShowRel)
|
||||
err, showRel = service.QueryShowRel(uint(req.ID))
|
||||
@ -63,7 +63,7 @@ func (p *ArtShowProvider) UpdateShow(ctx context.Context, req *test.SaveShowReq)
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) DelShow(ctx context.Context, req *test.DelShowReq) (res *test.CommonRes, err error) {
|
||||
func (p *ArtShowProvider) DelShow(ctx context.Context, req *artShow.DelShowReq) (res *artShow.CommonRes, err error) {
|
||||
if len(req.ShowID) < 1 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
@ -78,14 +78,17 @@ func (p *ArtShowProvider) DelShow(ctx context.Context, req *test.DelShowReq) (re
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ShowList(ctx context.Context, req *test.ShowListReq) (res *test.ShowListRes, err error) {
|
||||
func (p *ArtShowProvider) ShowList(ctx context.Context, req *artShow.ShowListReq) (res *artShow.ShowListRes, err error) {
|
||||
if req.Page == 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
if req.PageSize == 0 {
|
||||
req.Page = 10
|
||||
}
|
||||
res = new(test.ShowListRes)
|
||||
if req.IsShow == 0 {
|
||||
req.IsShow = m.ARTSHOW_INSIDE
|
||||
}
|
||||
res = new(artShow.ShowListRes)
|
||||
err, res = service.ArtShowList(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -95,7 +98,7 @@ func (p *ArtShowProvider) ShowList(ctx context.Context, req *test.ShowListReq) (
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ShowInfo(ctx context.Context, req *test.ShowDetailReq) (res *test.ShowArtworkDetailRes, err error) {
|
||||
func (p *ArtShowProvider) ShowInfo(ctx context.Context, req *artShow.ShowDetailReq) (res *artShow.ShowArtworkDetailRes, err error) {
|
||||
err, res = service.ShowInfo(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -105,8 +108,8 @@ func (p *ArtShowProvider) ShowInfo(ctx context.Context, req *test.ShowDetailReq)
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ShowStatisticalInfo(ctx context.Context, req *test.ShowStatisticalInfoReq) (res *test.ShowStatisticalInfoRes, err error) {
|
||||
res = new(test.ShowStatisticalInfoRes)
|
||||
func (p *ArtShowProvider) ShowStatisticalInfo(ctx context.Context, req *artShow.ShowStatisticalInfoReq) (res *artShow.ShowStatisticalInfoRes, err error) {
|
||||
res = new(artShow.ShowStatisticalInfoRes)
|
||||
err, num := service.ShowStatisticalInfo(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -117,12 +120,12 @@ func (p *ArtShowProvider) ShowStatisticalInfo(ctx context.Context, req *test.Sho
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ArtworkPrice(ctx context.Context, req *test.ArtworkPriceReq) (res *test.ArtworkPriceRes, err error) {
|
||||
func (p *ArtShowProvider) ArtworkPrice(ctx context.Context, req *artShow.ArtworkPriceReq) (res *artShow.ArtworkPriceRes, err error) {
|
||||
if req.ArtworkID == 0 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
}
|
||||
res = new(test.ArtworkPriceRes)
|
||||
res = new(artShow.ArtworkPriceRes)
|
||||
err, res = service.ArtworkPriceInfo(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -132,7 +135,7 @@ func (p *ArtShowProvider) ArtworkPrice(ctx context.Context, req *test.ArtworkPri
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ShowListWithApply(ctx context.Context, req *test.ShowListReq) (res *test.ShowListRes, err error) {
|
||||
func (p *ArtShowProvider) ShowListWithApply(ctx context.Context, req *artShow.ShowListReq) (res *artShow.ShowListRes, err error) {
|
||||
if req.Page == 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
@ -142,7 +145,7 @@ func (p *ArtShowProvider) ShowListWithApply(ctx context.Context, req *test.ShowL
|
||||
if req.IsShow == 0 {
|
||||
req.IsShow = 2
|
||||
}
|
||||
res = new(test.ShowListRes)
|
||||
res = new(artShow.ShowListRes)
|
||||
err, res = service.ArtShowListWithApply(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
|
@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fonchain-artshow/cmd/service"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/m"
|
||||
)
|
||||
|
||||
func (p *ArtShowProvider) CreateApply(ctx context.Context, req *test.SaveApplyReq) (res *test.SaveApplyRes, err error) {
|
||||
func (p *ArtShowProvider) CreateApply(ctx context.Context, req *artShow.SaveApplyReq) (res *artShow.SaveApplyRes, err error) {
|
||||
if req.Applicant == "" {
|
||||
err = errors.New(m.ERROR_APPLICANT)
|
||||
return
|
||||
@ -17,7 +17,7 @@ func (p *ArtShowProvider) CreateApply(ctx context.Context, req *test.SaveApplyRe
|
||||
err = errors.New(m.ERROR_TIME)
|
||||
return
|
||||
}
|
||||
res = new(test.SaveApplyRes)
|
||||
res = new(artShow.SaveApplyRes)
|
||||
err, applyID := service.CreateShowApply(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -29,12 +29,12 @@ func (p *ArtShowProvider) CreateApply(ctx context.Context, req *test.SaveApplyRe
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) UpdateApply(ctx context.Context, req *test.SaveApplyReq) (res *test.SaveApplyRes, err error) {
|
||||
func (p *ArtShowProvider) UpdateApply(ctx context.Context, req *artShow.SaveApplyReq) (res *artShow.SaveApplyRes, err error) {
|
||||
if req.ID == 0 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
}
|
||||
res = new(test.SaveApplyRes)
|
||||
res = new(artShow.SaveApplyRes)
|
||||
err, showID := service.UpdateShowApplyWithShowRel(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -46,8 +46,8 @@ func (p *ArtShowProvider) UpdateApply(ctx context.Context, req *test.SaveApplyRe
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ApplyList(ctx context.Context, req *test.ApplyListReq) (res *test.ApplyListRes, err error) {
|
||||
res = new(test.ApplyListRes)
|
||||
func (p *ArtShowProvider) ApplyList(ctx context.Context, req *artShow.ApplyListReq) (res *artShow.ApplyListRes, err error) {
|
||||
res = new(artShow.ApplyListRes)
|
||||
if req.Page == 0 {
|
||||
req.Page = 1
|
||||
}
|
||||
@ -63,12 +63,12 @@ func (p *ArtShowProvider) ApplyList(ctx context.Context, req *test.ApplyListReq)
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) ApplyDetail(ctx context.Context, req *test.ApplyShowReq) (res *test.ApplyShowRes, err error) {
|
||||
func (p *ArtShowProvider) ApplyDetail(ctx context.Context, req *artShow.ApplyShowReq) (res *artShow.ApplyShowRes, err error) {
|
||||
if req.ApplyID == 0 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
}
|
||||
res = new(test.ApplyShowRes)
|
||||
res = new(artShow.ApplyShowRes)
|
||||
err, res = service.ShowApplyDetail(uint(req.ApplyID))
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -78,12 +78,12 @@ func (p *ArtShowProvider) ApplyDetail(ctx context.Context, req *test.ApplyShowRe
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) DelApply(ctx context.Context, req *test.DelApplyReq) (res *test.CommonRes, err error) {
|
||||
func (p *ArtShowProvider) DelApply(ctx context.Context, req *artShow.DelApplyReq) (res *artShow.CommonRes, err error) {
|
||||
if len(req.ApplyID) < 1 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
}
|
||||
res = new(test.CommonRes)
|
||||
res = new(artShow.CommonRes)
|
||||
err = service.DelApplyByApplyID(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
@ -94,12 +94,12 @@ func (p *ArtShowProvider) DelApply(ctx context.Context, req *test.DelApplyReq) (
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ArtShowProvider) UpdateApplyStatus(ctx context.Context, req *test.UpdateApplyStatusReq) (res *test.CommonRes, err error) {
|
||||
func (p *ArtShowProvider) UpdateApplyStatus(ctx context.Context, req *artShow.UpdateApplyStatusReq) (res *artShow.CommonRes, err error) {
|
||||
if req.ApplyID == 0 {
|
||||
err = errors.New(m.ERROR_INVALID_ID)
|
||||
return
|
||||
}
|
||||
res = new(test.CommonRes)
|
||||
res = new(artShow.CommonRes)
|
||||
err = service.UpdateShowApplyStatus(req)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
|
@ -2,7 +2,7 @@ package dao
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/db"
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
@ -23,7 +23,7 @@ func SaveArtShow(tx *gorm.DB, artShow *model.ArtShow) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowList(in *test.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{})
|
||||
|
||||
if in.ArtistID != "" {
|
||||
@ -32,9 +32,7 @@ func ArtShowList(in *test.ShowListReq) (err error, total int64, out []*model.Art
|
||||
if in.StartTime != "" && in.EndTime != "" {
|
||||
queryDB = queryDB.Where("convert(show_time, date) between ? and ?", in.StartTime, in.EndTime)
|
||||
}
|
||||
if in.IsShow != 0 {
|
||||
queryDB = queryDB.Where("is_show = ?", in.IsShow)
|
||||
}
|
||||
queryDB = queryDB.Where("is_show = ?", in.IsShow)
|
||||
|
||||
err = queryDB.Count(&total).Error
|
||||
if err != nil {
|
||||
@ -54,7 +52,7 @@ func ArtShowList(in *test.ShowListReq) (err error, total int64, out []*model.Art
|
||||
|
||||
func ArtShowList_apply(applyID uint) (err error, out []*model.ArtShow) {
|
||||
out = make([]*model.ArtShow, 0)
|
||||
err = db.DbArtShow.Table("art_show as a ").Joins(" left 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 ").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
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShowList_apply Find err", zap.Error(err))
|
||||
return
|
||||
@ -62,7 +60,7 @@ func ArtShowList_apply(applyID uint) (err error, out []*model.ArtShow) {
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowListByApplyStatus(in *test.ShowListReq) (err error, total int64, out []*model.ArtShow) {
|
||||
func ArtShowListByApplyStatus(in *artShow.ShowListReq) (err error, total int64, out []*model.ArtShow) {
|
||||
out = make([]*model.ArtShow, 0)
|
||||
tx := db.DbArtShow.Table("art_show as a")
|
||||
|
||||
@ -82,7 +80,7 @@ func ArtShowListByApplyStatus(in *test.ShowListReq) (err error, total int64, out
|
||||
return
|
||||
}
|
||||
|
||||
func DelArtShow(in *test.DelShowReq) (err error) {
|
||||
func DelArtShow(in *artShow.DelShowReq) (err error) {
|
||||
err = db.DbArtShow.Where("id = ?", in.ShowID).Delete(&model.ArtShow{}).Error
|
||||
if err != nil {
|
||||
zap.L().Error("ArtShow delete err", zap.Error(err))
|
||||
|
@ -35,11 +35,21 @@ func ArtworkPriceList(showID uint) (err error, out []*model.ArtworkPrice) {
|
||||
return
|
||||
}
|
||||
|
||||
func QueryArtworkPrice(artworkID int64) (err error, out *model.ArtworkPrice) {
|
||||
func QueryArtworkPrice_artworkID(artworkID int64) (err error, out *model.ArtworkPrice) {
|
||||
out = new(model.ArtworkPrice)
|
||||
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("artwork_id = ? ", artworkID).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("Artwork price query err", zap.Error(err))
|
||||
zap.L().Error("Artwork price artwork_id query err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func QueryArtworkPrice_id(id uint) (err error, out *model.ArtworkPrice) {
|
||||
out = new(model.ArtworkPrice)
|
||||
err = db.DbArtShow.Model(&model.ArtworkPrice{}).Where("id = ? ", id).Find(&out).Error
|
||||
if err != nil {
|
||||
zap.L().Error("Artwork price id query err", zap.Error(err))
|
||||
return
|
||||
}
|
||||
return
|
||||
|
@ -2,8 +2,9 @@ package dao
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/db"
|
||||
"fonchain-artshow/pkg/m"
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@ -24,9 +25,13 @@ func SaveShowApply(showApply *model.ShowApply) (tx *gorm.DB, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ShowApplyList(in *test.ApplyListReq) (err error, total int64, out []*model.ShowApply) {
|
||||
func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*model.ShowApply) {
|
||||
out = make([]*model.ShowApply, 0)
|
||||
queryDB := db.DbArtShow.Model(&model.ShowApply{})
|
||||
if in.Status == 0 {
|
||||
in.Status = m.SHOWAPPLY_ADD
|
||||
}
|
||||
queryDB.Where("status = ?", in.Status)
|
||||
|
||||
err = queryDB.Count(&total).Error
|
||||
if err != nil {
|
||||
@ -55,7 +60,7 @@ func ShowApplyDetail(applyID uint) (err error, out *model.ShowApply) {
|
||||
}
|
||||
return
|
||||
}
|
||||
func DelShowApply(in *test.DelApplyReq) (tx *gorm.DB, err error) {
|
||||
func DelShowApply(in *artShow.DelApplyReq) (tx *gorm.DB, err error) {
|
||||
tx = db.DbArtShow.Begin()
|
||||
err = tx.Delete(&model.ShowApply{}, in.ApplyID).Error
|
||||
if err != nil {
|
||||
|
@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
//grpc_go "github.com/dubbogo/grpc-go"
|
||||
@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
type server struct {
|
||||
test.UnimplementedArtShowServer
|
||||
artShow.UnimplementedArtShowServer
|
||||
}
|
||||
|
||||
func main() {
|
||||
@ -25,8 +25,8 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
s := grpc.NewServer() // 创建gRPC服务器
|
||||
test.RegisterArtShowServer(s, &controller.ArtShowProvider{}) // 在gRPC服务端注册服务
|
||||
s := grpc.NewServer() // 创建gRPC服务器
|
||||
artShow.RegisterArtShowServer(s, &controller.ArtShowProvider{}) // 在gRPC服务端注册服务
|
||||
|
||||
db.Init(m.SERVER_CONFIG)
|
||||
//初始化zap
|
||||
|
@ -3,14 +3,14 @@ package service
|
||||
import (
|
||||
"fonchain-artshow/cmd/dao"
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/db"
|
||||
"fonchain-artshow/pkg/m"
|
||||
"fonchain-artshow/pkg/serializer"
|
||||
"fonchain-artshow/pkg/utils"
|
||||
)
|
||||
|
||||
func CreateArtShowWithArtworkPrice(in *test.SaveShowReq) (err error, showID uint) {
|
||||
func CreateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID uint) {
|
||||
artShowM := serializer.BuildArtShowM(in)
|
||||
|
||||
tx := db.DbArtShow.Begin()
|
||||
@ -43,12 +43,9 @@ func CreateArtShowWithArtworkPrice(in *test.SaveShowReq) (err error, showID uint
|
||||
return err, artShowM.ID
|
||||
}
|
||||
|
||||
func UpdateArtShowWithArtworkPrice(in *test.SaveShowReq) (err error, showID uint) {
|
||||
err, artShowExist := dao.QueryArtShow(uint(in.ID))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err, artworkPrices := dao.ArtworkPriceList(artShowExist.ID)
|
||||
func UpdateArtShowWithArtworkPrice(in *artShow.SaveShowReq) (err error, showID uint) {
|
||||
|
||||
err, artworkPrices := dao.ArtworkPriceList(uint(in.ID))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -60,6 +57,15 @@ func UpdateArtShowWithArtworkPrice(in *test.SaveShowReq) (err error, showID uint
|
||||
artworks = artworkPrices
|
||||
} else {
|
||||
artworks = serializer.BuildShowArtworkM(in.ShowArtwork, uint(in.ID))
|
||||
for i := 0; i < len(artworks); i++ { // 查找 已存在 artwork_price 获取 ruler 信息
|
||||
if artworks[i].Ruler == 0 {
|
||||
err, artwork := dao.QueryArtworkPrice_id(artworks[i].ID)
|
||||
if err != nil {
|
||||
return err, 0
|
||||
}
|
||||
artworks[i].Ruler = artwork.Ruler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(artworks) > 0 {
|
||||
@ -91,6 +97,7 @@ func UpdateArtShowWithArtworkPrice(in *test.SaveShowReq) (err error, showID uint
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新画展包
|
||||
err = dao.SaveArtShow(tx, artShowM)
|
||||
if err != nil {
|
||||
@ -102,7 +109,7 @@ func UpdateArtShowWithArtworkPrice(in *test.SaveShowReq) (err error, showID uint
|
||||
return err, artShowM.ID
|
||||
}
|
||||
|
||||
func DelArtShow(in *test.DelShowReq) (err error) {
|
||||
func DelArtShow(in *artShow.DelShowReq) (err error) {
|
||||
err = dao.DelArtShow(in)
|
||||
if err != nil {
|
||||
return
|
||||
@ -111,8 +118,8 @@ func DelArtShow(in *test.DelShowReq) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowList(in *test.ShowListReq) (err error, out *test.ShowListRes) {
|
||||
out = new(test.ShowListRes)
|
||||
func ArtShowList(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes) {
|
||||
out = new(artShow.ShowListRes)
|
||||
artShows := make([]*model.ArtShow, 0)
|
||||
err, out.Total, artShows = dao.ArtShowList(in)
|
||||
if err != nil {
|
||||
@ -126,8 +133,8 @@ func ArtShowList(in *test.ShowListReq) (err error, out *test.ShowListRes) {
|
||||
return
|
||||
}
|
||||
|
||||
func ShowInfo(in *test.ShowDetailReq) (err error, out *test.ShowArtworkDetailRes) {
|
||||
out = new(test.ShowArtworkDetailRes)
|
||||
func ShowInfo(in *artShow.ShowDetailReq) (err error, out *artShow.ShowArtworkDetailRes) {
|
||||
out = new(artShow.ShowArtworkDetailRes)
|
||||
artworkPriceS := make([]*model.ArtworkPrice, 0)
|
||||
err, artworkPriceS = dao.ArtworkPriceList(uint(in.ShowID))
|
||||
if err != nil {
|
||||
@ -137,8 +144,8 @@ func ShowInfo(in *test.ShowDetailReq) (err error, out *test.ShowArtworkDetailRes
|
||||
return
|
||||
}
|
||||
|
||||
func ArtShowListWithApply(in *test.ShowListReq) (err error, out *test.ShowListRes) {
|
||||
out = new(test.ShowListRes)
|
||||
func ArtShowListWithApply(in *artShow.ShowListReq) (err error, out *artShow.ShowListRes) {
|
||||
out = new(artShow.ShowListRes)
|
||||
artShows := make([]*model.ArtShow, 0)
|
||||
err, out.Total, artShows = dao.ArtShowListByApplyStatus(in)
|
||||
err, out.TotalArtistNum, out.TotalPackageNum = dao.ShowStatistical(m.ARTSHOW_PASS)
|
||||
@ -149,8 +156,8 @@ func ArtShowListWithApply(in *test.ShowListReq) (err error, out *test.ShowListRe
|
||||
return
|
||||
}
|
||||
|
||||
func ShowStatisticalInfo(in *test.ShowStatisticalInfoReq) (err error, out *test.ShowStatisticalInfoRes_Num) {
|
||||
out = new(test.ShowStatisticalInfoRes_Num)
|
||||
func ShowStatisticalInfo(in *artShow.ShowStatisticalInfoReq) (err error, out *artShow.ShowStatisticalInfoRes_Num) {
|
||||
out = new(artShow.ShowStatisticalInfoRes_Num)
|
||||
err, out.ArtistNum, out.PackageNum = dao.ShowStatistical(in.IsShow)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -3,13 +3,13 @@ package service
|
||||
import (
|
||||
"fonchain-artshow/cmd/dao"
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/serializer"
|
||||
"fonchain-artshow/pkg/utils"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func CreateShowApply(in *test.SaveApplyReq) (err error, applyID uint) {
|
||||
func CreateShowApply(in *artShow.SaveApplyReq) (err error, applyID uint) {
|
||||
showApply := serializer.BuildShowApply(in)
|
||||
|
||||
tx, err := dao.SaveShowApply(showApply)
|
||||
@ -30,7 +30,7 @@ func CreateShowApply(in *test.SaveApplyReq) (err error, applyID uint) {
|
||||
return err, showApply.ID
|
||||
}
|
||||
|
||||
func UpdateShowApplyWithShowRel(in *test.SaveApplyReq) (err error, applyID uint) {
|
||||
func UpdateShowApplyWithShowRel(in *artShow.SaveApplyReq) (err error, applyID uint) {
|
||||
|
||||
// 更新画展包申请
|
||||
showApply := serializer.BuildShowApply(in)
|
||||
@ -66,7 +66,7 @@ func UpdateShowApplyWithShowRel(in *test.SaveApplyReq) (err error, applyID uint)
|
||||
return err, showApply.ID
|
||||
}
|
||||
|
||||
func UpdateShowApplyStatus(in *test.UpdateApplyStatusReq) (err error) {
|
||||
func UpdateShowApplyStatus(in *artShow.UpdateApplyStatusReq) (err error) {
|
||||
|
||||
// 更新画展包申请 状态
|
||||
showApply := &model.ShowApply{
|
||||
@ -83,8 +83,8 @@ func UpdateShowApplyStatus(in *test.UpdateApplyStatusReq) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ShowApplyList(in *test.ApplyListReq) (err error, total int64, out []*test.ApplyDetail) {
|
||||
out = make([]*test.ApplyDetail, 0)
|
||||
func ShowApplyList(in *artShow.ApplyListReq) (err error, total int64, out []*artShow.ApplyDetail) {
|
||||
out = make([]*artShow.ApplyDetail, 0)
|
||||
err, total, applyList := dao.ShowApplyList(in)
|
||||
if err != nil {
|
||||
return
|
||||
@ -98,8 +98,8 @@ func ShowApplyList(in *test.ApplyListReq) (err error, total int64, out []*test.A
|
||||
return
|
||||
}
|
||||
|
||||
func ShowApplyDetail(applyID uint) (err error, out *test.ApplyShowRes) {
|
||||
out = new(test.ApplyShowRes)
|
||||
func ShowApplyDetail(applyID uint) (err error, out *artShow.ApplyShowRes) {
|
||||
out = new(artShow.ApplyShowRes)
|
||||
|
||||
err, showApply := dao.ShowApplyDetail(applyID)
|
||||
if err != nil {
|
||||
@ -115,7 +115,7 @@ func ShowApplyDetail(applyID uint) (err error, out *test.ApplyShowRes) {
|
||||
return
|
||||
}
|
||||
|
||||
func DelApplyByApplyID(in *test.DelApplyReq) (err error) {
|
||||
func DelApplyByApplyID(in *artShow.DelApplyReq) (err error) {
|
||||
tx, err := dao.DelShowApply(in)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
|
@ -2,12 +2,12 @@ package service
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/dao"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/serializer"
|
||||
)
|
||||
|
||||
func ArtworkPriceInfo(in *test.ArtworkPriceReq) (err error, artworkPriceRes *test.ArtworkPriceRes) {
|
||||
err, artworkPrice := dao.QueryArtworkPrice(in.ArtworkID)
|
||||
func ArtworkPriceInfo(in *artShow.ArtworkPriceReq) (err error, artworkPriceRes *artShow.ArtworkPriceRes) {
|
||||
err, artworkPrice := dao.QueryArtworkPrice_artworkID(in.ArtworkID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
1
go.mod
1
go.mod
@ -96,6 +96,7 @@ require (
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mschoch/smat v0.2.0 // indirect
|
||||
github.com/mwitkow/go-proto-validators v0.3.2 // indirect
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.1 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/pelletier/go-toml v1.7.0 // indirect
|
||||
|
23
go.sum
23
go.sum
@ -118,6 +118,7 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/artShow v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
@ -214,7 +215,8 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTg
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
|
||||
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
||||
github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE=
|
||||
github.com/frankban/quickartShow v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE=
|
||||
github.com/frankban/quickartShow v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
|
||||
github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
@ -227,6 +229,8 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
|
||||
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
|
||||
github.com/go-artShow/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/go-artShow/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0=
|
||||
github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k=
|
||||
@ -278,6 +282,7 @@ github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFG
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
@ -461,7 +466,8 @@ github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||
github.com/jmespath/go-jmespath/internal/artShowify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||
github.com/jmespath/go-jmespath/internal/artShowify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
|
||||
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
@ -542,6 +548,8 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT
|
||||
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
|
||||
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
|
||||
github.com/mitchellh/go-artShowing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/go-artShowing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
@ -571,6 +579,8 @@ github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
|
||||
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos=
|
||||
github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w=
|
||||
github.com/nacos-group/nacos-sdk-go v1.0.8/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA=
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.1 h1:beczWcOoTaVBMgCgikqvZflrN5Xbw7pWAWpxl+VJGIA=
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.1/go.mod h1:UHOtQNQY/qpk2dhg6gDq8u5+/CEIc3+lWmrmxEzX0/g=
|
||||
@ -733,6 +743,14 @@ github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q
|
||||
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
|
||||
github.com/stretchr/artShowify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/artShowify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/artShowify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/artShowify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/artShowify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/artShowify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/artShowify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
|
||||
github.com/stretchr/artShowify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
@ -841,6 +859,7 @@ go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||
go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
|
||||
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
|
||||
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
|
||||
goartShow.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: pb/artist/artshow.proto
|
||||
// source: pb/artshow.proto
|
||||
|
||||
package artShow
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.21.1
|
||||
// source: pb/artist/artshow.proto
|
||||
// - protoc v3.21.4
|
||||
// source: pb/artshow.proto
|
||||
|
||||
package artShow
|
||||
|
||||
@ -728,5 +728,5 @@ var ArtShow_ServiceDesc = grpc_go.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/artist/artshow.proto",
|
||||
Metadata: "pb/artshow.proto",
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ message SaveApplyRes {
|
||||
message ApplyListReq {
|
||||
int32 Page = 1 [json_name = "page"];
|
||||
int32 PageSize = 2 [json_name = "page_size"];
|
||||
int32 Status = 3 [json_name = "status"];
|
||||
}
|
||||
|
||||
message ApplyListRes {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -43,14 +43,14 @@ func InitLogger() {
|
||||
SugarLogger = logger.Sugar()
|
||||
}
|
||||
|
||||
func getEncoderTest() zapcore.Encoder {
|
||||
func getEncoderartShow() zapcore.Encoder {
|
||||
encoderConfig := zap.NewProductionEncoderConfig()
|
||||
encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
|
||||
encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder
|
||||
return zapcore.NewConsoleEncoder(encoderConfig)
|
||||
}
|
||||
|
||||
func getLogWriterTest(filePath string) zapcore.WriteSyncer {
|
||||
func getLogWriterartShow(filePath string) zapcore.WriteSyncer {
|
||||
warnIoWriter := getWriter(filePath)
|
||||
return zapcore.AddSync(warnIoWriter)
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ package serializer
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/m"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func BuildArtShowM(in *test.SaveShowReq) (out *model.ArtShow) {
|
||||
func BuildArtShowM(in *artShow.SaveShowReq) (out *model.ArtShow) {
|
||||
out = new(model.ArtShow)
|
||||
if in.ID == 0 {
|
||||
out.ShowSeq = strings.Join([]string{m.ARTSHOW_PREFIX, time.Now().Format("20060102150405")}, "")
|
||||
@ -23,13 +23,17 @@ func BuildArtShowM(in *test.SaveShowReq) (out *model.ArtShow) {
|
||||
out.Ruler = in.Ruler
|
||||
out.Reward = in.Reward
|
||||
out.ShowTime = in.ShowTime
|
||||
out.IsShow = int8(in.IsShow)
|
||||
if in.IsShow == 0 {
|
||||
out.IsShow = m.ARTSHOW_INSIDE
|
||||
} else {
|
||||
out.IsShow = int8(in.IsShow)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func BuildArtShowListRes(artShows []*model.ArtShow) (out []*test.ShowDetail) {
|
||||
out = make([]*test.ShowDetail, 0)
|
||||
func BuildArtShowListRes(artShows []*model.ArtShow) (out []*artShow.ShowDetail) {
|
||||
out = make([]*artShow.ShowDetail, 0)
|
||||
for i := 0; i < len(artShows); i++ {
|
||||
artShowM := BuildArtShowRpc(artShows[i])
|
||||
out = append(out, artShowM)
|
||||
@ -37,8 +41,8 @@ func BuildArtShowListRes(artShows []*model.ArtShow) (out []*test.ShowDetail) {
|
||||
return
|
||||
}
|
||||
|
||||
func BuildArtShowRpc(artShowM *model.ArtShow) (out *test.ShowDetail) {
|
||||
out = new(test.ShowDetail)
|
||||
func BuildArtShowRpc(artShowM *model.ArtShow) (out *artShow.ShowDetail) {
|
||||
out = new(artShow.ShowDetail)
|
||||
out.ID = int64(artShowM.ID)
|
||||
out.ShowSeq = artShowM.ShowSeq
|
||||
out.ShowName = artShowM.ShowName
|
||||
|
@ -2,10 +2,10 @@ package serializer
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
)
|
||||
|
||||
func BuildShowArtworkM(in []*test.ShowArtworkDetail, showID uint) (out []*model.ArtworkPrice) {
|
||||
func BuildShowArtworkM(in []*artShow.ShowArtworkDetail, showID uint) (out []*model.ArtworkPrice) {
|
||||
out = make([]*model.ArtworkPrice, len(in))
|
||||
for i := 0; i < len(in); i++ {
|
||||
artworkPrice := new(model.ArtworkPrice)
|
||||
@ -27,10 +27,10 @@ func BuildShowArtworkM(in []*test.ShowArtworkDetail, showID uint) (out []*model.
|
||||
return
|
||||
}
|
||||
|
||||
func BuildShowArtworkRpc(in []*model.ArtworkPrice) (out []*test.ShowArtworkDetail) {
|
||||
out = make([]*test.ShowArtworkDetail, len(in))
|
||||
func BuildShowArtworkRpc(in []*model.ArtworkPrice) (out []*artShow.ShowArtworkDetail) {
|
||||
out = make([]*artShow.ShowArtworkDetail, len(in))
|
||||
for i := 0; i < len(in); i++ {
|
||||
artworkPrice := new(test.ShowArtworkDetail)
|
||||
artworkPrice := new(artShow.ShowArtworkDetail)
|
||||
artworkPrice.ShowID = int64(in[i].ShowID)
|
||||
artworkPrice.ArtworkID = in[i].ArtworkID
|
||||
artworkPrice.ArtworkName = in[i].ArtworkName
|
||||
@ -43,9 +43,9 @@ func BuildShowArtworkRpc(in []*model.ArtworkPrice) (out []*test.ShowArtworkDetai
|
||||
return
|
||||
}
|
||||
|
||||
func BuildArtworkPriceRes(artworkPrice *model.ArtworkPrice) (out *test.ArtworkPriceRes) {
|
||||
out = new(test.ArtworkPriceRes)
|
||||
out.Data = new(test.ArtworkPriceRes_PriceInfo)
|
||||
func BuildArtworkPriceRes(artworkPrice *model.ArtworkPrice) (out *artShow.ArtworkPriceRes) {
|
||||
out = new(artShow.ArtworkPriceRes)
|
||||
out.Data = new(artShow.ArtworkPriceRes_PriceInfo)
|
||||
out.Data.Price = artworkPrice.Price
|
||||
out.Data.RulerPrice = artworkPrice.RulerPrice
|
||||
out.Data.ArtworkPrice = artworkPrice.ArtworkPrice
|
||||
|
@ -2,13 +2,13 @@ package serializer
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
"fonchain-artshow/pkg/m"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func BuildShowApply(in *test.SaveApplyReq) (out *model.ShowApply) {
|
||||
func BuildShowApply(in *artShow.SaveApplyReq) (out *model.ShowApply) {
|
||||
out = new(model.ShowApply)
|
||||
if in.ID == 0 {
|
||||
out.ApplySeq = strings.Join([]string{m.ARTSHOWAPPLY_PREFIX, time.Now().Format("20060102150405")}, "")
|
||||
@ -25,8 +25,8 @@ func BuildShowApply(in *test.SaveApplyReq) (out *model.ShowApply) {
|
||||
return
|
||||
}
|
||||
|
||||
func BuildShowApplyRes(in *model.ShowApply) (out *test.ApplyDetail) {
|
||||
out = new(test.ApplyDetail)
|
||||
func BuildShowApplyRes(in *model.ShowApply) (out *artShow.ApplyDetail) {
|
||||
out = new(artShow.ApplyDetail)
|
||||
|
||||
out.ID = int64(in.ID)
|
||||
out.ApplySeq = in.ApplySeq
|
||||
|
@ -2,10 +2,10 @@ package serializer
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pb/test"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
)
|
||||
|
||||
func BuildShowRelM(in []*test.ShowRel, applyID uint) (out []*model.ShowRel) {
|
||||
func BuildShowRelM(in []*artShow.ShowRel, applyID uint) (out []*model.ShowRel) {
|
||||
for i := 0; i < len(in); i++ {
|
||||
showRel := &model.ShowRel{
|
||||
ShowID: uint(in[i].ShowID),
|
||||
@ -21,9 +21,9 @@ func BuildShowRelM(in []*test.ShowRel, applyID uint) (out []*model.ShowRel) {
|
||||
return
|
||||
}
|
||||
|
||||
func BuildShowRelRes(in []*model.ShowRel) (out []*test.ShowRel) {
|
||||
func BuildShowRelRes(in []*model.ShowRel) (out []*artShow.ShowRel) {
|
||||
for i := 0; i < len(in); i++ {
|
||||
showRel := &test.ShowRel{
|
||||
showRel := &artShow.ShowRel{
|
||||
ID: int64(in[i].ID),
|
||||
ApplyID: int64(in[i].ApplyID),
|
||||
ShowID: int64(in[i].ShowID),
|
||||
|
Loading…
Reference in New Issue
Block a user