From 4d45a4c4ccd5ae19be7187cc441a5e02ae35888d Mon Sep 17 00:00:00 2001 From: songchuang <192749120@qq.com> Date: Fri, 3 Mar 2023 16:18:00 +0800 Subject: [PATCH] =?UTF-8?q?songchuang=20=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/controller/artistInfo_user.go | 1 + cmd/internal/controller/contract.go | 82 ++- cmd/internal/dao/contract.go | 406 ++++++----- cmd/internal/logic/contract.go | 178 ++++- cmd/model/contract.go | 29 +- go.mod | 2 +- pb/contract/contract.pb.go | 772 ++++++++++++--------- pb/contract/contract.proto | 10 + pb/contract/contract.validator.pb.go | 79 +++ pb/contract/contract_triple.pb.go | 53 +- pb/old/artwork/artwork.proto | 2 +- 11 files changed, 1056 insertions(+), 558 deletions(-) create mode 100644 pb/contract/contract.validator.pb.go diff --git a/cmd/internal/controller/artistInfo_user.go b/cmd/internal/controller/artistInfo_user.go index 39bf15c..eb8aa33 100644 --- a/cmd/internal/controller/artistInfo_user.go +++ b/cmd/internal/controller/artistInfo_user.go @@ -3,6 +3,7 @@ package controller import ( "context" "fmt" + "github.com/fonchain/fonchain-artistinfo/cmd/model" "github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser" db "github.com/fonchain/fonchain-artistinfo/pkg/db" diff --git a/cmd/internal/controller/contract.go b/cmd/internal/controller/contract.go index 1e330f5..d487040 100644 --- a/cmd/internal/controller/contract.go +++ b/cmd/internal/controller/contract.go @@ -13,47 +13,55 @@ type ContractProvider struct { contractLogic *logic.Contract } -func (c *ContractProvider) FinishContract(ctx context.Context, req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) { +func (c *ContractProvider) CreateContract(ctx context.Context, req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) { fmt.Println("第一处") - if rep, err = c.contractLogic.FinishContract(req); err != nil { + if rep, err = c.contractLogic.CreateContract(req); err != nil { return nil, err } return rep, nil } -func (c *ContractProvider) ContractList(ctx context.Context, req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) { - fmt.Println("第一处") - if rep, err = c.contractLogic.ContractList(req); err != nil { - return nil, err - } - return rep, nil -} -func (c *ContractProvider) GetContract(ctx context.Context, req *contract.GetContractRequest) (rep *contract.ContractData, err error) { - fmt.Println("第一处") - if rep, err = c.contractLogic.GetContract(req); err != nil { - return nil, err - } - return rep, nil -} -func (c *ContractProvider) ContractTxList(ctx context.Context, req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) { - fmt.Println("第一处") - if rep, err = c.contractLogic.ContractTxList(req); err != nil { - return nil, err - } - return rep, nil -} +// func (c *ContractProvider) FinishContract(ctx context.Context, req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) { +// fmt.Println("第一处") +// if rep, err = c.contractLogic.FinishContract(req); err != nil { +// return nil, err +// } +// return rep, nil +// } -func (c *ContractProvider) UpdateContract(ctx context.Context, req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) { - fmt.Println("第一处") - if rep, err = c.contractLogic.UpdateContract(req); err != nil { - return nil, err - } - return rep, nil -} -func (c *ContractProvider) UpdateContractTx(ctx context.Context, req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) { - fmt.Println("第一处") - if rep, err = c.contractLogic.UpdateContractTx(req); err != nil { - return nil, err - } - return rep, nil -} +// func (c *ContractProvider) ContractList(ctx context.Context, req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) { +// fmt.Println("第一处") +// if rep, err = c.contractLogic.ContractList(req); err != nil { +// return nil, err +// } +// return rep, nil +// } +// func (c *ContractProvider) GetContract(ctx context.Context, req *contract.GetContractRequest) (rep *contract.ContractData, err error) { +// fmt.Println("第一处") +// if rep, err = c.contractLogic.GetContract(req); err != nil { +// return nil, err +// } +// return rep, nil +// } +// func (c *ContractProvider) ContractTxList(ctx context.Context, req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) { +// fmt.Println("第一处") +// if rep, err = c.contractLogic.ContractTxList(req); err != nil { +// return nil, err +// } +// return rep, nil +// } + +// func (c *ContractProvider) UpdateContract(ctx context.Context, req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) { +// fmt.Println("第一处") +// if rep, err = c.contractLogic.UpdateContract(req); err != nil { +// return nil, err +// } +// return rep, nil +// } +// func (c *ContractProvider) UpdateContractTx(ctx context.Context, req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) { +// fmt.Println("第一处") +// if rep, err = c.contractLogic.UpdateContractTx(req); err != nil { +// return nil, err +// } +// return rep, nil +// } diff --git a/cmd/internal/dao/contract.go b/cmd/internal/dao/contract.go index ceebb12..6b21a50 100644 --- a/cmd/internal/dao/contract.go +++ b/cmd/internal/dao/contract.go @@ -2,195 +2,275 @@ package dao import ( "errors" - "time" "github.com/fonchain/fonchain-artistinfo/cmd/model" - "github.com/fonchain/fonchain-artistinfo/pb/contract" db "github.com/fonchain/fonchain-artistinfo/pkg/db" "github.com/fonchain/fonchain-artistinfo/pkg/m" + uuid "github.com/satori/go.uuid" "go.uber.org/zap" + "gorm.io/gorm" ) -func FinishContract(id string) (err error) { - var contracts model.Contract - if err = db.DB.Where("transaction_id = ?", id).First(&contracts).Error; err != nil { +func GetMgmtContractByArtistUid(artistUid string, contractType int32) (err error) { + var contract model.Contract + if err = db.DB.Where("artist_uid = ? AND type = ?", artistUid, contractType).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound { zap.L().Error("get contract info err", zap.Error(err)) err = errors.New(m.ERROR_SELECT) return } - if err = db.DB.Model(&contracts).Update("state", 3).Error; err != nil { - zap.L().Error("user contract failed", zap.Error(err)) - err = errors.New(m.UPDATE_FAILED) - return - } - return } -func ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) { - rep = &contract.ContractListRespond{} - var Data []*contract.ContractData - - var user model.User - if err = db.DB.Where("id = ? ", int32(req.ID)).First(&user).Error; err != nil { - zap.L().Error("get user info err", zap.Error(err)) - err = errors.New(m.ERROR_SELECT) +func CreateArtistContract(tx *gorm.DB, contract *model.Contract) (err error) { + if err = tx.Create(contract).Error; err != nil { + zap.L().Error("create contract err", zap.Error(err)) + err = errors.New(m.CREATE_ERROR) return } - - // todo - //var realName model.RealName - //if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil { - // zap.L().Error("get realName info err", zap.Error(err)) - // err = errors.New(m.ERROR_SELECT) - // return - //} - - var args []interface{} - var sqlWhere = "user_id = ? and type !=4 " - args = append(args, req.ID) - - if req.State != 0 { - sqlWhere += " and state = ? " - if req.State == 2 { - req.State = 3 - } - args = append(args, req.State) - } - - var contractModel []model.Contract - if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil { - zap.L().Error("get contractModels info err", zap.Error(err)) - err = errors.New(m.ERROR_SELECT) - return - } - - for _, v := range contractModel { - contract := &contract.ContractData{} - contract.ID = uint64(v.ID) - contract.ContractId = v.ContractId - contract.DownloadUrl = v.DownloadUrl - contract.MgmtUserId = v.MgmtUserId - contract.State = int64(v.State) - contract.TransactionId = v.TransactionId - contract.Type = int64(v.Type) - contract.UserId = int64(v.UserId) - contract.ViewUrl = v.ViewUrl - contract.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05") - contract.SignTime = v.UpdatedAt.Format("2006-01-02") - Data = append(Data, contract) - } - - rep.Data = Data - return } -func ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) { - rep = &contract.ContractTxListRespond{} - var Data []*contract.ContractData - - var user model.User - if err = db.DB.Where("id = ? ", int32(req.ID)).First(&user).Error; err != nil { - zap.L().Error("get user info err", zap.Error(err)) - err = errors.New(m.ERROR_SELECT) - return - } - // todo - //var realName model.RealName - //if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil { - // zap.L().Error("get realName info err", zap.Error(err)) - // err = errors.New(m.ERROR_SELECT) - // return - //} - // - //var args []interface{} - //var sqlWhere = " card_id = ? and (type = 4 or type = 7) " - //args = append(args, realName.IDNum) - //if req.State != 0 { - // sqlWhere += " and state = ? " - // args = append(args, req.State) - //} - // - //var contractModel []model.Contract - //if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil { - // zap.L().Error("get contractModels info err", zap.Error(err)) - // err = errors.New(m.ERROR_SELECT) - // return - //} - // - //for _, v := range contractModel { - // contractTmp := &contract.ContractData{} - // contractTmp.ID = uint64(v.ID) - // contractTmp.ContractId = v.ContractId - // contractTmp.DownloadUrl = v.DownloadUrl - // contractTmp.MgmtUserId = v.MgmtUserId - // contractTmp.State = int64(v.State) - // contractTmp.TransactionId = v.TransactionId - // contractTmp.Type = int64(v.Type) - // var b string - // if v.Type == 4 { - // b = "物权" - // } - // if v.Type == 7 { - // b = "版权" - // } - // contractTmp.BatchName = b + v.BatchName[0:4] + "年" + v.BatchName[4:6] + "月" + v.BatchName[6:11] + "年" + v.BatchName[11:13] + "月" - // contractTmp.UserId = int64(v.UserId) - // contractTmp.ViewUrl = v.ViewUrl - // contractTmp.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05") - // contractTmp.SignTime = v.UpdatedAt.Format("2006-01-02") - // Data = append(Data, contractTmp) - //} - - rep.Data = Data - - return -} - -func GetContract(id int32) (rep *contract.ContractData, err error) { - var con model.Contract - if err = db.DB.Where("id = ? ", id).First(&con).Error; err != nil { +func GetMgmtContractByArtworkUid(artworkUid string, artworkType int32) (err error) { + //画作有合同类型是2,6的都是 点击过"著作权代理转让服务合同"的 + var contract model.Contract + if err = db.DB.Where("artwork_uid = ? AND type = ?", artworkUid, 2).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound { zap.L().Error("get contract info err", zap.Error(err)) err = errors.New(m.ERROR_SELECT) return } - rep.ID = uint64(con.ID) - rep.UserId = int64(con.UserId) - rep.CardId = con.CardId - rep.MgmtUserId = con.MgmtUserId - rep.ArtworkId = con.ArtworkId - rep.ContractId = con.ContractId - rep.TransactionId = con.TransactionId - rep.Type = int64(con.Type) - rep.BatchName = con.BatchName - rep.ViewUrl = con.ViewUrl - rep.DownloadUrl = con.DownloadUrl - rep.State = int64(con.State) + return +} + +func CreateArtworkContract(tx *gorm.DB, artworkUid string, artistUid string, contractType int32) (err error) { + var uid uuid.UUID + if uid, err = uuid.NewV4(); err != nil { + err = errors.New(m.ERROR_UID) + return + } + + contract := &model.Contract{ + Uid: uid.String(), + ArtistUid: artistUid, + ArtworkUid: artworkUid, + Type: contractType, + State: 1, + } + if err = tx.Create(contract).Error; err != nil { + zap.L().Error("create contract err", zap.Error(err)) + err = errors.New(m.CREATE_ERROR) + return + } return } -// 更新交易id -func UpdateContract(req *contract.UpdateContractRequest) error { - //数据库操作异常 - var con model.Contract - if err := db.DB.Model(&con).Updates(&model.Contract{ContractId: req.ContractId, ViewUrl: req.ViewUrl, DownloadUrl: req.DownloadUrl}).Error; err != nil { - return err - } - return nil -} +// func FinishContract(tx *gorm.DB, id string) (contract model.Contract, err error) { +// if err = tx.Where("transaction_id = ?", id).First(&contract).Error; err != nil { +// zap.L().Error("get contract info err", zap.Error(err)) +// err = errors.New(m.ERROR_SELECT) +// return +// } -// 更新交易id -func UpdateContractTx(txId string, contractId int32) (err error) { - var con model.Contract - con.ID = contractId - if err = db.DB.Model(&con).Update("transaction_id", txId).Error; err != nil { - return - } - if err = db.DB.Model(&con).Update("state", 1).Error; err != nil { - return - } - return -} +// if err = db.DB.Model(&contract).Update("state", 3).Error; err != nil { +// zap.L().Error("user contract failed", zap.Error(err)) +// err = errors.New(m.UPDATE_FAILED) +// return +// } + +// return +// } + +// func UpdateArtworkState(tx *gorm.DB, id int32) (err error) { //无用 +// var artworkState model.ArtworkState +// if err = tx.Where("artwork_id = ? and state = ? ", id, 7).First(&artworkState).Error; err != nil { +// if err == gorm.ErrRecordNotFound { +// artworkState.ArtworkId = id +// artworkState.State = 7 +// if err = tx.Create(&artworkState).Error; err != nil { +// zap.L().Error("create artworkState err", zap.Error(err)) +// err = errors.New(m.CREATE_ERROR) +// return +// } +// } else { +// zap.L().Error("find artworkState info err", zap.Error(err)) +// err = errors.New(m.ERROR_DATA_NOT_EXISTS) +// return +// } +// } + +// if err = tx.Model(&model.Artwork{}).Where("id = ? ", id).Update("flow_state", 7).Error; err != nil { +// zap.L().Error("Artwork Update Err", zap.Error(err)) +// err = errors.New(m.ERROR_DATA_NOT_EXISTS) +// return +// } + +// return +// } + +// func ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) { +// rep = &contract.ContractListRespond{} +// var Data []*contract.ContractData + +// var user model.User +// if err = db.DB.Where("id = ? ", req.ID).First(&user).Error; err != nil { +// zap.L().Error("get user info err", zap.Error(err)) +// err = errors.New(m.ERROR_SELECT) +// return +// } + +// var realName model.RealName +// if err = db.DB.Where("id = ? ", user.RealNameId).First(&realName).Error; err != nil { +// zap.L().Error("get realName info err", zap.Error(err)) +// err = errors.New(m.ERROR_SELECT) +// return +// } + +// var args []interface{} +// var sqlWhere = "user_id = ? and type !=4 " +// args = append(args, req.ID) + +// if req.State != 0 { +// sqlWhere += " and state = ? " +// if req.State == 2 { +// req.State = 3 +// } +// args = append(args, req.State) +// } + +// var contractModel []model.Contract +// if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil { +// zap.L().Error("get contractModels info err", zap.Error(err)) +// err = errors.New(m.ERROR_SELECT) +// return +// } + +// for _, v := range contractModel { +// contract := &contract.ContractData{} +// contract.ID = uint64(v.ID) +// contract.ContractId = v.ContractId +// contract.DownloadUrl = v.DownloadUrl +// contract.MgmtUserId = v.MgmtUserId +// contract.State = int64(v.State) +// contract.TransactionId = v.TransactionId +// contract.Type = int64(v.Type) +// contract.UserId = int64(v.UserId) +// contract.ViewUrl = v.ViewUrl +// contract.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05") +// contract.SignTime = v.UpdatedAt.Format("2006-01-02") +// Data = append(Data, contract) +// } + +// rep.Data = Data + +// return +// } + +// func ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) { +// rep = &contract.ContractTxListRespond{} +// var Data []*contract.ContractData + +// var user model.User +// if err = db.DB.Where("id = ? ", int32(req.ID)).First(&user).Error; err != nil { +// zap.L().Error("get user info err", zap.Error(err)) +// err = errors.New(m.ERROR_SELECT) +// return +// } +// // todo +// //var realName model.RealName +// //if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil { +// // zap.L().Error("get realName info err", zap.Error(err)) +// // err = errors.New(m.ERROR_SELECT) +// // return +// //} +// // +// //var args []interface{} +// //var sqlWhere = " card_id = ? and (type = 4 or type = 7) " +// //args = append(args, realName.IDNum) +// //if req.State != 0 { +// // sqlWhere += " and state = ? " +// // args = append(args, req.State) +// //} +// // +// //var contractModel []model.Contract +// //if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil { +// // zap.L().Error("get contractModels info err", zap.Error(err)) +// // err = errors.New(m.ERROR_SELECT) +// // return +// //} +// // +// //for _, v := range contractModel { +// // contractTmp := &contract.ContractData{} +// // contractTmp.ID = uint64(v.ID) +// // contractTmp.ContractId = v.ContractId +// // contractTmp.DownloadUrl = v.DownloadUrl +// // contractTmp.MgmtUserId = v.MgmtUserId +// // contractTmp.State = int64(v.State) +// // contractTmp.TransactionId = v.TransactionId +// // contractTmp.Type = int64(v.Type) +// // var b string +// // if v.Type == 4 { +// // b = "物权" +// // } +// // if v.Type == 7 { +// // b = "版权" +// // } +// // contractTmp.BatchName = b + v.BatchName[0:4] + "年" + v.BatchName[4:6] + "月" + v.BatchName[6:11] + "年" + v.BatchName[11:13] + "月" +// // contractTmp.UserId = int64(v.UserId) +// // contractTmp.ViewUrl = v.ViewUrl +// // contractTmp.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05") +// // contractTmp.SignTime = v.UpdatedAt.Format("2006-01-02") +// // Data = append(Data, contractTmp) +// //} + +// rep.Data = Data + +// return +// } + +// func GetContract(id int32) (rep *contract.ContractData, err error) { +// var con model.Contract +// if err = db.DB.Where("id = ? ", id).First(&con).Error; err != nil { +// zap.L().Error("get contract info err", zap.Error(err)) +// err = errors.New(m.ERROR_SELECT) +// return +// } +// rep.ID = uint64(con.ID) +// rep.UserId = int64(con.UserId) +// rep.CardId = con.CardId +// rep.MgmtUserId = con.MgmtUserId +// rep.ArtworkId = con.ArtworkId +// rep.ContractId = con.ContractId +// rep.TransactionId = con.TransactionId +// rep.Type = int64(con.Type) +// rep.BatchName = con.BatchName +// rep.ViewUrl = con.ViewUrl +// rep.DownloadUrl = con.DownloadUrl +// rep.State = int64(con.State) + +// return +// } + +// // 更新交易id +// func UpdateContract(req *contract.UpdateContractRequest) error { +// //数据库操作异常 +// var con model.Contract +// if err := db.DB.Model(&con).Updates(&model.Contract{ContractId: req.ContractId, ViewUrl: req.ViewUrl, DownloadUrl: req.DownloadUrl}).Error; err != nil { +// //在线和下载的链接 +// return err +// } +// return nil +// } + +// // 更新交易id +// func UpdateContractTx(txId string, contractId int32) (err error) { +// var con model.Contract +// con.ID = contractId +// if err = db.DB.Model(&con).Update("transaction_id", txId).Error; err != nil { //改变交易id +// return +// } +// if err = db.DB.Model(&con).Update("state", 1).Error; err != nil { //更新合约状态 // 1:待生成 2 待签署 3 签署完成 +// return +// } +// return +// } diff --git a/cmd/internal/logic/contract.go b/cmd/internal/logic/contract.go index 632720c..061aefb 100644 --- a/cmd/internal/logic/contract.go +++ b/cmd/internal/logic/contract.go @@ -1,11 +1,23 @@ package logic import ( + "context" + "errors" + "github.com/fonchain/fonchain-artistinfo/cmd/internal/dao" + "github.com/fonchain/fonchain-artistinfo/cmd/model" + "github.com/fonchain/fonchain-artistinfo/pb/artist" "github.com/fonchain/fonchain-artistinfo/pb/contract" + db "github.com/fonchain/fonchain-artistinfo/pkg/db" + "github.com/fonchain/fonchain-artistinfo/pkg/m" + "github.com/fonchain/fonchain-artistinfo/pkg/service" + uuid "github.com/satori/go.uuid" + "go.uber.org/zap" + "gorm.io/gorm" ) type IContract interface { + CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) @@ -21,47 +33,157 @@ func NewContract() IContract { type Contract struct { } -func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) { - rep = &contract.FinishContractRespond{} - - err = dao.FinishContract(req.TransactionId) - if err != nil { - return nil, err +func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) { + rep = &contract.CreateContractRespond{} + //查看画家是否存在 + if _, err := service.GrpcArtistImpl.ArtistInfo(context.Background(), &artist.ArtistInfoRequest{Uid: req.ArtistUid}); err != nil { + zap.L().Error("update airDrop err", zap.Error(err)) + return rep, errors.New(m.ERROR_UPDATE + err.Error()) } + //遇到错误数据库回滚 + tx := db.DB.Begin() + + switch req.Type { + //1 画家合同(不涉及画家的画作) + case 1: + + //查看画家合同是否已经存在,不存在继续 + if err = dao.GetMgmtContractByArtistUid(req.ArtistUid, req.Type); err == gorm.ErrRecordNotFound { + var uid uuid.UUID + if uid, err = uuid.NewV4(); err != nil { + err = errors.New(m.ERROR_UID) + return + } + + //创建画家合同 + contract := &model.Contract{ + Uid: uid.String(), + ArtistUid: req.ArtistUid, + Type: 1, + State: 1, + } + + if err = dao.CreateArtistContract(tx, contract); err != nil { + return + } + } else { + return + } + + case 2: + for _, v := range req.ArtworkUid { + //查看画作合同是否已经存在,不存在继续,类型2、6 + if err = dao.GetMgmtContractByArtworkUid(v, 2); err == gorm.ErrRecordNotFound { + if err = dao.GetMgmtContractByArtworkUid(v, 6); err == gorm.ErrRecordNotFound { + + //创建画家画作合同,类型2 + if err = dao.CreateArtworkContract(tx, v, req.ArtistUid, 2); err != nil { + tx.Rollback() + return + } + + //创建画家画作合同,类型6 + if err = dao.CreateArtworkContract(tx, v, req.ArtistUid, 6); err != nil { + tx.Rollback() + return + } + + } else { + return + } + } else { + return + } + } + + case 3: + + case 5: + + default: + err = errors.New("type值出错!") + return + + } + + tx.Commit() return } -func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) { +// func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) { +// rep = &contract.FinishContractRespond{} - rep, err = dao.ContractList(req) +// tx := db.DB.Begin() +// //更新合同状态并获取合同信息 +// contract, err := dao.FinishContract(tx, req.TransactionId) +// if err != nil { +// tx.Rollback() +// return nil, err +// } - return -} +// //查看画作是否已经状态改变,没有则改变 无用 +// if err = dao.UpdateArtworkState(tx, contract.ID); err != nil { +// tx.Rollback() +// return +// } -func (a *Contract) GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error) { +// var tmp struct { +// Uid int32 `json:"uid"` +// } +// tmp.Uid = contract.BatchId +// tmpByte, _ := json.Marshal(&tmp) - rep, err = dao.GetContract(int32(req.Id)) +// if contract.Type == 4 { +// _, err = util.Post("https://ms.fontree.cn/mgmt/artworktx/updatebatchtype", string(tmpByte)) +// if err != nil { +// zap.L().Error("post request err", zap.Error(err)) +// return +// } +// } - return -} -func (a *Contract) ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) { +// if contract.Type == 7 { +// _, err = util.Post("https://ms.fontree.cn/mgmt/artworktx/updatebatchtypecopy", string(tmpByte)) +// if err != nil { +// zap.L().Error("post request err", zap.Error(err)) +// return +// } +// } - rep, err = dao.ContractTxList(req) +// tx.Commit() +// return +// } - return -} +// func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) { -func (a *Contract) UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) { - rep = &contract.UpdateContractRespond{} - err = dao.UpdateContract(req) +// rep, err = dao.ContractList(req) - return -} +// return +// } -func (a *Contract) UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) { - rep = &contract.UpdateContractTxRespond{} - err = dao.UpdateContractTx(req.TransactionId, int32(req.ID)) +// func (a *Contract) GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error) { - return -} +// rep, err = dao.GetContract(int32(req.Id)) + +// return +// } +// func (a *Contract) ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) { + +// rep, err = dao.ContractTxList(req) + +// return +// } + +// func (a *Contract) UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) { +// rep = &contract.UpdateContractRespond{} +// err = dao.UpdateContract(req) + +// return +// } + +// func (a *Contract) UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) { +// rep = &contract.UpdateContractTxRespond{} +// err = dao.UpdateContractTx(req.TransactionId, int32(req.ID)) + +// return +// } diff --git a/cmd/model/contract.go b/cmd/model/contract.go index 67b9a09..4ed956b 100644 --- a/cmd/model/contract.go +++ b/cmd/model/contract.go @@ -1,21 +1,22 @@ package model +import "gorm.io/plugin/soft_delete" + // Contract 用户模型 type Contract struct { - Model - ID int32 `gorm:"not null"` - UserId int32 `gorm:"not null"` - CardId string `gorm:"type:varchar(256) default ''"` - MgmtUserId string `gorm:"not null"` - ArtworkId string `gorm:"type:varchar(256) default ''"` - ContractId string `gorm:"type:varchar(256) default ''"` - TransactionId string `gorm:"type:varchar(256) default '' "` - Type int32 `gorm:"not null"` - BatchId int32 `gorm:"not null"` - BatchName string `gorm:"type:varchar(256) default '' "` - ViewUrl string `gorm:"type:varchar(256) default ''"` - DownloadUrl string `gorm:"type:varchar(256) default ''"` - State int32 `gorm:"not null"` + ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + Uid string `gorm:"column:uid;type:varchar(100);comment:合同表的唯一表示;NOT NULL" json:"uid"` + ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"` + ArtworkUid string `gorm:"column:artwork_uid;type:varchar(100);comment:画作uid" json:"artwork_uid"` + ContractId string `gorm:"column:contract_id;type:varchar(100);comment:合同id" json:"contract_id"` + TransactionId string `gorm:"column:transaction_id;type:varchar(100);comment:交易id" json:"transaction_id"` + Type int32 `gorm:"column:type;type:int(1);comment:合同类型;NOT NULL" json:"type"` + ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"` + DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"` + State int32 `gorm:"column:state;type:int(1);comment:合同状态;NOT NULL" json:"state"` + CreatedAt int32 `gorm:"column:created_at;autoCreateTime"` + UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"` + DeletedAt soft_delete.DeletedAt } type Reply struct { diff --git a/go.mod b/go.mod index 7ecb544..a0da8e3 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/mwitkow/go-proto-validators v0.3.2 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 + github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b go.uber.org/zap v1.21.0 golang.org/x/image v0.0.0-20190802002840-cff245a6509b google.golang.org/protobuf v1.28.1 @@ -122,7 +123,6 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect - github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect github.com/shirou/gopsutil v3.20.11+incompatible // indirect github.com/shirou/gopsutil/v3 v3.21.6 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect diff --git a/pb/contract/contract.pb.go b/pb/contract/contract.pb.go index d14b8c4..fdac34e 100644 --- a/pb/contract/contract.pb.go +++ b/pb/contract/contract.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.9.0 -// source: api/contract/contract.proto +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: contract.proto package contract @@ -20,18 +20,128 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type CreateContractRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ArtistUid string `protobuf:"bytes,1,opt,name=ArtistUid,json=artist_uid,proto3" json:"ArtistUid,omitempty"` + ArtworkUid []string `protobuf:"bytes,2,rep,name=ArtworkUid,json=artwork_uid,proto3" json:"ArtworkUid,omitempty"` + Type int32 `protobuf:"varint,3,opt,name=Type,json=type,proto3" json:"Type,omitempty"` +} + +func (x *CreateContractRequest) Reset() { + *x = CreateContractRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_contract_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateContractRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateContractRequest) ProtoMessage() {} + +func (x *CreateContractRequest) ProtoReflect() protoreflect.Message { + mi := &file_contract_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateContractRequest.ProtoReflect.Descriptor instead. +func (*CreateContractRequest) Descriptor() ([]byte, []int) { + return file_contract_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateContractRequest) GetArtistUid() string { + if x != nil { + return x.ArtistUid + } + return "" +} + +func (x *CreateContractRequest) GetArtworkUid() []string { + if x != nil { + return x.ArtworkUid + } + return nil +} + +func (x *CreateContractRequest) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +type CreateContractRespond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=Msg,json=msg,proto3" json:"Msg,omitempty"` +} + +func (x *CreateContractRespond) Reset() { + *x = CreateContractRespond{} + if protoimpl.UnsafeEnabled { + mi := &file_contract_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateContractRespond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateContractRespond) ProtoMessage() {} + +func (x *CreateContractRespond) ProtoReflect() protoreflect.Message { + mi := &file_contract_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateContractRespond.ProtoReflect.Descriptor instead. +func (*CreateContractRespond) Descriptor() ([]byte, []int) { + return file_contract_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateContractRespond) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + type FinishContractRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TransactionId string `protobuf:"bytes,1,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId"` + TransactionId string `protobuf:"bytes,1,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId,omitempty"` } func (x *FinishContractRequest) Reset() { *x = FinishContractRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[0] + mi := &file_contract_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +154,7 @@ func (x *FinishContractRequest) String() string { func (*FinishContractRequest) ProtoMessage() {} func (x *FinishContractRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[0] + mi := &file_contract_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,7 +167,7 @@ func (x *FinishContractRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FinishContractRequest.ProtoReflect.Descriptor instead. func (*FinishContractRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{0} + return file_contract_proto_rawDescGZIP(), []int{2} } func (x *FinishContractRequest) GetTransactionId() string { @@ -76,7 +186,7 @@ type FinishContractRespond struct { func (x *FinishContractRespond) Reset() { *x = FinishContractRespond{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[1] + mi := &file_contract_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -89,7 +199,7 @@ func (x *FinishContractRespond) String() string { func (*FinishContractRespond) ProtoMessage() {} func (x *FinishContractRespond) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[1] + mi := &file_contract_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -102,7 +212,7 @@ func (x *FinishContractRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use FinishContractRespond.ProtoReflect.Descriptor instead. func (*FinishContractRespond) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{1} + return file_contract_proto_rawDescGZIP(), []int{3} } type ContractListRequest struct { @@ -110,16 +220,16 @@ type ContractListRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PageSize int64 `protobuf:"varint,1,opt,name=PageSize,json=pageSize,proto3" json:"PageSize"` - Page int64 `protobuf:"varint,2,opt,name=Page,json=page,proto3" json:"Page"` - State int64 `protobuf:"varint,3,opt,name=State,json=state,proto3" json:"State"` - ID int64 `protobuf:"varint,4,opt,name=ID,json=id,proto3" json:"ID"` + PageSize int64 `protobuf:"varint,1,opt,name=PageSize,json=pageSize,proto3" json:"PageSize,omitempty"` + Page int64 `protobuf:"varint,2,opt,name=Page,json=page,proto3" json:"Page,omitempty"` + State int64 `protobuf:"varint,3,opt,name=State,json=state,proto3" json:"State,omitempty"` + ID int64 `protobuf:"varint,4,opt,name=ID,json=id,proto3" json:"ID,omitempty"` } func (x *ContractListRequest) Reset() { *x = ContractListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[2] + mi := &file_contract_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -132,7 +242,7 @@ func (x *ContractListRequest) String() string { func (*ContractListRequest) ProtoMessage() {} func (x *ContractListRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[2] + mi := &file_contract_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -145,7 +255,7 @@ func (x *ContractListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ContractListRequest.ProtoReflect.Descriptor instead. func (*ContractListRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{2} + return file_contract_proto_rawDescGZIP(), []int{4} } func (x *ContractListRequest) GetPageSize() int64 { @@ -181,13 +291,13 @@ type ContractListRespond struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []*ContractData `protobuf:"bytes,1,rep,name=Data,proto3" json:"Data"` + Data []*ContractData `protobuf:"bytes,1,rep,name=Data,proto3" json:"Data,omitempty"` } func (x *ContractListRespond) Reset() { *x = ContractListRespond{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[3] + mi := &file_contract_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -200,7 +310,7 @@ func (x *ContractListRespond) String() string { func (*ContractListRespond) ProtoMessage() {} func (x *ContractListRespond) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[3] + mi := &file_contract_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -213,7 +323,7 @@ func (x *ContractListRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use ContractListRespond.ProtoReflect.Descriptor instead. func (*ContractListRespond) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{3} + return file_contract_proto_rawDescGZIP(), []int{5} } func (x *ContractListRespond) GetData() []*ContractData { @@ -228,29 +338,29 @@ type ContractData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ID uint64 `protobuf:"varint,1,opt,name=ID,json=id,proto3" json:"ID"` - UserId int64 `protobuf:"varint,2,opt,name=UserId,json=userId,proto3" json:"UserId"` - CardId string `protobuf:"bytes,3,opt,name=CardId,json=cardId,proto3" json:"CardId"` - MgmtUserId string `protobuf:"bytes,4,opt,name=MgmtUserId,json=mgmtUserId,proto3" json:"MgmtUserId"` - ArtworkId string `protobuf:"bytes,5,opt,name=ArtworkId,json=artworkId,proto3" json:"ArtworkId"` - ContractId string `protobuf:"bytes,6,opt,name=ContractId,json=contractId,proto3" json:"ContractId"` - TransactionId string `protobuf:"bytes,7,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId"` - Type int64 `protobuf:"varint,8,opt,name=Type,json=type,proto3" json:"Type"` - BatchId int64 `protobuf:"varint,9,opt,name=BatchId,json=batchId,proto3" json:"BatchId"` - BatchName string `protobuf:"bytes,10,opt,name=BatchName,json=batchName,proto3" json:"BatchName"` - ViewUrl string `protobuf:"bytes,11,opt,name=ViewUrl,json=viewUrl,proto3" json:"ViewUrl"` - DownloadUrl string `protobuf:"bytes,12,opt,name=DownloadUrl,json=downloadUrl,proto3" json:"DownloadUrl"` - State int64 `protobuf:"varint,13,opt,name=State,json=state,proto3" json:"State"` - UpdateTime string `protobuf:"bytes,14,opt,name=UpdateTime,json=updateTime,proto3" json:"UpdateTime"` - CreateTime string `protobuf:"bytes,15,opt,name=CreateTime,json=createTime,proto3" json:"CreateTime"` - ExpirationTime string `protobuf:"bytes,16,opt,name=ExpirationTime,json=expirationTime,proto3" json:"ExpirationTime"` - SignTime string `protobuf:"bytes,17,opt,name=SignTime,json=signTime,proto3" json:"SignTime"` + ID uint64 `protobuf:"varint,1,opt,name=ID,json=id,proto3" json:"ID,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=UserId,json=userId,proto3" json:"UserId,omitempty"` + CardId string `protobuf:"bytes,3,opt,name=CardId,json=cardId,proto3" json:"CardId,omitempty"` + MgmtUserId string `protobuf:"bytes,4,opt,name=MgmtUserId,json=mgmtUserId,proto3" json:"MgmtUserId,omitempty"` + ArtworkId string `protobuf:"bytes,5,opt,name=ArtworkId,json=artworkId,proto3" json:"ArtworkId,omitempty"` + ContractId string `protobuf:"bytes,6,opt,name=ContractId,json=contractId,proto3" json:"ContractId,omitempty"` + TransactionId string `protobuf:"bytes,7,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId,omitempty"` + Type int64 `protobuf:"varint,8,opt,name=Type,json=type,proto3" json:"Type,omitempty"` + BatchId int64 `protobuf:"varint,9,opt,name=BatchId,json=batchId,proto3" json:"BatchId,omitempty"` + BatchName string `protobuf:"bytes,10,opt,name=BatchName,json=batchName,proto3" json:"BatchName,omitempty"` + ViewUrl string `protobuf:"bytes,11,opt,name=ViewUrl,json=viewUrl,proto3" json:"ViewUrl,omitempty"` + DownloadUrl string `protobuf:"bytes,12,opt,name=DownloadUrl,json=downloadUrl,proto3" json:"DownloadUrl,omitempty"` + State int64 `protobuf:"varint,13,opt,name=State,json=state,proto3" json:"State,omitempty"` + UpdateTime string `protobuf:"bytes,14,opt,name=UpdateTime,json=updateTime,proto3" json:"UpdateTime,omitempty"` + CreateTime string `protobuf:"bytes,15,opt,name=CreateTime,json=createTime,proto3" json:"CreateTime,omitempty"` + ExpirationTime string `protobuf:"bytes,16,opt,name=ExpirationTime,json=expirationTime,proto3" json:"ExpirationTime,omitempty"` + SignTime string `protobuf:"bytes,17,opt,name=SignTime,json=signTime,proto3" json:"SignTime,omitempty"` } func (x *ContractData) Reset() { *x = ContractData{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[4] + mi := &file_contract_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -263,7 +373,7 @@ func (x *ContractData) String() string { func (*ContractData) ProtoMessage() {} func (x *ContractData) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[4] + mi := &file_contract_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -276,7 +386,7 @@ func (x *ContractData) ProtoReflect() protoreflect.Message { // Deprecated: Use ContractData.ProtoReflect.Descriptor instead. func (*ContractData) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{4} + return file_contract_proto_rawDescGZIP(), []int{6} } func (x *ContractData) GetID() uint64 { @@ -403,16 +513,16 @@ type ContractTxListRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PageSize int64 `protobuf:"varint,1,opt,name=PageSize,json=pageSize,proto3" json:"PageSize"` - Page int64 `protobuf:"varint,2,opt,name=Page,json=page,proto3" json:"Page"` - State int64 `protobuf:"varint,3,opt,name=State,json=state,proto3" json:"State"` - ID int64 `protobuf:"varint,4,opt,name=ID,json=id,proto3" json:"ID"` + PageSize int64 `protobuf:"varint,1,opt,name=PageSize,json=pageSize,proto3" json:"PageSize,omitempty"` + Page int64 `protobuf:"varint,2,opt,name=Page,json=page,proto3" json:"Page,omitempty"` + State int64 `protobuf:"varint,3,opt,name=State,json=state,proto3" json:"State,omitempty"` + ID int64 `protobuf:"varint,4,opt,name=ID,json=id,proto3" json:"ID,omitempty"` } func (x *ContractTxListRequest) Reset() { *x = ContractTxListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[5] + mi := &file_contract_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -425,7 +535,7 @@ func (x *ContractTxListRequest) String() string { func (*ContractTxListRequest) ProtoMessage() {} func (x *ContractTxListRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[5] + mi := &file_contract_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -438,7 +548,7 @@ func (x *ContractTxListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ContractTxListRequest.ProtoReflect.Descriptor instead. func (*ContractTxListRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{5} + return file_contract_proto_rawDescGZIP(), []int{7} } func (x *ContractTxListRequest) GetPageSize() int64 { @@ -474,13 +584,13 @@ type ContractTxListRespond struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []*ContractData `protobuf:"bytes,1,rep,name=Data,proto3" json:"Data"` + Data []*ContractData `protobuf:"bytes,1,rep,name=Data,proto3" json:"Data,omitempty"` } func (x *ContractTxListRespond) Reset() { *x = ContractTxListRespond{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[6] + mi := &file_contract_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -493,7 +603,7 @@ func (x *ContractTxListRespond) String() string { func (*ContractTxListRespond) ProtoMessage() {} func (x *ContractTxListRespond) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[6] + mi := &file_contract_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -506,7 +616,7 @@ func (x *ContractTxListRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use ContractTxListRespond.ProtoReflect.Descriptor instead. func (*ContractTxListRespond) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{6} + return file_contract_proto_rawDescGZIP(), []int{8} } func (x *ContractTxListRespond) GetData() []*ContractData { @@ -521,15 +631,15 @@ type SignContractRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ContractId int64 `protobuf:"varint,1,opt,name=ContractId,json=contractId,proto3" json:"ContractId"` - HtmlType string `protobuf:"bytes,2,opt,name=HtmlType,json=htmlType,proto3" json:"HtmlType"` - EnvType string `protobuf:"bytes,3,opt,name=EnvType,json=envType,proto3" json:"EnvType"` + ContractId int64 `protobuf:"varint,1,opt,name=ContractId,json=contractId,proto3" json:"ContractId,omitempty"` + HtmlType string `protobuf:"bytes,2,opt,name=HtmlType,json=htmlType,proto3" json:"HtmlType,omitempty"` + EnvType string `protobuf:"bytes,3,opt,name=EnvType,json=envType,proto3" json:"EnvType,omitempty"` } func (x *SignContractRequest) Reset() { *x = SignContractRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[7] + mi := &file_contract_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -542,7 +652,7 @@ func (x *SignContractRequest) String() string { func (*SignContractRequest) ProtoMessage() {} func (x *SignContractRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[7] + mi := &file_contract_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -555,7 +665,7 @@ func (x *SignContractRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignContractRequest.ProtoReflect.Descriptor instead. func (*SignContractRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{7} + return file_contract_proto_rawDescGZIP(), []int{9} } func (x *SignContractRequest) GetContractId() int64 { @@ -588,7 +698,7 @@ type SignContractRespond struct { func (x *SignContractRespond) Reset() { *x = SignContractRespond{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[8] + mi := &file_contract_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -601,7 +711,7 @@ func (x *SignContractRespond) String() string { func (*SignContractRespond) ProtoMessage() {} func (x *SignContractRespond) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[8] + mi := &file_contract_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -614,7 +724,7 @@ func (x *SignContractRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use SignContractRespond.ProtoReflect.Descriptor instead. func (*SignContractRespond) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{8} + return file_contract_proto_rawDescGZIP(), []int{10} } type GetContractRequest struct { @@ -622,13 +732,13 @@ type GetContractRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"Id"` + Id int64 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"Id,omitempty"` } func (x *GetContractRequest) Reset() { *x = GetContractRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[9] + mi := &file_contract_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -641,7 +751,7 @@ func (x *GetContractRequest) String() string { func (*GetContractRequest) ProtoMessage() {} func (x *GetContractRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[9] + mi := &file_contract_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -654,7 +764,7 @@ func (x *GetContractRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetContractRequest.ProtoReflect.Descriptor instead. func (*GetContractRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{9} + return file_contract_proto_rawDescGZIP(), []int{11} } func (x *GetContractRequest) GetId() int64 { @@ -669,29 +779,29 @@ type UpdateContractRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ID uint64 `protobuf:"varint,1,opt,name=ID,json=id,proto3" json:"ID"` - UserId int64 `protobuf:"varint,2,opt,name=UserId,json=userId,proto3" json:"UserId"` - CardId string `protobuf:"bytes,3,opt,name=CardId,json=cardId,proto3" json:"CardId"` - MgmtUserId string `protobuf:"bytes,4,opt,name=MgmtUserId,json=mgmtUserId,proto3" json:"MgmtUserId"` - ArtworkId string `protobuf:"bytes,5,opt,name=ArtworkId,json=artworkId,proto3" json:"ArtworkId"` - ContractId string `protobuf:"bytes,6,opt,name=ContractId,json=contractId,proto3" json:"ContractId"` - TransactionId string `protobuf:"bytes,7,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId"` - Type int64 `protobuf:"varint,8,opt,name=Type,json=type,proto3" json:"Type"` - BatchId int64 `protobuf:"varint,9,opt,name=BatchId,json=batchId,proto3" json:"BatchId"` - BatchName string `protobuf:"bytes,10,opt,name=BatchName,json=batchName,proto3" json:"BatchName"` - ViewUrl string `protobuf:"bytes,11,opt,name=ViewUrl,json=viewUrl,proto3" json:"ViewUrl"` - DownloadUrl string `protobuf:"bytes,12,opt,name=DownloadUrl,json=downloadUrl,proto3" json:"DownloadUrl"` - State int64 `protobuf:"varint,13,opt,name=State,json=state,proto3" json:"State"` - UpdateTime string `protobuf:"bytes,14,opt,name=UpdateTime,json=updateTime,proto3" json:"UpdateTime"` - CreateTime string `protobuf:"bytes,15,opt,name=CreateTime,json=createTime,proto3" json:"CreateTime"` - ExpirationTime string `protobuf:"bytes,16,opt,name=ExpirationTime,json=expirationTime,proto3" json:"ExpirationTime"` - SignTime string `protobuf:"bytes,17,opt,name=SignTime,json=signTime,proto3" json:"SignTime"` + ID uint64 `protobuf:"varint,1,opt,name=ID,json=id,proto3" json:"ID,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=UserId,json=userId,proto3" json:"UserId,omitempty"` + CardId string `protobuf:"bytes,3,opt,name=CardId,json=cardId,proto3" json:"CardId,omitempty"` + MgmtUserId string `protobuf:"bytes,4,opt,name=MgmtUserId,json=mgmtUserId,proto3" json:"MgmtUserId,omitempty"` + ArtworkId string `protobuf:"bytes,5,opt,name=ArtworkId,json=artworkId,proto3" json:"ArtworkId,omitempty"` + ContractId string `protobuf:"bytes,6,opt,name=ContractId,json=contractId,proto3" json:"ContractId,omitempty"` + TransactionId string `protobuf:"bytes,7,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId,omitempty"` + Type int64 `protobuf:"varint,8,opt,name=Type,json=type,proto3" json:"Type,omitempty"` + BatchId int64 `protobuf:"varint,9,opt,name=BatchId,json=batchId,proto3" json:"BatchId,omitempty"` + BatchName string `protobuf:"bytes,10,opt,name=BatchName,json=batchName,proto3" json:"BatchName,omitempty"` + ViewUrl string `protobuf:"bytes,11,opt,name=ViewUrl,json=viewUrl,proto3" json:"ViewUrl,omitempty"` + DownloadUrl string `protobuf:"bytes,12,opt,name=DownloadUrl,json=downloadUrl,proto3" json:"DownloadUrl,omitempty"` + State int64 `protobuf:"varint,13,opt,name=State,json=state,proto3" json:"State,omitempty"` + UpdateTime string `protobuf:"bytes,14,opt,name=UpdateTime,json=updateTime,proto3" json:"UpdateTime,omitempty"` + CreateTime string `protobuf:"bytes,15,opt,name=CreateTime,json=createTime,proto3" json:"CreateTime,omitempty"` + ExpirationTime string `protobuf:"bytes,16,opt,name=ExpirationTime,json=expirationTime,proto3" json:"ExpirationTime,omitempty"` + SignTime string `protobuf:"bytes,17,opt,name=SignTime,json=signTime,proto3" json:"SignTime,omitempty"` } func (x *UpdateContractRequest) Reset() { *x = UpdateContractRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[10] + mi := &file_contract_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -704,7 +814,7 @@ func (x *UpdateContractRequest) String() string { func (*UpdateContractRequest) ProtoMessage() {} func (x *UpdateContractRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[10] + mi := &file_contract_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -717,7 +827,7 @@ func (x *UpdateContractRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContractRequest.ProtoReflect.Descriptor instead. func (*UpdateContractRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{10} + return file_contract_proto_rawDescGZIP(), []int{12} } func (x *UpdateContractRequest) GetID() uint64 { @@ -848,7 +958,7 @@ type UpdateContractRespond struct { func (x *UpdateContractRespond) Reset() { *x = UpdateContractRespond{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[11] + mi := &file_contract_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -861,7 +971,7 @@ func (x *UpdateContractRespond) String() string { func (*UpdateContractRespond) ProtoMessage() {} func (x *UpdateContractRespond) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[11] + mi := &file_contract_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -874,7 +984,7 @@ func (x *UpdateContractRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContractRespond.ProtoReflect.Descriptor instead. func (*UpdateContractRespond) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{11} + return file_contract_proto_rawDescGZIP(), []int{13} } type UpdateContractTxRequest struct { @@ -882,14 +992,14 @@ type UpdateContractTxRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ID int64 `protobuf:"varint,1,opt,name=ID,json=id,proto3" json:"ID"` - TransactionId string `protobuf:"bytes,2,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId"` + ID int64 `protobuf:"varint,1,opt,name=ID,json=id,proto3" json:"ID,omitempty"` + TransactionId string `protobuf:"bytes,2,opt,name=TransactionId,json=transactionId,proto3" json:"TransactionId,omitempty"` } func (x *UpdateContractTxRequest) Reset() { *x = UpdateContractTxRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[12] + mi := &file_contract_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -902,7 +1012,7 @@ func (x *UpdateContractTxRequest) String() string { func (*UpdateContractTxRequest) ProtoMessage() {} func (x *UpdateContractTxRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[12] + mi := &file_contract_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -915,7 +1025,7 @@ func (x *UpdateContractTxRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContractTxRequest.ProtoReflect.Descriptor instead. func (*UpdateContractTxRequest) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{12} + return file_contract_proto_rawDescGZIP(), []int{14} } func (x *UpdateContractTxRequest) GetID() int64 { @@ -941,7 +1051,7 @@ type UpdateContractTxRespond struct { func (x *UpdateContractTxRespond) Reset() { *x = UpdateContractTxRespond{} if protoimpl.UnsafeEnabled { - mi := &file_api_contract_contract_proto_msgTypes[13] + mi := &file_contract_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -954,7 +1064,7 @@ func (x *UpdateContractTxRespond) String() string { func (*UpdateContractTxRespond) ProtoMessage() {} func (x *UpdateContractTxRespond) ProtoReflect() protoreflect.Message { - mi := &file_api_contract_contract_proto_msgTypes[13] + mi := &file_contract_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -967,226 +1077,268 @@ func (x *UpdateContractTxRespond) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContractTxRespond.ProtoReflect.Descriptor instead. func (*UpdateContractTxRespond) Descriptor() ([]byte, []int) { - return file_api_contract_contract_proto_rawDescGZIP(), []int{13} + return file_contract_proto_rawDescGZIP(), []int{15} } -var File_api_contract_contract_proto protoreflect.FileDescriptor +var File_contract_proto protoreflect.FileDescriptor -var file_api_contract_contract_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x3d, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, - 0x6b, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x13, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, - 0xf4, 0x03, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x72, 0x64, - 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x49, 0x64, - 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, - 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x56, 0x69, 0x65, 0x77, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x69, 0x65, 0x77, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, - 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, - 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, - 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x6d, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50, - 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x43, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x2a, +var file_contract_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x6b, 0x0a, 0x15, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x5f, 0x75, + 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0a, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, + 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x29, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, + 0x73, 0x67, 0x22, 0x3d, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x22, 0x17, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x6b, 0x0a, 0x13, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x6b, 0x0a, 0x13, 0x53, 0x69, - 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x48, 0x74, 0x6d, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x74, 0x6d, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x45, 0x6e, 0x76, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x65, 0x6e, 0x76, 0x54, 0x79, 0x70, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x24, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x02, 0x69, 0x64, 0x22, 0xfd, 0x03, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x4d, 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, - 0x0a, 0x09, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, - 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x56, 0x69, 0x65, 0x77, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x69, 0x65, 0x77, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x26, 0x0a, 0x0e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, - 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x4f, 0x0a, - 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x19, - 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x32, 0xcf, 0x04, 0x0a, 0x08, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x54, 0x0a, 0x0e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0xf4, 0x03, 0x0a, 0x0c, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, + 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x6d, 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x41, + 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, + 0x69, 0x65, 0x77, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x69, + 0x65, 0x77, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x55, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, + 0x0e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x22, 0x6d, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x43, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x44, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x6b, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x48, 0x74, 0x6d, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x68, 0x74, 0x6d, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x76, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x76, 0x54, 0x79, + 0x70, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, + 0xfd, 0x03, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x67, 0x6d, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, + 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x72, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x69, 0x65, + 0x77, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x69, 0x65, 0x77, + 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, + 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x45, + 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, + 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x4f, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x64, 0x32, 0xa5, 0x05, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x12, 0x54, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x46, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0c, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x2e, 0x43, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x4e, 0x0a, + 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, - 0x61, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, - 0x78, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x45, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, + 0x74, 0x61, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0c, 0x53, 0x69, 0x67, - 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0c, 0x53, 0x69, + 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1d, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x43, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, - 0x5a, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x54, 0x78, 0x12, 0x21, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, - 0x2f, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, + 0x12, 0x5a, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x54, 0x78, 0x12, 0x21, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, + 0x2e, 0x2f, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( - file_api_contract_contract_proto_rawDescOnce sync.Once - file_api_contract_contract_proto_rawDescData = file_api_contract_contract_proto_rawDesc + file_contract_proto_rawDescOnce sync.Once + file_contract_proto_rawDescData = file_contract_proto_rawDesc ) -func file_api_contract_contract_proto_rawDescGZIP() []byte { - file_api_contract_contract_proto_rawDescOnce.Do(func() { - file_api_contract_contract_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_contract_contract_proto_rawDescData) +func file_contract_proto_rawDescGZIP() []byte { + file_contract_proto_rawDescOnce.Do(func() { + file_contract_proto_rawDescData = protoimpl.X.CompressGZIP(file_contract_proto_rawDescData) }) - return file_api_contract_contract_proto_rawDescData + return file_contract_proto_rawDescData } -var file_api_contract_contract_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_api_contract_contract_proto_goTypes = []interface{}{ - (*FinishContractRequest)(nil), // 0: Contract.FinishContractRequest - (*FinishContractRespond)(nil), // 1: Contract.FinishContractRespond - (*ContractListRequest)(nil), // 2: Contract.ContractListRequest - (*ContractListRespond)(nil), // 3: Contract.ContractListRespond - (*ContractData)(nil), // 4: Contract.ContractData - (*ContractTxListRequest)(nil), // 5: Contract.ContractTxListRequest - (*ContractTxListRespond)(nil), // 6: Contract.ContractTxListRespond - (*SignContractRequest)(nil), // 7: Contract.SignContractRequest - (*SignContractRespond)(nil), // 8: Contract.SignContractRespond - (*GetContractRequest)(nil), // 9: Contract.GetContractRequest - (*UpdateContractRequest)(nil), // 10: Contract.UpdateContractRequest - (*UpdateContractRespond)(nil), // 11: Contract.UpdateContractRespond - (*UpdateContractTxRequest)(nil), // 12: Contract.UpdateContractTxRequest - (*UpdateContractTxRespond)(nil), // 13: Contract.UpdateContractTxRespond +var file_contract_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_contract_proto_goTypes = []interface{}{ + (*CreateContractRequest)(nil), // 0: Contract.CreateContractRequest + (*CreateContractRespond)(nil), // 1: Contract.CreateContractRespond + (*FinishContractRequest)(nil), // 2: Contract.FinishContractRequest + (*FinishContractRespond)(nil), // 3: Contract.FinishContractRespond + (*ContractListRequest)(nil), // 4: Contract.ContractListRequest + (*ContractListRespond)(nil), // 5: Contract.ContractListRespond + (*ContractData)(nil), // 6: Contract.ContractData + (*ContractTxListRequest)(nil), // 7: Contract.ContractTxListRequest + (*ContractTxListRespond)(nil), // 8: Contract.ContractTxListRespond + (*SignContractRequest)(nil), // 9: Contract.SignContractRequest + (*SignContractRespond)(nil), // 10: Contract.SignContractRespond + (*GetContractRequest)(nil), // 11: Contract.GetContractRequest + (*UpdateContractRequest)(nil), // 12: Contract.UpdateContractRequest + (*UpdateContractRespond)(nil), // 13: Contract.UpdateContractRespond + (*UpdateContractTxRequest)(nil), // 14: Contract.UpdateContractTxRequest + (*UpdateContractTxRespond)(nil), // 15: Contract.UpdateContractTxRespond } -var file_api_contract_contract_proto_depIdxs = []int32{ - 4, // 0: Contract.ContractListRespond.Data:type_name -> Contract.ContractData - 4, // 1: Contract.ContractTxListRespond.Data:type_name -> Contract.ContractData - 0, // 2: Contract.Contract.FinishContract:input_type -> Contract.FinishContractRequest - 2, // 3: Contract.Contract.ContractList:input_type -> Contract.ContractListRequest - 9, // 4: Contract.Contract.GetContract:input_type -> Contract.GetContractRequest - 5, // 5: Contract.Contract.ContractTxList:input_type -> Contract.ContractTxListRequest - 7, // 6: Contract.Contract.SignContract:input_type -> Contract.SignContractRequest - 10, // 7: Contract.Contract.UpdateContract:input_type -> Contract.UpdateContractRequest - 12, // 8: Contract.Contract.UpdateContractTx:input_type -> Contract.UpdateContractTxRequest - 1, // 9: Contract.Contract.FinishContract:output_type -> Contract.FinishContractRespond - 3, // 10: Contract.Contract.ContractList:output_type -> Contract.ContractListRespond - 4, // 11: Contract.Contract.GetContract:output_type -> Contract.ContractData - 6, // 12: Contract.Contract.ContractTxList:output_type -> Contract.ContractTxListRespond - 8, // 13: Contract.Contract.SignContract:output_type -> Contract.SignContractRespond - 11, // 14: Contract.Contract.UpdateContract:output_type -> Contract.UpdateContractRespond - 13, // 15: Contract.Contract.UpdateContractTx:output_type -> Contract.UpdateContractTxRespond - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type +var file_contract_proto_depIdxs = []int32{ + 6, // 0: Contract.ContractListRespond.Data:type_name -> Contract.ContractData + 6, // 1: Contract.ContractTxListRespond.Data:type_name -> Contract.ContractData + 0, // 2: Contract.Contract.CreateContract:input_type -> Contract.CreateContractRequest + 2, // 3: Contract.Contract.FinishContract:input_type -> Contract.FinishContractRequest + 4, // 4: Contract.Contract.ContractList:input_type -> Contract.ContractListRequest + 11, // 5: Contract.Contract.GetContract:input_type -> Contract.GetContractRequest + 7, // 6: Contract.Contract.ContractTxList:input_type -> Contract.ContractTxListRequest + 9, // 7: Contract.Contract.SignContract:input_type -> Contract.SignContractRequest + 12, // 8: Contract.Contract.UpdateContract:input_type -> Contract.UpdateContractRequest + 14, // 9: Contract.Contract.UpdateContractTx:input_type -> Contract.UpdateContractTxRequest + 1, // 10: Contract.Contract.CreateContract:output_type -> Contract.CreateContractRespond + 3, // 11: Contract.Contract.FinishContract:output_type -> Contract.FinishContractRespond + 5, // 12: Contract.Contract.ContractList:output_type -> Contract.ContractListRespond + 6, // 13: Contract.Contract.GetContract:output_type -> Contract.ContractData + 8, // 14: Contract.Contract.ContractTxList:output_type -> Contract.ContractTxListRespond + 10, // 15: Contract.Contract.SignContract:output_type -> Contract.SignContractRespond + 13, // 16: Contract.Contract.UpdateContract:output_type -> Contract.UpdateContractRespond + 15, // 17: Contract.Contract.UpdateContractTx:output_type -> Contract.UpdateContractTxRespond + 10, // [10:18] is the sub-list for method output_type + 2, // [2:10] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } -func init() { file_api_contract_contract_proto_init() } -func file_api_contract_contract_proto_init() { - if File_api_contract_contract_proto != nil { +func init() { file_contract_proto_init() } +func file_contract_proto_init() { + if File_contract_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_api_contract_contract_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContractRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_contract_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContractRespond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_contract_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FinishContractRequest); i { case 0: return &v.state @@ -1198,7 +1350,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FinishContractRespond); i { case 0: return &v.state @@ -1210,7 +1362,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContractListRequest); i { case 0: return &v.state @@ -1222,7 +1374,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContractListRespond); i { case 0: return &v.state @@ -1234,7 +1386,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContractData); i { case 0: return &v.state @@ -1246,7 +1398,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContractTxListRequest); i { case 0: return &v.state @@ -1258,7 +1410,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContractTxListRespond); i { case 0: return &v.state @@ -1270,7 +1422,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignContractRequest); i { case 0: return &v.state @@ -1282,7 +1434,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignContractRespond); i { case 0: return &v.state @@ -1294,7 +1446,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetContractRequest); i { case 0: return &v.state @@ -1306,7 +1458,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContractRequest); i { case 0: return &v.state @@ -1318,7 +1470,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContractRespond); i { case 0: return &v.state @@ -1330,7 +1482,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContractTxRequest); i { case 0: return &v.state @@ -1342,7 +1494,7 @@ func file_api_contract_contract_proto_init() { return nil } } - file_api_contract_contract_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_contract_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContractTxRespond); i { case 0: return &v.state @@ -1359,18 +1511,18 @@ func file_api_contract_contract_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_contract_contract_proto_rawDesc, + RawDescriptor: file_contract_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_api_contract_contract_proto_goTypes, - DependencyIndexes: file_api_contract_contract_proto_depIdxs, - MessageInfos: file_api_contract_contract_proto_msgTypes, + GoTypes: file_contract_proto_goTypes, + DependencyIndexes: file_contract_proto_depIdxs, + MessageInfos: file_contract_proto_msgTypes, }.Build() - File_api_contract_contract_proto = out.File - file_api_contract_contract_proto_rawDesc = nil - file_api_contract_contract_proto_goTypes = nil - file_api_contract_contract_proto_depIdxs = nil + File_contract_proto = out.File + file_contract_proto_rawDesc = nil + file_contract_proto_goTypes = nil + file_contract_proto_depIdxs = nil } diff --git a/pb/contract/contract.proto b/pb/contract/contract.proto index 556a18f..65237d8 100644 --- a/pb/contract/contract.proto +++ b/pb/contract/contract.proto @@ -3,6 +3,8 @@ package Contract; option go_package = "./;contract"; //$ protoc --proto_path=. --go_out=./api/contract --go-triple_out=./api/contract ./api/contract/contract.proto service Contract { + + rpc CreateContract (CreateContractRequest) returns (CreateContractRespond) {} rpc FinishContract (FinishContractRequest) returns (FinishContractRespond) {} rpc ContractList (ContractListRequest) returns (ContractListRespond) {} rpc GetContract (GetContractRequest) returns (ContractData) {} @@ -12,7 +14,15 @@ service Contract { rpc UpdateContractTx(UpdateContractTxRequest) returns (UpdateContractTxRespond) {} } +message CreateContractRequest { + string ArtistUid = 1 [json_name="artist_uid"]; + repeated string ArtworkUid = 2 [json_name="artwork_uid"]; + int32 Type = 3 [json_name="type"]; +} +message CreateContractRespond{ + string Msg = 1 [json_name = "msg"]; +} message FinishContractRequest { string TransactionId = 1 [json_name="transactionId"]; diff --git a/pb/contract/contract.validator.pb.go b/pb/contract/contract.validator.pb.go new file mode 100644 index 0000000..775ef5e --- /dev/null +++ b/pb/contract/contract.validator.pb.go @@ -0,0 +1,79 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: contract.proto + +package contract + +import ( + fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (this *CreateContractRequest) Validate() error { + return nil +} +func (this *CreateContractRespond) Validate() error { + return nil +} +func (this *FinishContractRequest) Validate() error { + return nil +} +func (this *FinishContractRespond) Validate() error { + return nil +} +func (this *ContractListRequest) Validate() error { + return nil +} +func (this *ContractListRespond) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *ContractData) Validate() error { + return nil +} +func (this *ContractTxListRequest) Validate() error { + return nil +} +func (this *ContractTxListRespond) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *SignContractRequest) Validate() error { + return nil +} +func (this *SignContractRespond) Validate() error { + return nil +} +func (this *GetContractRequest) Validate() error { + return nil +} +func (this *UpdateContractRequest) Validate() error { + return nil +} +func (this *UpdateContractRespond) Validate() error { + return nil +} +func (this *UpdateContractTxRequest) Validate() error { + return nil +} +func (this *UpdateContractTxRespond) Validate() error { + return nil +} diff --git a/pb/contract/contract_triple.pb.go b/pb/contract/contract_triple.pb.go index cd742bd..948c21a 100644 --- a/pb/contract/contract_triple.pb.go +++ b/pb/contract/contract_triple.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-triple. DO NOT EDIT. // versions: -// - protoc-gen-go-triple v1.0.5 -// - protoc v3.9.0 -// source: api/contract/contract.proto +// - protoc-gen-go-triple v1.0.8 +// - protoc v3.21.8 +// source: contract.proto package contract @@ -28,6 +28,7 @@ const _ = grpc_go.SupportPackageIsVersion7 // // 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 ContractClient interface { + CreateContract(ctx context.Context, in *CreateContractRequest, opts ...grpc_go.CallOption) (*CreateContractRespond, common.ErrorWithAttachment) FinishContract(ctx context.Context, in *FinishContractRequest, opts ...grpc_go.CallOption) (*FinishContractRespond, common.ErrorWithAttachment) ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment) GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment) @@ -42,6 +43,7 @@ type contractClient struct { } type ContractClientImpl struct { + CreateContract func(ctx context.Context, in *CreateContractRequest) (*CreateContractRespond, error) FinishContract func(ctx context.Context, in *FinishContractRequest) (*FinishContractRespond, error) ContractList func(ctx context.Context, in *ContractListRequest) (*ContractListRespond, error) GetContract func(ctx context.Context, in *GetContractRequest) (*ContractData, error) @@ -63,6 +65,12 @@ func NewContractClient(cc *triple.TripleConn) ContractClient { return &contractClient{cc} } +func (c *contractClient) CreateContract(ctx context.Context, in *CreateContractRequest, opts ...grpc_go.CallOption) (*CreateContractRespond, common.ErrorWithAttachment) { + out := new(CreateContractRespond) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateContract", in, out) +} + func (c *contractClient) FinishContract(ctx context.Context, in *FinishContractRequest, opts ...grpc_go.CallOption) (*FinishContractRespond, common.ErrorWithAttachment) { out := new(FinishContractRespond) interfaceKey := ctx.Value(constant.InterfaceKey).(string) @@ -109,6 +117,7 @@ func (c *contractClient) UpdateContractTx(ctx context.Context, in *UpdateContrac // All implementations must embed UnimplementedContractServer // for forward compatibility type ContractServer interface { + CreateContract(context.Context, *CreateContractRequest) (*CreateContractRespond, error) FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error) ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error) GetContract(context.Context, *GetContractRequest) (*ContractData, error) @@ -124,6 +133,9 @@ type UnimplementedContractServer struct { proxyImpl protocol.Invoker } +func (UnimplementedContractServer) CreateContract(context.Context, *CreateContractRequest) (*CreateContractRespond, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateContract not implemented") +} func (UnimplementedContractServer) FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error) { return nil, status.Errorf(codes.Unimplemented, "method FinishContract not implemented") } @@ -173,6 +185,35 @@ func RegisterContractServer(s grpc_go.ServiceRegistrar, srv ContractServer) { s.RegisterService(&Contract_ServiceDesc, srv) } +func _Contract_CreateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateContractRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("CreateContract", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + func _Contract_FinishContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { in := new(FinishContractRequest) if err := dec(in); err != nil { @@ -383,6 +424,10 @@ var Contract_ServiceDesc = grpc_go.ServiceDesc{ ServiceName: "Contract.Contract", HandlerType: (*ContractServer)(nil), Methods: []grpc_go.MethodDesc{ + { + MethodName: "CreateContract", + Handler: _Contract_CreateContract_Handler, + }, { MethodName: "FinishContract", Handler: _Contract_FinishContract_Handler, @@ -413,5 +458,5 @@ var Contract_ServiceDesc = grpc_go.ServiceDesc{ }, }, Streams: []grpc_go.StreamDesc{}, - Metadata: "api/contract/contract.proto", + Metadata: "contract.proto", } diff --git a/pb/old/artwork/artwork.proto b/pb/old/artwork/artwork.proto index b640593..52758dd 100644 --- a/pb/old/artwork/artwork.proto +++ b/pb/old/artwork/artwork.proto @@ -22,7 +22,7 @@ message UpdateMsgRespond { } -} + message ListInterfaceRespond { int64 Total = 1 [json_name = "total"];