package artartwork import ( "fmt" "github.com/fonchain_enterprise/fonchain-main/api/artartwork" "github.com/fonchain_enterprise/fonchain-main/api/artist" "github.com/fonchain_enterprise/fonchain-main/pkg/e" "github.com/fonchain_enterprise/fonchain-main/pkg/model/entity" "github.com/fonchain_enterprise/fonchain-main/pkg/service" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" ) func ArtArtworkList(c *gin.Context) { var req entity.ArtArtworkListRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } var artReq artartwork.GetMgmtArtworkListRequest artReq.ArtistId = req.ArtistId artReq.ArtistName = req.ArtistName artReq.Name = req.Name artReq.ArtistName = req.ArtistName artReq.IsImport = req.IsImport artReq.State = req.State artReq.Page = req.Page artReq.PageSize = req.PageSize res, err := service.ArtArtworkImpl.GetMgmtArtworkList(c, &artReq) if err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } service.Success(c, res) } func ApproveArtwork(c *gin.Context) { var req entity.ApprovertworkRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } var artReq artartwork.ApproveArtworkRequest artReq.ArtworkId = req.ArtworkId artReq.IsApprove = req.IsApprove artReq.Remark = req.Remark artReq.Remark2 = req.Remark2 res, err := service.ArtArtworkImpl.ApproveArtwork(c, &artReq) if err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } service.Success(c, res) } func ArtistList(c *gin.Context) { var req entity.ArtistListRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } var artReq artist.ArtistListRequest artReq.Keyword = req.Keyword artReq.Page = req.Page artReq.PageSize = req.PageSize artistRes, err := service.GrpcArtistImpl.ArtistList(c, &artReq) if err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } var res entity.ArtistListResponse res.Count = uint64(artistRes.Count) for _, v := range artistRes.Data { var tmp entity.ArtistListResponseData var artistReq artist.DetailRequest artistReq.Uid = v.Uid artistTmp, err := service.GrpcArtistImpl.ArtistDetail(c, &artistReq) if err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } tmp.ID = v.Uid // tmp.Account = v.Account // tmp.PassRulerCount = v.PassRulerCount // tmp.MnemonicWords = v.MnemonicWords tmp.TelNum = v.Phone // tmp.PassArtworkCount = v.PassArtworkCount tmp.Name = v.Name tmp.PenName = v.PenName tmp.Certificate = artistTmp.ProfileInfo.CaaCertNum tmp.CertificateImg = artistTmp.MediaInfo.CaaImg // tmp.Key = v.Key tmp.Sex = uint64(v.Gender) tmp.Age = uint64(v.Age) // tmp.Introduct = artistTmp.MediaI // tmp.CreateTime = artistTmp.MediaInfo. tmp.JoinAssoTime = artistTmp.ProfileInfo.CaaJoinTime tmp.StageName = v.StageName // tmp.UpdateTime = v.UpdateTime tmp.ConAddress = v.Address tmp.Photo = artistTmp.MediaInfo.RecentPhotoOne tmp.Video = artistTmp.MediaInfo.RecentPhotoTwo // tmp.InvitedName = v.InvitedName // tmp.Enable = v.Enable tmp.IdCard = v.CardId // tmp.IsImport = v.IsImport // tmp.IsLock = v.IsLock tmp.IdCardFront = artistTmp.MediaInfo.CardFace tmp.IdCardBack = artistTmp.MediaInfo.CardNational tmp.BankName = v.BankName tmp.BankAccount = v.BankNum // tmp.MinTime = v.MinTime // tmp.LockTime = v.LockTime // tmp.ArtworkCount = v.ArtworkCount // tmp.RulerCount = v.RulerCount res.Data = append(res.Data, tmp) } service.Success(c, res) } func ArtistArtworkList(c *gin.Context) { var req entity.ArtistListRequest if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } var artReq artist.ArtistListRequest artReq.Keyword = req.Keyword artReq.Page = req.Page artReq.PageSize = req.PageSize artistRes, err := service.GrpcArtistImpl.ArtistList(c, &artReq) if err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } var res entity.ArtistListResponse res.Count = uint64(artistRes.Count) for _, v := range artistRes.Data { var tmp entity.ArtistListResponseData var artistReq artist.DetailRequest artistReq.Uid = v.Uid artistTmp, err := service.GrpcArtistImpl.ArtistDetail(c, &artistReq) if err != nil { fmt.Println(err) service.Error(c, e.Error, err) return } tmp.ID = v.Uid // tmp.Account = v.Account // tmp.PassRulerCount = v.PassRulerCount // tmp.MnemonicWords = v.MnemonicWords tmp.TelNum = v.Phone // tmp.PassArtworkCount = v.PassArtworkCount tmp.Name = v.Name tmp.PenName = v.PenName tmp.Certificate = artistTmp.ProfileInfo.CaaCertNum tmp.CertificateImg = artistTmp.MediaInfo.CaaImg // tmp.Key = v.Key tmp.Sex = uint64(v.Gender) tmp.Age = uint64(v.Age) // tmp.Introduct = artistTmp.MediaI // tmp.CreateTime = artistTmp.MediaInfo. tmp.JoinAssoTime = artistTmp.ProfileInfo.CaaJoinTime tmp.StageName = v.StageName // tmp.UpdateTime = v.UpdateTime tmp.ConAddress = v.Address tmp.Photo = artistTmp.MediaInfo.RecentPhotoOne tmp.Video = artistTmp.MediaInfo.RecentPhotoTwo // tmp.InvitedName = v.InvitedName // tmp.Enable = v.Enable tmp.IdCard = v.CardId // tmp.IsImport = v.IsImport // tmp.IsLock = v.IsLock tmp.IdCardFront = artistTmp.MediaInfo.CardFace tmp.IdCardBack = artistTmp.MediaInfo.CardNational tmp.BankName = v.BankName tmp.BankAccount = v.BankNum // tmp.MinTime = v.MinTime // tmp.LockTime = v.LockTime // tmp.ArtworkCount = v.ArtworkCount // tmp.RulerCount = v.RulerCount res.Data = append(res.Data, tmp) } service.Success(c, res) } func ArtistArtworkSupplyList(c *gin.Context) { } func ArtArtworkInfo(c *gin.Context) { var res string service.Success(c, res) } func ArtMgmtArtistInfo(c *gin.Context) { var res string service.Success(c, res) } func ImportArtistInfoList(c *gin.Context) { var res string service.Success(c, res) } func ArtMgmtArtistLock(c *gin.Context) { var res string service.Success(c, res) } func ContractList(c *gin.Context) { var res string service.Success(c, res) } func CreateContract(c *gin.Context) { var res string service.Success(c, res) } func InvitedList(c *gin.Context) { var res string service.Success(c, res) } func AgentInvitedList(c *gin.Context) { var res string service.Success(c, res) } func AgentInvitedListByPhone(c *gin.Context) { var res string service.Success(c, res) } func AgentList(c *gin.Context) { var res string service.Success(c, res) } func RemarkList(c *gin.Context) { var res = entity.RemarkText service.Success(c, res) } func ImportArtworkList(c *gin.Context) { var res string service.Success(c, res) } func ImportArtworkByBatchId(c *gin.Context) { var res string service.Success(c, res) } func ImportArtworkNewBatch(c *gin.Context) { var res string service.Success(c, res) } func ImportArtworkInfoList(c *gin.Context) { var res string service.Success(c, res) } func AddArtworkStateByBatch(c *gin.Context) { var res string service.Success(c, res) } func GetPic(c *gin.Context) { var res string service.Success(c, res) }