songchuang 代码提交
This commit is contained in:
parent
ee087e77f8
commit
4d45a4c4cc
@ -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"
|
||||
|
@ -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
|
||||
// }
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
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))
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
// 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
|
||||
// }
|
||||
|
||||
// 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
|
||||
// }
|
||||
|
||||
// todo
|
||||
// var realName model.RealName
|
||||
//if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil {
|
||||
// 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)
|
||||
// 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 {
|
||||
// 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)
|
||||
// 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
|
||||
// rep.Data = Data
|
||||
|
||||
return
|
||||
}
|
||||
// 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)
|
||||
// func ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
// rep = &contract.ContractTxListRespond{}
|
||||
// var Data []*contract.ContractData
|
||||
|
||||
return
|
||||
}
|
||||
// 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)
|
||||
// //}
|
||||
|
||||
// 更新交易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
|
||||
}
|
||||
// rep.Data = Data
|
||||
|
||||
// 更新交易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
|
||||
}
|
||||
// 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
|
||||
// }
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
|
||||
rep, err = dao.ContractList(req)
|
||||
//创建画家合同
|
||||
contract := &model.Contract{
|
||||
Uid: uid.String(),
|
||||
ArtistUid: req.ArtistUid,
|
||||
Type: 1,
|
||||
State: 1,
|
||||
}
|
||||
|
||||
if err = dao.CreateArtistContract(tx, contract); err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Contract) GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error) {
|
||||
|
||||
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)
|
||||
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
|
||||
}
|
||||
|
||||
func (a *Contract) UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) {
|
||||
rep = &contract.UpdateContractRespond{}
|
||||
err = dao.UpdateContract(req)
|
||||
|
||||
//创建画家画作合同,类型6
|
||||
if err = dao.CreateArtworkContract(tx, v, req.ArtistUid, 6); err != nil {
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Contract) UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) {
|
||||
rep = &contract.UpdateContractTxRespond{}
|
||||
err = dao.UpdateContractTx(req.TransactionId, int32(req.ID))
|
||||
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
case 3:
|
||||
|
||||
case 5:
|
||||
|
||||
default:
|
||||
err = errors.New("type值出错!")
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
return
|
||||
}
|
||||
|
||||
// func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||
// rep = &contract.FinishContractRespond{}
|
||||
|
||||
// tx := db.DB.Begin()
|
||||
// //更新合同状态并获取合同信息
|
||||
// contract, err := dao.FinishContract(tx, req.TransactionId)
|
||||
// if err != nil {
|
||||
// tx.Rollback()
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
// //查看画作是否已经状态改变,没有则改变 无用
|
||||
// if err = dao.UpdateArtworkState(tx, contract.ID); err != nil {
|
||||
// tx.Rollback()
|
||||
// return
|
||||
// }
|
||||
|
||||
// var tmp struct {
|
||||
// Uid int32 `json:"uid"`
|
||||
// }
|
||||
// tmp.Uid = contract.BatchId
|
||||
// tmpByte, _ := json.Marshal(&tmp)
|
||||
|
||||
// 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
|
||||
// }
|
||||
// }
|
||||
|
||||
// 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
|
||||
// }
|
||||
// }
|
||||
|
||||
// tx.Commit()
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
|
||||
// rep, err = dao.ContractList(req)
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (a *Contract) GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error) {
|
||||
|
||||
// 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
|
||||
// }
|
||||
|
@ -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 {
|
||||
|
2
go.mod
2
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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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"];
|
||||
|
79
pb/contract/contract.validator.pb.go
Normal file
79
pb/contract/contract.validator.pb.go
Normal file
@ -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
|
||||
}
|
@ -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",
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ message UpdateMsgRespond {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
message ListInterfaceRespond {
|
||||
int64 Total = 1 [json_name = "total"];
|
||||
|
Loading…
Reference in New Issue
Block a user