合同代码提交
This commit is contained in:
parent
e9802ee14e
commit
dec8716a93
@ -21,6 +21,30 @@ func (c *ContractProvider) CreateContract(ctx context.Context, req *contract.Cre
|
|||||||
return rep, nil
|
return rep, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ContractProvider) ContractListMgmt(ctx context.Context, req *contract.ContractListMgmtRequest) (rep *contract.ContractListMgmtRespond, err error) {
|
||||||
|
fmt.Println("第一处")
|
||||||
|
if rep, err = c.contractLogic.ContractListMgmt(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) SignContract(ctx context.Context, req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error) {
|
||||||
|
fmt.Println("第一处")
|
||||||
|
if rep, err = c.contractLogic.SignContract(req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return rep, nil
|
||||||
|
}
|
||||||
|
|
||||||
// func (c *ContractProvider) FinishContract(ctx context.Context, req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
// func (c *ContractProvider) FinishContract(ctx context.Context, req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||||
// fmt.Println("第一处")
|
// fmt.Println("第一处")
|
||||||
// if rep, err = c.contractLogic.FinishContract(req); err != nil {
|
// if rep, err = c.contractLogic.FinishContract(req); err != nil {
|
||||||
|
@ -1,30 +1,24 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
<<<<<<< HEAD
|
"strings"
|
||||||
=======
|
|
||||||
"github.com/fonchain/fonchain-artistinfo/cmd/model/old"
|
|
||||||
"time"
|
|
||||||
>>>>>>> xjjdev
|
|
||||||
|
|
||||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||||
|
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||||
|
"github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||||
|
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
func GetMgmtContractByArtistUid(artistUid string, contractType int32) (err error) {
|
func GetMgmtContractByArtistUid(artistUid string, contractType int32) (err error) {
|
||||||
var contract model.Contract
|
var contract model.Contract
|
||||||
if err = db.DB.Where("artist_uid = ? AND type = ?", artistUid, contractType).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound {
|
if err = db.DB.Where("artist_uid = ? AND type = ?", artistUid, contractType).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound {
|
||||||
=======
|
|
||||||
func FinishContract(id string) (err error) {
|
|
||||||
var contracts old.Contract
|
|
||||||
if err = db.DB.Where("transaction_id = ?", id).First(&contracts).Error; err != nil {
|
|
||||||
>>>>>>> xjjdev
|
|
||||||
zap.L().Error("get contract info err", zap.Error(err))
|
zap.L().Error("get contract info err", zap.Error(err))
|
||||||
err = errors.New(m.ERROR_SELECT)
|
err = errors.New(m.ERROR_SELECT)
|
||||||
return
|
return
|
||||||
@ -39,150 +33,44 @@ func CreateArtistContract(tx *gorm.DB, contract *model.Contract) (err error) {
|
|||||||
err = errors.New(m.CREATE_ERROR)
|
err = errors.New(m.CREATE_ERROR)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMgmtContractByArtworkUid(artworkUid string, artworkType int32) (err error) {
|
func GetMgmtContractByArtworkUid(artworkUid string, artworkType int32) (err error) {
|
||||||
//画作有合同类型是2,6的都是 点击过"著作权代理转让服务合同"的
|
//画作有合同类型是2,6的都是 点击过"著作权代理转让服务合同"的
|
||||||
var contract model.Contract
|
var contract model.Contract
|
||||||
if err = db.DB.Where("artwork_uid = ? AND type = ?", artworkUid, 2).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound {
|
|
||||||
=======
|
|
||||||
|
|
||||||
// todo
|
if err = db.DB.Where("artwork_uid LiKE ? AND type = ?", "%"+artworkUid+"%", artworkType).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound {
|
||||||
//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 []old.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 old.Contract
|
|
||||||
if err = db.DB.Where("id = ? ", id).First(&con).Error; err != nil {
|
|
||||||
>>>>>>> xjjdev
|
|
||||||
zap.L().Error("get contract info err", zap.Error(err))
|
zap.L().Error("get contract info err", zap.Error(err))
|
||||||
err = errors.New(m.ERROR_SELECT)
|
err = errors.New(m.ERROR_SELECT)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//err 为空则查询到,返回画作合同已存在的错误
|
||||||
|
if err == nil {
|
||||||
|
err = errors.New(m.ARTWORK_CONTRACT_EXISTS)
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateArtworkContract(tx *gorm.DB, artworkUid string, artistUid string, contractType int32) (err error) {
|
func CreateArtworkContract(tx *gorm.DB, artworkUid []string, artistUid string, contractType int32, latestLockTime string) (err error) {
|
||||||
var uid uuid.UUID
|
var uid uuid.UUID
|
||||||
if uid, err = uuid.NewV4(); err != nil {
|
if uid, err = uuid.NewV4(); err != nil {
|
||||||
err = errors.New(m.ERROR_UID)
|
err = errors.New(m.ERROR_UID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//将画作切片转换成字符串格式便于保存
|
||||||
|
ArtworkUid := strings.Join(artworkUid, ",")
|
||||||
contract := &model.Contract{
|
contract := &model.Contract{
|
||||||
Uid: uid.String(),
|
Uid: uid.String(),
|
||||||
ArtistUid: artistUid,
|
ArtistUid: artistUid,
|
||||||
ArtworkUid: artworkUid,
|
ArtworkUid: ArtworkUid,
|
||||||
Type: contractType,
|
Type: contractType,
|
||||||
State: 1,
|
State: 1,
|
||||||
|
Status: 2,
|
||||||
|
LockTime: latestLockTime,
|
||||||
}
|
}
|
||||||
if err = tx.Create(contract).Error; err != nil {
|
if err = tx.Create(contract).Error; err != nil {
|
||||||
zap.L().Error("create contract err", zap.Error(err))
|
zap.L().Error("create contract err", zap.Error(err))
|
||||||
@ -193,7 +81,127 @@ func CreateArtworkContract(tx *gorm.DB, artworkUid string, artistUid string, con
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
func GetArtistNoByUid(artistUid string) (err error) {
|
||||||
|
var user model.User
|
||||||
|
if err = db.DB.Where("mgmt_artist_uid = ?", artistUid).First(&user).Error; err != nil {
|
||||||
|
zap.L().Error("get user info err", zap.Error(err))
|
||||||
|
err = errors.New(m.ERROR_SELECT)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetContractList(artistUid string, pageSize, offset int32) (contracts []*contract.Contracts, err error) {
|
||||||
|
|
||||||
|
var contractSlice []model.Contract
|
||||||
|
if err = db.DB.Where("artist_uid = ?", artistUid).Order("ID asc").Limit(int(pageSize)).Offset(int(offset)).Find(&contractSlice).Error; err != nil {
|
||||||
|
zap.L().Error("create contracts info err", zap.Error(err))
|
||||||
|
err = errors.New(m.CREATE_ERROR)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range contractSlice {
|
||||||
|
contcontract := &contract.Contracts{
|
||||||
|
ContractUid: v.Uid,
|
||||||
|
ArtistUid: v.ArtistUid,
|
||||||
|
ArtworkUid: v.ArtworkUid,
|
||||||
|
ContractId: v.ContractId,
|
||||||
|
TransactionId: v.TransactionId,
|
||||||
|
Type: v.Type,
|
||||||
|
ViewUrl: v.ViewUrl,
|
||||||
|
DownloadUrl: v.DownloadUrl,
|
||||||
|
State: v.State,
|
||||||
|
Status: int32(v.Status),
|
||||||
|
LockTime: v.LockTime,
|
||||||
|
}
|
||||||
|
|
||||||
|
contracts = append(contracts, contcontract)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetArtistInfoById(id int32) (user model.User, err error) {
|
||||||
|
if err = db.DB.Where("mgmt_artist_id = ?", id).First(&user).Error; err != nil {
|
||||||
|
zap.L().Error("get user info err", zap.Error(err))
|
||||||
|
err = errors.New(m.ERROR_SELECT)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func ContractList(artist_uid string, state int32) (ContractData []*contract.Contracts, err error) {
|
||||||
|
|
||||||
|
if state != 0 {
|
||||||
|
if state == 2 {
|
||||||
|
state = 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var contracts []model.Contract
|
||||||
|
if err = db.DB.Where("artist_uid = ? AND type != 4 AND state = ?", artist_uid, state).Find(&contracts).Error; err != nil {
|
||||||
|
zap.L().Error("get contracts info err", zap.Error(err))
|
||||||
|
err = errors.New(m.ERROR_SELECT)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range contracts {
|
||||||
|
|
||||||
|
Contract := &contract.Contracts{
|
||||||
|
ContractUid: v.Uid,
|
||||||
|
ArtistUid: v.ArtistUid,
|
||||||
|
ArtworkUid: v.ArtworkUid,
|
||||||
|
ContractId: v.ContractId,
|
||||||
|
TransactionId: v.TransactionId,
|
||||||
|
Type: v.Type,
|
||||||
|
ViewUrl: v.ViewUrl,
|
||||||
|
DownloadUrl: v.DownloadUrl,
|
||||||
|
State: v.State,
|
||||||
|
Status: int32(v.Status),
|
||||||
|
LockTime: v.LockTime,
|
||||||
|
SignTime: v.SignTime,
|
||||||
|
}
|
||||||
|
|
||||||
|
ContractData = append(ContractData, Contract)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetContractInfo(ContractId int32) (contractInfo model.Contract, err error) {
|
||||||
|
if err = db.DB.Where("id = ?", ContractId).First(&contractInfo).Error; err != nil {
|
||||||
|
zap.L().Error("get contract info err", zap.Error(err))
|
||||||
|
err = errors.New(m.ERROR_SELECT)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func UpdateContract(tx *gorm.DB, artistUid, ViewPdfUrl, DownloadUrl, ContractNo string) (err error) {
|
||||||
|
if err = tx.Model(&model.Contract{}).Where("artist_uid = ?", artistUid).Updates(model.Contract{ViewUrl: ViewPdfUrl, DownloadUrl: DownloadUrl, ContractId: ContractNo}).Error; err != nil {
|
||||||
|
zap.L().Error("update contract info err", zap.Error(err))
|
||||||
|
err = errors.New(m.UPDATE_FAILED)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据画作uid获取画作信息
|
||||||
|
func GetArtworkProfileByArtworkUid(artworkUid string) (artworkProfileInfo *artwork.ArtworkDetailResponse, err error) {
|
||||||
|
artworkProfileInfo = &artwork.ArtworkDetailResponse{}
|
||||||
|
|
||||||
|
artworkDetailRequest := &artwork.ArtworkDetailRequest{
|
||||||
|
ArtworkUuid: artworkUid,
|
||||||
|
Type: "1",
|
||||||
|
}
|
||||||
|
artworkDetailResponse, err := service.ArtworkImpl.ArtworkDetail(context.Background(), artworkDetailRequest)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return artworkDetailResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
// func FinishContract(tx *gorm.DB, id string) (contract model.Contract, err error) {
|
// func FinishContract(tx *gorm.DB, id string) (contract model.Contract, err error) {
|
||||||
// if err = tx.Where("transaction_id = ?", id).First(&contract).Error; err != nil {
|
// if err = tx.Where("transaction_id = ?", id).First(&contract).Error; err != nil {
|
||||||
// zap.L().Error("get contract info err", zap.Error(err))
|
// zap.L().Error("get contract info err", zap.Error(err))
|
||||||
@ -403,27 +411,3 @@ func CreateArtworkContract(tx *gorm.DB, artworkUid string, artistUid string, con
|
|||||||
// }
|
// }
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
=======
|
|
||||||
// 更新交易id
|
|
||||||
func UpdateContract(req *contract.UpdateContractRequest) error {
|
|
||||||
//数据库操作异常
|
|
||||||
var con old.Contract
|
|
||||||
if err := db.DB.Model(&con).Updates(&old.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 old.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
|
|
||||||
}
|
|
||||||
>>>>>>> xjjdev
|
|
||||||
|
@ -2,28 +2,37 @@ package logic
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
||||||
|
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pb/contract"
|
"github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||||
|
contractMicroservice "github.com/fonchain/fonchain-artistinfo/pb/contract_microservice"
|
||||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IContract interface {
|
type IContract interface {
|
||||||
CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error)
|
CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error)
|
||||||
FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error)
|
ContractListMgmt(req *contract.ContractListMgmtRequest) (rep *contract.ContractListMgmtRespond, err error)
|
||||||
ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error)
|
ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error)
|
||||||
ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error)
|
SignContract(req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error)
|
||||||
UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error)
|
|
||||||
UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error)
|
// FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error)
|
||||||
GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error)
|
// ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error)
|
||||||
|
// ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error)
|
||||||
|
// UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error)
|
||||||
|
// UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error)
|
||||||
|
// GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewContract() IContract {
|
func NewContract() IContract {
|
||||||
@ -35,15 +44,22 @@ type Contract struct {
|
|||||||
|
|
||||||
func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) {
|
func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) {
|
||||||
rep = &contract.CreateContractRespond{}
|
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()
|
tx := db.DB.Begin()
|
||||||
|
|
||||||
|
userInfo, err := NewArtistInfo().FindUser(&artistInfoUser.FindUserRequest{
|
||||||
|
MgmtArtistUid: req.ArtistUid,
|
||||||
|
IsArtist: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if userInfo.Id == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch req.Type {
|
switch req.Type {
|
||||||
//1 画家合同(不涉及画家的画作)
|
//1 画家合同(不涉及画家的画作)
|
||||||
case 1:
|
case 1:
|
||||||
@ -62,6 +78,8 @@ func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *con
|
|||||||
ArtistUid: req.ArtistUid,
|
ArtistUid: req.ArtistUid,
|
||||||
Type: 1,
|
Type: 1,
|
||||||
State: 1,
|
State: 1,
|
||||||
|
Status: 2,
|
||||||
|
LockTime: userInfo.LatestLockTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = dao.CreateArtistContract(tx, contract); err != nil {
|
if err = dao.CreateArtistContract(tx, contract); err != nil {
|
||||||
@ -75,31 +93,57 @@ func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *con
|
|||||||
for _, v := range req.ArtworkUid {
|
for _, v := range req.ArtworkUid {
|
||||||
//查看画作合同是否已经存在,不存在继续,类型2、6
|
//查看画作合同是否已经存在,不存在继续,类型2、6
|
||||||
if err = dao.GetMgmtContractByArtworkUid(v, 2); err == gorm.ErrRecordNotFound {
|
if err = dao.GetMgmtContractByArtworkUid(v, 2); err == gorm.ErrRecordNotFound {
|
||||||
if err = dao.GetMgmtContractByArtworkUid(v, 6); err == gorm.ErrRecordNotFound {
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//创建画家画作合同,类型2
|
if err = dao.GetMgmtContractByArtworkUid(v, 6); err == gorm.ErrRecordNotFound {
|
||||||
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 {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//创建画家画作合同,类型2,如果批次选择多个画作的话,那么多个画在一个合同中
|
||||||
|
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 2, userInfo.LatestLockTime); err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//创建画家画作合同,类型6
|
||||||
|
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 6, userInfo.LatestLockTime); err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
for _, v := range req.ArtworkUid {
|
||||||
|
//查看画作合同是否已经存在,不存在继续,类型3
|
||||||
|
if err = dao.GetMgmtContractByArtworkUid(v, 3); err == gorm.ErrRecordNotFound {
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//创建画家画作合同,类型3
|
||||||
|
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 3, userInfo.LatestLockTime); err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
|
for _, v := range req.ArtworkUid {
|
||||||
|
//查看画作合同是否已经存在,不存在继续,类型5
|
||||||
|
if err = dao.GetMgmtContractByArtworkUid(v, 5); err == gorm.ErrRecordNotFound {
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//创建画家画作合同,类型3
|
||||||
|
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 5, userInfo.LatestLockTime); err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
err = errors.New("type值出错!")
|
err = errors.New("type值出错!")
|
||||||
@ -111,6 +155,461 @@ func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *con
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *Contract) ContractListMgmt(req *contract.ContractListMgmtRequest) (rep *contract.ContractListMgmtRespond, err error) {
|
||||||
|
rep = &contract.ContractListMgmtRespond{}
|
||||||
|
//查看是否有该画家
|
||||||
|
if err = dao.GetArtistNoByUid(req.ArtistUid); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//合同分页查询操作
|
||||||
|
if req.Page < 1 {
|
||||||
|
req.Page = 1
|
||||||
|
}
|
||||||
|
if req.Num < 1 {
|
||||||
|
req.Num = 15
|
||||||
|
}
|
||||||
|
offset := (req.Page - 1) * req.Num
|
||||||
|
|
||||||
|
//获取该用户的所有合同
|
||||||
|
contracts, err := dao.GetContractList(req.ArtistUid, req.Num, offset)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rep.Data = contracts
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||||
|
|
||||||
|
//查看是否有该画家
|
||||||
|
user, err := dao.GetArtistInfoById(req.ID)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ContractData, err := dao.ContractList(user.MgmtArtistUid, req.State)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rep = &contract.ContractListRespond{
|
||||||
|
Data: ContractData,
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *Contract) SignContract(req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error) {
|
||||||
|
rep = &contract.SignContractRespond{}
|
||||||
|
|
||||||
|
//遇到错误数据库回滚
|
||||||
|
tx := db.DB.Begin()
|
||||||
|
|
||||||
|
//根据合同id获取具体合同信息
|
||||||
|
contractInfo, err := dao.GetContractInfo(req.ContractId)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
artistInfo, err := dao.GetArtistInfoById(req.ID)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
detailRequest := &artist.DetailRequest{
|
||||||
|
Uid: artistInfo.MgmtArtistUid,
|
||||||
|
}
|
||||||
|
artistDetailResponse, err := service.GrpcArtistImpl.ArtistDetail(context.Background(), detailRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if contractInfo.Type != 4 && contractInfo.Type != 7 {
|
||||||
|
|
||||||
|
switch contractInfo.Type {
|
||||||
|
case 1:
|
||||||
|
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||||
|
endTime := time.Now().AddDate(1, 0, -1)
|
||||||
|
parameterMap := make((map[string]string), 0)
|
||||||
|
|
||||||
|
// 一、 模板填充
|
||||||
|
parameterMap["PartyAName"] = artistDetailResponse.ProfileInfo.Name
|
||||||
|
parameterMap["PartyAAddress"] = artistDetailResponse.ProfileInfo.Address
|
||||||
|
parameterMap["PartyAIdentityCard"] = artistDetailResponse.ProfileInfo.CardId
|
||||||
|
parameterMap["PartyATelNum"] = artistDetailResponse.ProfileInfo.Phone
|
||||||
|
parameterMap["PartyBRule"] = "240"
|
||||||
|
parameterMap["SettleNum"] = "2"
|
||||||
|
parameterMap["SettleSec"] = "100"
|
||||||
|
parameterMap["ActivityNum"] = "2"
|
||||||
|
parameterMap["SettlerTypeFour"] = "2"
|
||||||
|
parameterMap["PowerDay"] = "5"
|
||||||
|
parameterMap["EffectStartYear"] = fmt.Sprintf("%d", time.Now().Year())
|
||||||
|
parameterMap["EffectStartMonth"] = fmt.Sprintf("%d", time.Now().Month())
|
||||||
|
parameterMap["EffectStartDay"] = fmt.Sprintf("%d", time.Now().Day())
|
||||||
|
parameterMap["EffectEndYear"] = fmt.Sprintf("%d", endTime.Year())
|
||||||
|
parameterMap["EffectEndMonth"] = fmt.Sprintf("%d", endTime.Month())
|
||||||
|
parameterMap["EffectEndDay"] = fmt.Sprintf("%d", endTime.Day())
|
||||||
|
parameterMap["PartyBLegal"] = "胡婷"
|
||||||
|
|
||||||
|
//将map转换为string类型
|
||||||
|
parameterMapType, err := json.Marshal(parameterMap)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||||
|
TemplateId: "一手画市场18",
|
||||||
|
ContractId: ContractNo,
|
||||||
|
ParameterMap: string(parameterMapType),
|
||||||
|
}
|
||||||
|
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//二、 自动签署
|
||||||
|
extSignAutoRequest := &contractMicroservice.ExtSignAutoRequest{
|
||||||
|
TransactionId: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||||
|
ContractId: ContractNo,
|
||||||
|
CustomerId: "1A958BFD01E6551D06381DA6C0B19259",
|
||||||
|
DocTitle: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||||
|
SignKeyword: "受托方(乙方)",
|
||||||
|
SignatureId: "1668589742383450",
|
||||||
|
KeyX: "120",
|
||||||
|
KeyY: "0",
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新合同表,将合同的下载、在线、id保存
|
||||||
|
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
|
||||||
|
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||||
|
var parameterMap = make(map[string]string)
|
||||||
|
endTime := time.Now().AddDate(1, 0, -1)
|
||||||
|
parameterMap["ContractNo"] = ContractNo
|
||||||
|
parameterMap["PartyAName"] = artistDetailResponse.ProfileInfo.Name
|
||||||
|
parameterMap["PartyAAddress"] = artistDetailResponse.ProfileInfo.Address
|
||||||
|
parameterMap["PartyAIdentityCard"] = artistDetailResponse.ProfileInfo.CardId
|
||||||
|
parameterMap["PartyATelNum"] = artistDetailResponse.ProfileInfo.Phone
|
||||||
|
parameterMap["SettleNum"] = "2"
|
||||||
|
parameterMap["SettleSecOne"] = "0"
|
||||||
|
parameterMap["SettleSecTwo"] = "100"
|
||||||
|
parameterMap["ActivityNum"] = "2"
|
||||||
|
parameterMap["SettlerTypeFour"] = "2"
|
||||||
|
parameterMap["PowerDay"] = "5"
|
||||||
|
parameterMap["EffectStartYear"] = fmt.Sprintf("%d", time.Now().Year())
|
||||||
|
parameterMap["EffectStartMonth"] = fmt.Sprintf("%d", time.Now().Month())
|
||||||
|
parameterMap["EffectStartDay"] = fmt.Sprintf("%d", time.Now().Day())
|
||||||
|
parameterMap["EffectEndYear"] = fmt.Sprintf("%d", endTime.Year())
|
||||||
|
parameterMap["EffectEndMonth"] = fmt.Sprintf("%d", endTime.Month())
|
||||||
|
parameterMap["EffectEndDay"] = fmt.Sprintf("%d", endTime.Day())
|
||||||
|
parameterMap["PartyBLegal"] = "邬侨华"
|
||||||
|
|
||||||
|
//将map转换为string类型
|
||||||
|
parameterMapType, err := json.Marshal(parameterMap)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||||
|
TemplateId: "著作权代理转让服务合同20",
|
||||||
|
ContractId: ContractNo,
|
||||||
|
ParameterMap: string(parameterMapType),
|
||||||
|
}
|
||||||
|
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//二、 自动签署
|
||||||
|
extSignAutoRequest := &contractMicroservice.ExtSignAutoRequest{
|
||||||
|
TransactionId: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||||
|
ContractId: ContractNo,
|
||||||
|
CustomerId: "F49C748A0C06431BC620354F4491BD37",
|
||||||
|
DocTitle: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||||
|
SignKeyword: "受托方(乙方)",
|
||||||
|
SignatureId: "1668589763366246",
|
||||||
|
KeyX: "120",
|
||||||
|
KeyY: "0",
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新合同表,将合同的下载、在线、id保存
|
||||||
|
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||||
|
|
||||||
|
//获取画作信息
|
||||||
|
artworkDetailResponse, err := dao.GetArtworkProfileByArtworkUid(contractInfo.ArtworkUid)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var parameterMap = make(map[string]string)
|
||||||
|
parameterMap["PartyAName"] = artistDetailResponse.ProfileInfo.Name
|
||||||
|
parameterMap["PartyAIdCard"] = artistDetailResponse.ProfileInfo.CardId
|
||||||
|
parameterMap["ArtworkName"] = artworkDetailResponse.ProfileInfo.ArtworkName
|
||||||
|
parameterMap["Year"] = fmt.Sprintf("%d", time.Now().Year())
|
||||||
|
parameterMap["Month"] = fmt.Sprintf("%d", time.Now().Month())
|
||||||
|
parameterMap["Day"] = fmt.Sprintf("%d", time.Now().Day())
|
||||||
|
|
||||||
|
//将map转换为string类型
|
||||||
|
parameterMapType, err := json.Marshal(parameterMap)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||||
|
TemplateId: "登记授权委托书18",
|
||||||
|
ContractId: ContractNo,
|
||||||
|
ParameterMap: string(parameterMapType),
|
||||||
|
}
|
||||||
|
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新合同表,将合同的下载、在线、id保存
|
||||||
|
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
|
||||||
|
//获取画作信息
|
||||||
|
artworkDetailResponse, err := dao.GetArtworkProfileByArtworkUid(contractInfo.ArtworkUid)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||||
|
|
||||||
|
var parameterMap = make(map[string]string)
|
||||||
|
parameterMap["ArtworkName"] = artworkDetailResponse.ProfileInfo.ArtworkName
|
||||||
|
parameterMap["Year"] = fmt.Sprintf("%d", time.Now().Year())
|
||||||
|
parameterMap["Month"] = fmt.Sprintf("%d", time.Now().Month())
|
||||||
|
parameterMap["Day"] = fmt.Sprintf("%d", time.Now().Day())
|
||||||
|
|
||||||
|
//将map转换为string类型
|
||||||
|
parameterMapType, err := json.Marshal(parameterMap)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||||
|
TemplateId: "作品登记承诺书16",
|
||||||
|
ContractId: ContractNo,
|
||||||
|
ParameterMap: string(parameterMapType),
|
||||||
|
}
|
||||||
|
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新合同表,将合同的下载、在线、id保存
|
||||||
|
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
ArtistUids := strings.Split(contractInfo.ArtistUid, ",")
|
||||||
|
|
||||||
|
type dynamic struct {
|
||||||
|
InsertWay int `json:"insertWay"`
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
CellHeight float64 `json:"cellHeight"`
|
||||||
|
ColWidthPercent []int `json:"colWidthPercent"`
|
||||||
|
TheFirstHeader string `json:"theFirstHeader"`
|
||||||
|
CellHorizontalAlignment int `json:"cellHorizontalAlignment"`
|
||||||
|
CellVerticalAlignment int `json:"cellVerticalAlignment"`
|
||||||
|
Headers []string `json:"headers"`
|
||||||
|
Datas [][]string `json:"datas"`
|
||||||
|
}
|
||||||
|
var dynamicList []dynamic
|
||||||
|
var dynamicOne dynamic
|
||||||
|
|
||||||
|
dynamicOne.InsertWay = 1
|
||||||
|
dynamicOne.Keyword = "附表 1"
|
||||||
|
dynamicOne.CellHeight = 16.0
|
||||||
|
dynamicOne.ColWidthPercent = []int{6, 6, 20, 10, 10}
|
||||||
|
// dynamicOne.TheFirstHeader =
|
||||||
|
dynamicOne.CellHorizontalAlignment = 1
|
||||||
|
dynamicOne.CellVerticalAlignment = 5
|
||||||
|
dynamicOne.Headers = []string{"序号", "作品名称", "哈希值", "著作权取得方式(原始/继受)", "继受取得的证明文件"}
|
||||||
|
|
||||||
|
for k, v := range ArtistUids {
|
||||||
|
//获取画作信息
|
||||||
|
artworkDetailResponse, err := dao.GetArtworkProfileByArtworkUid(v)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var tmps []string
|
||||||
|
tmps = append(tmps, fmt.Sprintf("%d", k+1))
|
||||||
|
tmps = append(tmps, artworkDetailResponse.ProfileInfo.ArtistName) //获取画作名字
|
||||||
|
tmps = append(tmps, artworkDetailResponse.DigiInfo.CopyrightHash) //获取版权hash
|
||||||
|
tmps = append(tmps, "原始")
|
||||||
|
tmps = append(tmps, "")
|
||||||
|
dynamicOne.Datas = append(dynamicOne.Datas, tmps)
|
||||||
|
}
|
||||||
|
|
||||||
|
dynamicList = append(dynamicList, dynamicOne)
|
||||||
|
|
||||||
|
dyByte, err := json.Marshal(dynamicList)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ContractNo := fmt.Sprintf("TF_%d", time.Now().UnixNano()+1000)
|
||||||
|
|
||||||
|
//一、 模板填充
|
||||||
|
var parameterMap = make(map[string]string)
|
||||||
|
parameterMap["PartyBLegal"] = artistDetailResponse.ProfileInfo.Name
|
||||||
|
|
||||||
|
//将map转换为string类型
|
||||||
|
parameterMapType, err := json.Marshal(parameterMap)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var viewPdfUrl string
|
||||||
|
var downloadUrl string
|
||||||
|
|
||||||
|
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||||
|
ContractId: ContractNo,
|
||||||
|
ParameterMap: string(parameterMapType),
|
||||||
|
DynamicTables: string(dyByte),
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(ArtistUids) > 30 {
|
||||||
|
|
||||||
|
return rep, errors.New("选择画作条数过多")
|
||||||
|
|
||||||
|
} else if len(ArtistUids) <= 15 {
|
||||||
|
generateContractRequest.TemplateId = "著作权代理转让服务合同——附表152"
|
||||||
|
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
viewPdfUrl = generateContractResponse.ViewPdfUrl
|
||||||
|
downloadUrl = generateContractResponse.DownloadUrl
|
||||||
|
|
||||||
|
} else {
|
||||||
|
generateContractRequest.TemplateId = "著作权代理转让服务合同——附表302"
|
||||||
|
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
viewPdfUrl = generateContractResponse.ViewPdfUrl
|
||||||
|
downloadUrl = generateContractResponse.DownloadUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
//二、 自动签署
|
||||||
|
extSignAutoRequest := &contractMicroservice.ExtSignAutoRequest{
|
||||||
|
TransactionId: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()+1000),
|
||||||
|
ContractId: ContractNo,
|
||||||
|
CustomerId: "F49C748A0C06431BC620354F4491BD37",
|
||||||
|
DocTitle: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||||
|
SignKeyword: "受托方(乙方)",
|
||||||
|
SignatureId: "1668589763366246",
|
||||||
|
KeyX: "120",
|
||||||
|
KeyY: "0",
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新合同表,将合同的下载、在线、id保存
|
||||||
|
err = dao.UpdateContract(tx, contractInfo.Uid, viewPdfUrl, downloadUrl, ContractNo)
|
||||||
|
if err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return rep, errors.New("type出错")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//上面数据库没有错误就执行,上面修改的值下面会使用到
|
||||||
|
tx.Commit()
|
||||||
|
|
||||||
|
transactionId := fmt.Sprintf("TFTX_%d", time.Now().UnixNano())
|
||||||
|
|
||||||
|
var signKeyword string
|
||||||
|
|
||||||
|
//从新根据合同id获取具体合同信息
|
||||||
|
contractInfo, err = dao.GetContractInfo(req.ContractId)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if contractInfo.Type == 1 || contractInfo.Type == 2 || contractInfo.Type == 6 {
|
||||||
|
|
||||||
|
signKeyword = "委托方(甲方)"
|
||||||
|
}
|
||||||
|
if contractInfo.Type == 3 {
|
||||||
|
signKeyword = "委托人签字:"
|
||||||
|
}
|
||||||
|
if contractInfo.Type == 4 {
|
||||||
|
signKeyword = "画家签字:"
|
||||||
|
}
|
||||||
|
if contractInfo.Type == 5 {
|
||||||
|
signKeyword = "申请人(签章):"
|
||||||
|
}
|
||||||
|
signShowTime := "1"
|
||||||
|
if contractInfo.Type == 5 || contractInfo.Type == 3 || contractInfo.Type == 6 {
|
||||||
|
signShowTime = "2"
|
||||||
|
}
|
||||||
|
// 手动签署
|
||||||
|
extSignRequest := &contractMicroservice.ExtSignRequest{
|
||||||
|
TransactionId: transactionId,
|
||||||
|
ContractId: contractInfo.ContractId,
|
||||||
|
CustomerId: "",
|
||||||
|
ReturnUrl: "",
|
||||||
|
DocTitle: "",
|
||||||
|
OpenEnvironment: "",
|
||||||
|
MobileSignType: "",
|
||||||
|
SignKeyword: "",
|
||||||
|
Keyx: "",
|
||||||
|
Keyy: "",
|
||||||
|
SignatureShowTime: "",
|
||||||
|
PcHandSignature: "",
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = service.ContractImpl.ExtSign(context.Background(), extSignRequest)
|
||||||
|
if err != nil {
|
||||||
|
return rep, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
// func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||||
// rep = &contract.FinishContractRespond{}
|
// rep = &contract.FinishContractRespond{}
|
||||||
|
|
||||||
|
23
cmd/model/contract.go
Normal file
23
cmd/model/contract.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import "gorm.io/plugin/soft_delete"
|
||||||
|
|
||||||
|
// Contract 用户模型
|
||||||
|
type Contract struct {
|
||||||
|
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"`
|
||||||
|
Status int64 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示
|
||||||
|
LockTime string `gorm:"column:lock_time;comment:锁定时间" json:"lockTime"`
|
||||||
|
SignTime string `gorm:"column:sign_time;comment:签署时间" json:"sign_time"`
|
||||||
|
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
|
||||||
|
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
|
||||||
|
DeletedAt soft_delete.DeletedAt
|
||||||
|
}
|
@ -1,12 +1,9 @@
|
|||||||
package old
|
package old
|
||||||
|
|
||||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
|
||||||
|
|
||||||
import "gorm.io/plugin/soft_delete"
|
import "gorm.io/plugin/soft_delete"
|
||||||
|
|
||||||
// Contract 用户模型
|
// Contract 用户模型
|
||||||
type Contract struct {
|
type Contract struct {
|
||||||
<<<<<<< HEAD:cmd/model/contract.go
|
|
||||||
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
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"`
|
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"`
|
ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"`
|
||||||
@ -20,99 +17,4 @@ type Contract struct {
|
|||||||
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
|
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
|
||||||
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
|
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
|
||||||
DeletedAt soft_delete.DeletedAt
|
DeletedAt soft_delete.DeletedAt
|
||||||
=======
|
|
||||||
model.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"`
|
|
||||||
>>>>>>> xjjdev:cmd/model/old/contract.go
|
|
||||||
}
|
|
||||||
|
|
||||||
type Reply struct {
|
|
||||||
Code int `json:"state"`
|
|
||||||
Message string `json:"message"`
|
|
||||||
Data interface{} `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ArtistInfoRes struct {
|
|
||||||
Uid string `json:"uid"`
|
|
||||||
Seqnum int64 `json:"seqnum"` // 序列号
|
|
||||||
Tnum string `json:"tnum"` //ex.T240
|
|
||||||
Num int `json:"num"` // 编号
|
|
||||||
Name string `json:"name"`
|
|
||||||
CardId string `json:"cardId"`
|
|
||||||
PhoneNum string `json:"phone"`
|
|
||||||
Gender string `json:"gender"` // 性别
|
|
||||||
Belong int `json:"belong"` // 画家归属,1-泰丰,2-丰链
|
|
||||||
RecentPhoto string `json:"recentPhoto"` // 画家近照url
|
|
||||||
AccountBank string `json:"bank"` // 开户银行
|
|
||||||
Account string `json:"account"` // 开户账号
|
|
||||||
Video []string `json:"artistVideo"` // 视频资料
|
|
||||||
ArtshowTimes int64 `json:"artshowTimes"` // 参加画展次数
|
|
||||||
Age int64 `json:"age"`
|
|
||||||
Address string `json:"address"`
|
|
||||||
Resume string `json:"resume"`
|
|
||||||
CardPicFace string `json:"cardPicFace"`
|
|
||||||
CardPicBack string `json:"cardPicBack"`
|
|
||||||
CertificatePic string `json:"certificatePic"`
|
|
||||||
CertificateNum string `json:"certificateNum"`
|
|
||||||
// Priority int64 `json:"priority"`
|
|
||||||
Agent string `json:"agent"`
|
|
||||||
PenName string `json:"penName"` // 笔名
|
|
||||||
Comment string `json:"comment"`
|
|
||||||
WtchainHash string `json:"wtchainHash"`
|
|
||||||
BaiduchainHash string `json:"baiduchanHash"`
|
|
||||||
ChengchainHash string `json:"chengchainHash"`
|
|
||||||
ChengChainCertUrl string `json:"chengChainCertUrl"`
|
|
||||||
BaiduChainCertUrl string `json:"baiduChainCertUrl"`
|
|
||||||
ChengChainCertOssUrl string `json:"chengChainCertOssUrl"`
|
|
||||||
Baiduchaincertossurl string `json:"baiduchaincertossurl"`
|
|
||||||
IsArtshow bool `json:"isArtshow"` // 是否参加过画展,1参加过,2未参加过
|
|
||||||
CurrentPosition string `json:"currentPosition"` //现任职务
|
|
||||||
Email string `json:"email"`
|
|
||||||
TeaRela string `json:"teaRela"` //师
|
|
||||||
StuRela string `json:"stuRela"` //徒
|
|
||||||
GradSchoolStudyTour string `json:"gradSchoolStudyTour"` //毕业院校及游学经历
|
|
||||||
NaTittle string `json:"naTittle"` //国家级头衔
|
|
||||||
ProTittle string `json:"proTittle"` //省级头衔
|
|
||||||
MunTittle string `json:"munTittle"` //市级头衔
|
|
||||||
CouTittle string `json:"couTittle"` //区县级头衔
|
|
||||||
OtherTittle string `json:"otherTittle"` //其他头衔
|
|
||||||
PastCooForms string `json:"pastCooForms"` //过往合作平台
|
|
||||||
ExhibiInfo string `json:"exhibiInfo"` //参展信息
|
|
||||||
KeyAchi string `json:"keyAchi"` //主要成就
|
|
||||||
Works string `json:"works"` //作品集
|
|
||||||
PicAlbum string `json:"picAlbum"` //画册
|
|
||||||
|
|
||||||
// AwardInfo []AwardInfo `json:"awardInfo"` //获奖信息
|
|
||||||
// Publish []Publish `json:"publish"` //出版
|
|
||||||
// AcadePub []AcadePub `json:"acadePub"` //学术发表
|
|
||||||
// ThirdComment []ThirdComment `json:"thirdComment"` //第三方或策展人评论
|
|
||||||
CreaDirect string `json:"creaDirect"` //创作方向(科目)
|
|
||||||
ArtStyle string `json:"artStyle"` //艺术风格
|
|
||||||
PenInkSkill string `json:"penInkSkill"` //笔墨技法
|
|
||||||
DrawThink string `json:"drawThink"` //绘画思想
|
|
||||||
AcadeValue string `json:"acadeValue"` //学术价值
|
|
||||||
|
|
||||||
ArtName string `json:"artName"` // 艺名
|
|
||||||
JoinClubTime string `json:"joinClubTime"` // 入会时间
|
|
||||||
ArtistStamp string `json:"artistStamp"` // 画家印章
|
|
||||||
}
|
|
||||||
|
|
||||||
type CreateContractRes struct {
|
|
||||||
Code string `json:"code"`
|
|
||||||
Download_url string `json:"download_url"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Result string `json:"result"`
|
|
||||||
Viewpdf_url string `json:"viewpdf_url"`
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,35 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
package Contract;
|
package contract;
|
||||||
option go_package = "./;contract";
|
option go_package = "./;contract";
|
||||||
//$ protoc --proto_path=. --go_out=./api/contract --go-triple_out=./api/contract ./api/contract/contract.proto
|
//$ protoc --proto_path=. --go_out=./api/contract --go-triple_out=./api/contract ./api/contract/contract.proto
|
||||||
service Contract {
|
service Contract {
|
||||||
|
|
||||||
rpc CreateContract (CreateContractRequest) returns (CreateContractRespond) {}
|
rpc CreateContract (CreateContractRequest) returns (CreateContractRespond) {}
|
||||||
rpc FinishContract (FinishContractRequest) returns (FinishContractRespond) {}
|
rpc ContractListMgmt (ContractListMgmtRequest) returns (ContractListMgmtRespond) {}
|
||||||
rpc ContractList (ContractListRequest) returns (ContractListRespond) {}
|
rpc ContractList (ContractListRequest) returns (ContractListRespond) {}
|
||||||
|
rpc SignContract (SignContractRequest) returns (SignContractRespond) {}
|
||||||
|
|
||||||
|
rpc FinishContract (FinishContractRequest) returns (FinishContractRespond) {}
|
||||||
rpc GetContract (GetContractRequest) returns (ContractData) {}
|
rpc GetContract (GetContractRequest) returns (ContractData) {}
|
||||||
rpc ContractTxList (ContractTxListRequest) returns (ContractTxListRespond) {}
|
rpc ContractTxList (ContractTxListRequest) returns (ContractTxListRespond) {}
|
||||||
rpc SignContract (SignContractRequest) returns (SignContractRespond) {}
|
|
||||||
rpc UpdateContract(UpdateContractRequest) returns (UpdateContractRespond) {}
|
rpc UpdateContract(UpdateContractRequest) returns (UpdateContractRespond) {}
|
||||||
rpc UpdateContractTx(UpdateContractTxRequest) returns (UpdateContractTxRespond) {}
|
rpc UpdateContractTx(UpdateContractTxRequest) returns (UpdateContractTxRespond) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message Contracts{
|
||||||
|
string ContractUid = 1 [json_name = "contract_uid"];
|
||||||
|
string ArtistUid = 2 [json_name = "artist_uid"];
|
||||||
|
string ArtworkUid = 3 [json_name = "artwork_uid"];
|
||||||
|
string ContractId = 4 [json_name = "contract_id"];
|
||||||
|
string TransactionId = 5 [json_name = "transaction_id"];
|
||||||
|
int32 Type = 6 [json_name = "type"];
|
||||||
|
string ViewUrl = 7 [json_name = "view_url"];
|
||||||
|
string DownloadUrl = 8 [json_name = "download_url"];
|
||||||
|
int32 State = 9 [json_name = "state"];
|
||||||
|
int32 Status = 10 [json_name = "status"];
|
||||||
|
string LockTime = 11 [json_name = "lock_time"];
|
||||||
|
string SignTime = 12 [json_name = "sign_time"];
|
||||||
|
}
|
||||||
|
|
||||||
message CreateContractRequest {
|
message CreateContractRequest {
|
||||||
string ArtistUid = 1 [json_name="artist_uid"];
|
string ArtistUid = 1 [json_name="artist_uid"];
|
||||||
repeated string ArtworkUid = 2 [json_name="artwork_uid"];
|
repeated string ArtworkUid = 2 [json_name="artwork_uid"];
|
||||||
@ -24,6 +40,41 @@ message CreateContractRespond{
|
|||||||
string Msg = 1 [json_name = "msg"];
|
string Msg = 1 [json_name = "msg"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ContractListMgmtRequest{
|
||||||
|
string ArtistUid = 1 [json_name = "artist_uid"];
|
||||||
|
int32 Page = 2 [json_name = "page"];
|
||||||
|
int32 Num = 3 [json_name = "num"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ContractListMgmtRespond{
|
||||||
|
repeated Contracts Data = 1 [json_name = "data"];
|
||||||
|
string Msg = 2 [json_name = "msg"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ContractListRequest {
|
||||||
|
int32 ID = 1 [json_name = "id"];
|
||||||
|
int32 PageSize = 2 [json_name="pageSize"];
|
||||||
|
int32 Page = 3 [json_name="page"];
|
||||||
|
int32 State = 4 [json_name="state"];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message ContractListRespond {
|
||||||
|
repeated Contracts Data = 1 [json_name = "data"];
|
||||||
|
string Msg = 2 [json_name = "msg"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message SignContractRequest {
|
||||||
|
int32 ID = 1 [json_name = "id"];
|
||||||
|
int32 ContractId = 2 [json_name="contractId"];
|
||||||
|
string HtmlType = 3 [json_name="htmlType"];
|
||||||
|
string EnvType = 4 [json_name= "envType"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message SignContractRespond {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
message FinishContractRequest {
|
message FinishContractRequest {
|
||||||
string TransactionId = 1 [json_name="transactionId"];
|
string TransactionId = 1 [json_name="transactionId"];
|
||||||
|
|
||||||
@ -33,18 +84,6 @@ message FinishContractRespond {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message ContractListRequest {
|
|
||||||
int64 PageSize = 1 [json_name="pageSize"];
|
|
||||||
int64 Page = 2 [json_name="page"];
|
|
||||||
int64 State = 3 [json_name="state"];
|
|
||||||
int64 ID =4 [json_name = "id"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message ContractListRespond {
|
|
||||||
repeated ContractData Data =1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ContractData{
|
message ContractData{
|
||||||
uint64 ID = 1[json_name="id"];
|
uint64 ID = 1[json_name="id"];
|
||||||
int64 UserId = 2[json_name="userId"];
|
int64 UserId = 2[json_name="userId"];
|
||||||
@ -65,7 +104,6 @@ message ContractData{
|
|||||||
string SignTime = 17 [json_name="signTime"];
|
string SignTime = 17 [json_name="signTime"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message ContractTxListRequest {
|
message ContractTxListRequest {
|
||||||
int64 PageSize = 1 [json_name="pageSize"];
|
int64 PageSize = 1 [json_name="pageSize"];
|
||||||
int64 Page = 2 [json_name="page"];
|
int64 Page = 2 [json_name="page"];
|
||||||
@ -76,15 +114,6 @@ message ContractTxListRequest {
|
|||||||
message ContractTxListRespond {
|
message ContractTxListRespond {
|
||||||
repeated ContractData Data =1;
|
repeated ContractData Data =1;
|
||||||
}
|
}
|
||||||
message SignContractRequest {
|
|
||||||
int64 ContractId = 1 [json_name="contractId"];
|
|
||||||
string HtmlType = 2 [json_name="htmlType"];
|
|
||||||
string EnvType = 3 [json_name= "envType"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignContractRespond {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetContractRequest {
|
message GetContractRequest {
|
||||||
int64 Id = 1 [json_name="id"];
|
int64 Id = 1 [json_name="id"];
|
||||||
|
@ -15,16 +15,26 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *Contracts) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *CreateContractRequest) Validate() error {
|
func (this *CreateContractRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *CreateContractRespond) Validate() error {
|
func (this *CreateContractRespond) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *FinishContractRequest) Validate() error {
|
func (this *ContractListMgmtRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *FinishContractRespond) Validate() error {
|
func (this *ContractListMgmtRespond) 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
|
return nil
|
||||||
}
|
}
|
||||||
func (this *ContractListRequest) Validate() error {
|
func (this *ContractListRequest) Validate() error {
|
||||||
@ -40,6 +50,18 @@ func (this *ContractListRespond) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *SignContractRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SignContractRespond) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FinishContractRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FinishContractRespond) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *ContractData) Validate() error {
|
func (this *ContractData) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -56,12 +78,6 @@ func (this *ContractTxListRespond) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *SignContractRequest) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *SignContractRespond) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *GetContractRequest) Validate() error {
|
func (this *GetContractRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,12 @@ 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.
|
// 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 {
|
type ContractClient interface {
|
||||||
CreateContract(ctx context.Context, in *CreateContractRequest, opts ...grpc_go.CallOption) (*CreateContractRespond, common.ErrorWithAttachment)
|
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)
|
ContractListMgmt(ctx context.Context, in *ContractListMgmtRequest, opts ...grpc_go.CallOption) (*ContractListMgmtRespond, common.ErrorWithAttachment)
|
||||||
ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment)
|
ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment)
|
||||||
|
SignContract(ctx context.Context, in *SignContractRequest, opts ...grpc_go.CallOption) (*SignContractRespond, common.ErrorWithAttachment)
|
||||||
|
FinishContract(ctx context.Context, in *FinishContractRequest, opts ...grpc_go.CallOption) (*FinishContractRespond, common.ErrorWithAttachment)
|
||||||
GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment)
|
GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment)
|
||||||
ContractTxList(ctx context.Context, in *ContractTxListRequest, opts ...grpc_go.CallOption) (*ContractTxListRespond, common.ErrorWithAttachment)
|
ContractTxList(ctx context.Context, in *ContractTxListRequest, opts ...grpc_go.CallOption) (*ContractTxListRespond, common.ErrorWithAttachment)
|
||||||
SignContract(ctx context.Context, in *SignContractRequest, opts ...grpc_go.CallOption) (*SignContractRespond, common.ErrorWithAttachment)
|
|
||||||
UpdateContract(ctx context.Context, in *UpdateContractRequest, opts ...grpc_go.CallOption) (*UpdateContractRespond, common.ErrorWithAttachment)
|
UpdateContract(ctx context.Context, in *UpdateContractRequest, opts ...grpc_go.CallOption) (*UpdateContractRespond, common.ErrorWithAttachment)
|
||||||
UpdateContractTx(ctx context.Context, in *UpdateContractTxRequest, opts ...grpc_go.CallOption) (*UpdateContractTxRespond, common.ErrorWithAttachment)
|
UpdateContractTx(ctx context.Context, in *UpdateContractTxRequest, opts ...grpc_go.CallOption) (*UpdateContractTxRespond, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
@ -44,11 +45,12 @@ type contractClient struct {
|
|||||||
|
|
||||||
type ContractClientImpl struct {
|
type ContractClientImpl struct {
|
||||||
CreateContract func(ctx context.Context, in *CreateContractRequest) (*CreateContractRespond, error)
|
CreateContract func(ctx context.Context, in *CreateContractRequest) (*CreateContractRespond, error)
|
||||||
FinishContract func(ctx context.Context, in *FinishContractRequest) (*FinishContractRespond, error)
|
ContractListMgmt func(ctx context.Context, in *ContractListMgmtRequest) (*ContractListMgmtRespond, error)
|
||||||
ContractList func(ctx context.Context, in *ContractListRequest) (*ContractListRespond, error)
|
ContractList func(ctx context.Context, in *ContractListRequest) (*ContractListRespond, error)
|
||||||
|
SignContract func(ctx context.Context, in *SignContractRequest) (*SignContractRespond, error)
|
||||||
|
FinishContract func(ctx context.Context, in *FinishContractRequest) (*FinishContractRespond, error)
|
||||||
GetContract func(ctx context.Context, in *GetContractRequest) (*ContractData, error)
|
GetContract func(ctx context.Context, in *GetContractRequest) (*ContractData, error)
|
||||||
ContractTxList func(ctx context.Context, in *ContractTxListRequest) (*ContractTxListRespond, error)
|
ContractTxList func(ctx context.Context, in *ContractTxListRequest) (*ContractTxListRespond, error)
|
||||||
SignContract func(ctx context.Context, in *SignContractRequest) (*SignContractRespond, error)
|
|
||||||
UpdateContract func(ctx context.Context, in *UpdateContractRequest) (*UpdateContractRespond, error)
|
UpdateContract func(ctx context.Context, in *UpdateContractRequest) (*UpdateContractRespond, error)
|
||||||
UpdateContractTx func(ctx context.Context, in *UpdateContractTxRequest) (*UpdateContractTxRespond, error)
|
UpdateContractTx func(ctx context.Context, in *UpdateContractTxRequest) (*UpdateContractTxRespond, error)
|
||||||
}
|
}
|
||||||
@ -71,10 +73,10 @@ func (c *contractClient) CreateContract(ctx context.Context, in *CreateContractR
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateContract", in, out)
|
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) {
|
func (c *contractClient) ContractListMgmt(ctx context.Context, in *ContractListMgmtRequest, opts ...grpc_go.CallOption) (*ContractListMgmtRespond, common.ErrorWithAttachment) {
|
||||||
out := new(FinishContractRespond)
|
out := new(ContractListMgmtRespond)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/FinishContract", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractListMgmt", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *contractClient) ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment) {
|
func (c *contractClient) ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment) {
|
||||||
@ -83,6 +85,18 @@ func (c *contractClient) ContractList(ctx context.Context, in *ContractListReque
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractList", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractList", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *contractClient) SignContract(ctx context.Context, in *SignContractRequest, opts ...grpc_go.CallOption) (*SignContractRespond, common.ErrorWithAttachment) {
|
||||||
|
out := new(SignContractRespond)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SignContract", 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)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/FinishContract", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *contractClient) GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment) {
|
func (c *contractClient) GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment) {
|
||||||
out := new(ContractData)
|
out := new(ContractData)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -95,12 +109,6 @@ func (c *contractClient) ContractTxList(ctx context.Context, in *ContractTxListR
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractTxList", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractTxList", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *contractClient) SignContract(ctx context.Context, in *SignContractRequest, opts ...grpc_go.CallOption) (*SignContractRespond, common.ErrorWithAttachment) {
|
|
||||||
out := new(SignContractRespond)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SignContract", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *contractClient) UpdateContract(ctx context.Context, in *UpdateContractRequest, opts ...grpc_go.CallOption) (*UpdateContractRespond, common.ErrorWithAttachment) {
|
func (c *contractClient) UpdateContract(ctx context.Context, in *UpdateContractRequest, opts ...grpc_go.CallOption) (*UpdateContractRespond, common.ErrorWithAttachment) {
|
||||||
out := new(UpdateContractRespond)
|
out := new(UpdateContractRespond)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -118,11 +126,12 @@ func (c *contractClient) UpdateContractTx(ctx context.Context, in *UpdateContrac
|
|||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type ContractServer interface {
|
type ContractServer interface {
|
||||||
CreateContract(context.Context, *CreateContractRequest) (*CreateContractRespond, error)
|
CreateContract(context.Context, *CreateContractRequest) (*CreateContractRespond, error)
|
||||||
FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error)
|
ContractListMgmt(context.Context, *ContractListMgmtRequest) (*ContractListMgmtRespond, error)
|
||||||
ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error)
|
ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error)
|
||||||
|
SignContract(context.Context, *SignContractRequest) (*SignContractRespond, error)
|
||||||
|
FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error)
|
||||||
GetContract(context.Context, *GetContractRequest) (*ContractData, error)
|
GetContract(context.Context, *GetContractRequest) (*ContractData, error)
|
||||||
ContractTxList(context.Context, *ContractTxListRequest) (*ContractTxListRespond, error)
|
ContractTxList(context.Context, *ContractTxListRequest) (*ContractTxListRespond, error)
|
||||||
SignContract(context.Context, *SignContractRequest) (*SignContractRespond, error)
|
|
||||||
UpdateContract(context.Context, *UpdateContractRequest) (*UpdateContractRespond, error)
|
UpdateContract(context.Context, *UpdateContractRequest) (*UpdateContractRespond, error)
|
||||||
UpdateContractTx(context.Context, *UpdateContractTxRequest) (*UpdateContractTxRespond, error)
|
UpdateContractTx(context.Context, *UpdateContractTxRequest) (*UpdateContractTxRespond, error)
|
||||||
mustEmbedUnimplementedContractServer()
|
mustEmbedUnimplementedContractServer()
|
||||||
@ -136,21 +145,24 @@ type UnimplementedContractServer struct {
|
|||||||
func (UnimplementedContractServer) CreateContract(context.Context, *CreateContractRequest) (*CreateContractRespond, error) {
|
func (UnimplementedContractServer) CreateContract(context.Context, *CreateContractRequest) (*CreateContractRespond, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreateContract not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CreateContract not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedContractServer) FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error) {
|
func (UnimplementedContractServer) ContractListMgmt(context.Context, *ContractListMgmtRequest) (*ContractListMgmtRespond, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method FinishContract not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ContractListMgmt not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedContractServer) ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error) {
|
func (UnimplementedContractServer) ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ContractList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ContractList not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedContractServer) SignContract(context.Context, *SignContractRequest) (*SignContractRespond, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SignContract not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContractServer) FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method FinishContract not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedContractServer) GetContract(context.Context, *GetContractRequest) (*ContractData, error) {
|
func (UnimplementedContractServer) GetContract(context.Context, *GetContractRequest) (*ContractData, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetContract not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetContract not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedContractServer) ContractTxList(context.Context, *ContractTxListRequest) (*ContractTxListRespond, error) {
|
func (UnimplementedContractServer) ContractTxList(context.Context, *ContractTxListRequest) (*ContractTxListRespond, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ContractTxList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ContractTxList not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedContractServer) SignContract(context.Context, *SignContractRequest) (*SignContractRespond, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SignContract not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedContractServer) UpdateContract(context.Context, *UpdateContractRequest) (*UpdateContractRespond, error) {
|
func (UnimplementedContractServer) UpdateContract(context.Context, *UpdateContractRequest) (*UpdateContractRespond, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateContract not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateContract not implemented")
|
||||||
}
|
}
|
||||||
@ -214,8 +226,8 @@ func _Contract_CreateContract_Handler(srv interface{}, ctx context.Context, dec
|
|||||||
return interceptor(ctx, in, info, handler)
|
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) {
|
func _Contract_ContractListMgmt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(FinishContractRequest)
|
in := new(ContractListMgmtRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -227,7 +239,7 @@ func _Contract_FinishContract_Handler(srv interface{}, ctx context.Context, dec
|
|||||||
for k, v := range md {
|
for k, v := range md {
|
||||||
invAttachment[k] = v
|
invAttachment[k] = v
|
||||||
}
|
}
|
||||||
invo := invocation.NewRPCInvocation("FinishContract", args, invAttachment)
|
invo := invocation.NewRPCInvocation("ContractListMgmt", args, invAttachment)
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
return result, result.Error()
|
return result, result.Error()
|
||||||
@ -272,6 +284,64 @@ func _Contract_ContractList_Handler(srv interface{}, ctx context.Context, dec fu
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Contract_SignContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(SignContractRequest)
|
||||||
|
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("SignContract", 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 {
|
||||||
|
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("FinishContract", 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_GetContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Contract_GetContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetContractRequest)
|
in := new(GetContractRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -330,35 +400,6 @@ func _Contract_ContractTxList_Handler(srv interface{}, ctx context.Context, dec
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Contract_SignContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(SignContractRequest)
|
|
||||||
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("SignContract", 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_UpdateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Contract_UpdateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(UpdateContractRequest)
|
in := new(UpdateContractRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -429,13 +470,21 @@ var Contract_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
Handler: _Contract_CreateContract_Handler,
|
Handler: _Contract_CreateContract_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "FinishContract",
|
MethodName: "ContractListMgmt",
|
||||||
Handler: _Contract_FinishContract_Handler,
|
Handler: _Contract_ContractListMgmt_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "ContractList",
|
MethodName: "ContractList",
|
||||||
Handler: _Contract_ContractList_Handler,
|
Handler: _Contract_ContractList_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SignContract",
|
||||||
|
Handler: _Contract_SignContract_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "FinishContract",
|
||||||
|
Handler: _Contract_FinishContract_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetContract",
|
MethodName: "GetContract",
|
||||||
Handler: _Contract_GetContract_Handler,
|
Handler: _Contract_GetContract_Handler,
|
||||||
@ -444,10 +493,6 @@ var Contract_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "ContractTxList",
|
MethodName: "ContractTxList",
|
||||||
Handler: _Contract_ContractTxList_Handler,
|
Handler: _Contract_ContractTxList_Handler,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
MethodName: "SignContract",
|
|
||||||
Handler: _Contract_SignContract_Handler,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
MethodName: "UpdateContract",
|
MethodName: "UpdateContract",
|
||||||
Handler: _Contract_UpdateContract_Handler,
|
Handler: _Contract_UpdateContract_Handler,
|
||||||
|
3486
pb/contract_microservice/contract.pb.go
Normal file
3486
pb/contract_microservice/contract.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
298
pb/contract_microservice/contract.proto
Normal file
298
pb/contract_microservice/contract.proto
Normal file
@ -0,0 +1,298 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
package contractMicroservice;
|
||||||
|
//import "github.com/mwitkow/go-proto-validators/validator.proto";
|
||||||
|
|
||||||
|
option go_package = "./;contractMicroservice";
|
||||||
|
|
||||||
|
service ContractMicroservice {
|
||||||
|
rpc RegisterPerson (RegisterPersonRequest) returns (RegisterResponse) {} //个人注册
|
||||||
|
rpc PersonVerify (PersonVerifyRequest) returns (PersonVerifyResponse) {} //个人身份校验
|
||||||
|
|
||||||
|
rpc RegisterOrg (RegisterOrgRequest) returns (RegisterResponse) {} //主体注册
|
||||||
|
rpc CompanyVerify (CompanyVerifyRequest) returns (PersonVerifyResponse) {} //主体身份校验
|
||||||
|
|
||||||
|
rpc FindPersonCertInfo (FindCertInfo) returns (PersonCertInfoResponse) {} //主体身份校验
|
||||||
|
rpc FindCompanyCertInfo (FindCertInfo) returns (CompanyCertInfoResponse) {} //主体身份校验
|
||||||
|
|
||||||
|
rpc ApplyCert (ApplyCertRequest) returns (CommonResponse) {} //颁发证书
|
||||||
|
|
||||||
|
rpc AddSignature (AddSignRequest) returns (AddSignResponse) {} //实名证书申请
|
||||||
|
rpc CustomSign (CustomSignRequest) returns (CustomSignResponse) {} //自定义印章
|
||||||
|
rpc UploadTemplate (UploadTemplateRequest) returns (CommonResponse) {} //上传文本
|
||||||
|
rpc UploadDocs (UploadDocsRequest) returns (CommonResponse) {} //上传文本
|
||||||
|
rpc GenerateContract (GenerateContractRequest) returns (ViewCommonResponse) {} //模板填充
|
||||||
|
rpc ExtSignAuto (ExtSignAutoRequest) returns (ViewCommonResponse) {} //自动签章
|
||||||
|
rpc BeforeAuthSign (BeforeAuthSignRequest) returns (JumpCommonResponse) {} //自动签章 授权
|
||||||
|
rpc ExtSign (ExtSignRequest) returns (JumpCommonResponse) {} //授权
|
||||||
|
rpc ViewContract (ContractRequest) returns (JumpCommonResponse) {} //查看合同
|
||||||
|
rpc DownLoadContract (ContractRequest) returns (JumpCommonResponse) {} //查看合同
|
||||||
|
rpc ContractFiling (ContractRequest) returns (CommonResponse) {} //合同归档
|
||||||
|
rpc GetPdfTemplateKeys (PdfTemplateKeysRequest) returns (PdfTemplateKeysResponse) {} //获取合同模板的key值
|
||||||
|
|
||||||
|
rpc AuthStatus (CustomerIdRequest) returns (AuthStatusResponse) {} //获取合同模板的key值
|
||||||
|
rpc CancelExtSignAuto (CancelExtSignAutoRequest) returns (JumpCommonResponse) {} //取消授权签协议接口
|
||||||
|
}
|
||||||
|
|
||||||
|
message CancelExtSignAutoRequest {
|
||||||
|
string CustomerId = 1;
|
||||||
|
string NotifyUrl = 2;
|
||||||
|
string returnUrl = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Person {
|
||||||
|
string AreaCode = 1;
|
||||||
|
string AuditFailReason = 2;
|
||||||
|
string AuditorTime = 3;
|
||||||
|
string BackgroundIdCardPath = 4;
|
||||||
|
string BankCardNo = 5;
|
||||||
|
string Birthday = 6;
|
||||||
|
string CertType = 7;
|
||||||
|
string ExpiresDate = 8;
|
||||||
|
string Fork = 9;
|
||||||
|
string GesturesPhotoPath = 10;
|
||||||
|
string HeadPhotoPath = 11;
|
||||||
|
string IdCard = 12;
|
||||||
|
string IsLongTerm = 13;
|
||||||
|
double IsPassFourElement = 14;
|
||||||
|
double IsPassThreeElement = 15;
|
||||||
|
string IssueAuthority = 16;
|
||||||
|
string Mobile = 17;
|
||||||
|
string PersonName = 18;
|
||||||
|
string PhotoUuid = 19;
|
||||||
|
string Sex = 20;
|
||||||
|
string StartDate = 21;
|
||||||
|
string Status = 22;
|
||||||
|
string Type = 23;
|
||||||
|
string VerifyType = 24;
|
||||||
|
string Address = 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PersonCertInfoResponse {
|
||||||
|
Person Person = 1 [json_name = "person"];
|
||||||
|
string AuthenticationSubmitTime = 2 [json_name = "authenticationSubmitTime"];
|
||||||
|
string PassTime = 3 [json_name = "passTime"];
|
||||||
|
string TransactionNo = 4 [json_name = "transactionNo"];
|
||||||
|
string Type = 5 [json_name = "type"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindCertInfo {
|
||||||
|
string VerifiedSerialno = 2 [json_name = "verifiedSerialno"];
|
||||||
|
}
|
||||||
|
message Company{
|
||||||
|
string AuditFailReason = 1;
|
||||||
|
string AuditorTime = 2;
|
||||||
|
string CertificatesType = 3;
|
||||||
|
string CompanyEmail = 4;
|
||||||
|
string CompanyName = 5;
|
||||||
|
string Hasagent = 6;
|
||||||
|
string Legal = 7;
|
||||||
|
string LegalMobile = 8;
|
||||||
|
string LegalName = 9;
|
||||||
|
string Organization = 10;
|
||||||
|
string OrganizationPath = 11;
|
||||||
|
string OrganizationType = 12;
|
||||||
|
string RegFormPath = 13;
|
||||||
|
string RelatedTransactionNo = 14;
|
||||||
|
string Status = 15;
|
||||||
|
string VerifyType = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Manager {
|
||||||
|
string AreaCode = 1;
|
||||||
|
string AuditFailReason = 2;
|
||||||
|
string AuditorTime = 3;
|
||||||
|
string BackgroundIdCardPath = 4;
|
||||||
|
string Birthday = 5;
|
||||||
|
string ExpiresDate = 6;
|
||||||
|
string Fork = 7;
|
||||||
|
string HeadPhotoPath = 8;
|
||||||
|
string IdCard = 9;
|
||||||
|
string IsLongTerm = 10;
|
||||||
|
string IssueAuthority = 11;
|
||||||
|
string Mobile = 12;
|
||||||
|
string PersonName = 13;
|
||||||
|
string PhotoUuid = 14;
|
||||||
|
string Sex = 15;
|
||||||
|
string StartDate = 16;
|
||||||
|
string Status = 17;
|
||||||
|
string Type = 18;
|
||||||
|
string VerifyType = 19;
|
||||||
|
string Address = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CompanyCertInfoResponse {
|
||||||
|
Company Company = 1 [json_name = "Company"];
|
||||||
|
Manager Manager = 2 [json_name = "manager"];
|
||||||
|
string AuthenticationSubmitTime = 3 [json_name = "authenticationSubmitTime"];
|
||||||
|
string PassTime = 4 [json_name = "passTime"];
|
||||||
|
string TransactionNo = 5 [json_name = "transactionNo"];
|
||||||
|
string Type = 6 [json_name = "type"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message AuthStatusResponse {
|
||||||
|
uint64 AuthType = 1 [json_name = "authType"];
|
||||||
|
string ContractId = 2 [json_name = "contractId"];
|
||||||
|
uint64 Status = 3 [json_name = "status"];
|
||||||
|
string TransactionId = 4 [json_name = "transactionId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ApplyCertRequest {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
string VerifiedSerialno = 2 [json_name = "verifiedSerialno"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ViewCommonResponse {
|
||||||
|
string DownloadUrl = 1 [json_name = "downloadUrl"];
|
||||||
|
string ViewPdfUrl = 2 [json_name = "viewPdfUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message PdfTemplateKeysRequest {
|
||||||
|
string TemplateId = 1 [json_name = "templateId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message PdfTemplateKeysResponse {
|
||||||
|
repeated string Keys = 1 [json_name = "Keys"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message JumpCommonResponse {
|
||||||
|
string JumpUrl = 1 [json_name = "jumpUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ContractRequest {
|
||||||
|
string ContractId = 1 [json_name = "contractId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ExtSignRequest {
|
||||||
|
string TransactionId = 1 [json_name = "transactionId"];
|
||||||
|
string ContractId = 2 [json_name = "contractId"];
|
||||||
|
string CustomerId = 3 [json_name = "customerId"];
|
||||||
|
string ReturnUrl = 4 [json_name = "returnUrl"];
|
||||||
|
string DocTitle = 5 [json_name = "docTitle"];
|
||||||
|
string OpenEnvironment = 6 [json_name = "openEnvironment"];
|
||||||
|
string MobileSignType = 7 [json_name = "mobileSignType"];
|
||||||
|
string SignKeyword = 8 [json_name = "signKeyword"];
|
||||||
|
string Keyx = 9 [json_name = "keyx"];
|
||||||
|
string Keyy = 10 [json_name = "keyy"];
|
||||||
|
string SignatureShowTime = 11 [json_name = "signatureShowTime"];
|
||||||
|
string PcHandSignature = 12 [json_name = "PcHandSignature"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message BeforeAuthSignRequest {
|
||||||
|
string TransactionId = 1 [json_name = "transactionId"];
|
||||||
|
string ContractId = 2 [json_name = "contractId"];
|
||||||
|
string CustomerId = 3 [json_name = "customerId"];
|
||||||
|
string ReturnUrl = 4 [json_name = "returnUrl"];
|
||||||
|
string NotifyUrl = 5 [json_name = "notifyUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message UploadDocsRequest {
|
||||||
|
string ContractId = 1 [json_name = "customerId"];
|
||||||
|
string DocTitle = 2 [json_name = "docTitle"];
|
||||||
|
string DocUrl = 3 [json_name = "docUrl"];
|
||||||
|
string File = 4 [json_name = "file"];
|
||||||
|
//string doc_type = 1 [json_name = "customerId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message CompanyVerifyRequest {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message UploadTemplateResponse {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message PersonVerifyRequest {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
string VerifiedWay = 2 [json_name = "verifiedWay"];
|
||||||
|
string CustomerName = 3 [json_name = "customerName"];
|
||||||
|
string CustomerIdentNo = 4 [json_name = "customerIdentNo"];
|
||||||
|
string Mobile = 5 [json_name = "mobile"];
|
||||||
|
string ReturnUrl = 6 [json_name = "returnUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message PersonVerifyResponse {
|
||||||
|
string TransactionNo =1;
|
||||||
|
string Url =2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterResponse {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message CustomerIdRequest {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message CommonResponse {
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterOrgRequest {
|
||||||
|
string OpenId = 1 [json_name = "openId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterPersonRequest {
|
||||||
|
string OpenId = 1 [json_name = "openId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message AddSignRequest {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
bytes ReadImgByte = 2 [json_name = "readImgByte"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message AddSignResponse {
|
||||||
|
string SignatureId = 1 [json_name = "signatureId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message CustomSignRequest {
|
||||||
|
string CustomerId = 1 [json_name = "customerId"];
|
||||||
|
string Content = 2 [json_name = "content"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message CustomSignResponse {
|
||||||
|
string SignatureImgBase64 = 1 [json_name = "signatureImgBase64"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message UploadTemplateRequest {
|
||||||
|
string TemplateId = 1 [json_name = "templateId"];
|
||||||
|
string DocUrl = 2 [json_name = "docUrl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message ExtSignAutoRequest {
|
||||||
|
string TransactionId = 1 [json_name = "transactionId"];
|
||||||
|
string ContractId = 2 [json_name = "contractId"];
|
||||||
|
string CustomerId = 3 [json_name = "customerId"];
|
||||||
|
string ClientRole = 4 [json_name = "clientRole"];
|
||||||
|
string DocTitle = 5 [json_name = "docTitle"];
|
||||||
|
string SignKeyword = 6 [json_name = "signKeyword"];
|
||||||
|
string SignatureId = 7 [json_name = "signatureId"];
|
||||||
|
string KeyX = 9 [json_name = "keyX"];
|
||||||
|
string KeyY = 10 [json_name = "keyY"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message GenerateContractRequest {
|
||||||
|
string TemplateId = 1 [json_name="templateId"];
|
||||||
|
string ContractId = 2 [json_name="templateId"];
|
||||||
|
string ParameterMap = 3 [json_name="ParameterMap"];
|
||||||
|
string DynamicTables = 4 [json_name="dynamicTables"];
|
||||||
|
}
|
||||||
|
|
131
pb/contract_microservice/contract.validator.pb.go
Normal file
131
pb/contract_microservice/contract.validator.pb.go
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: contract.proto
|
||||||
|
|
||||||
|
package contractMicroservice
|
||||||
|
|
||||||
|
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 *CancelExtSignAutoRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *Person) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PersonCertInfoResponse) Validate() error {
|
||||||
|
if this.Person != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Person); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Person", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *FindCertInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *Company) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *Manager) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CompanyCertInfoResponse) Validate() error {
|
||||||
|
if this.Company != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Company); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Company", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if this.Manager != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Manager); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("Manager", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *AuthStatusResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ApplyCertRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ViewCommonResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PdfTemplateKeysRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PdfTemplateKeysResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *JumpCommonResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ContractRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ExtSignRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *BeforeAuthSignRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UploadDocsRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CompanyVerifyRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UploadTemplateResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PersonVerifyRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *PersonVerifyResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RegisterResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CustomerIdRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CommonResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RegisterOrgRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *RegisterPersonRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *AddSignRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *AddSignResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CustomSignRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CustomSignResponse) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UploadTemplateRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ExtSignAutoRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *GenerateContractRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
1047
pb/contract_microservice/contract_triple.pb.go
Normal file
1047
pb/contract_microservice/contract_triple.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
@ -59,6 +59,7 @@ const (
|
|||||||
ARTIST_NOT_EXISTS = "画家不存在"
|
ARTIST_NOT_EXISTS = "画家不存在"
|
||||||
ERROR_DATA_NOT_EXISTS = "数据不存在"
|
ERROR_DATA_NOT_EXISTS = "数据不存在"
|
||||||
ERROR_UPDATE_ARTIST = "数据不存在"
|
ERROR_UPDATE_ARTIST = "数据不存在"
|
||||||
|
ARTWORK_CONTRACT_EXISTS = "存在画作合同已经存在"
|
||||||
ERROR_INVALID_CARDID = "身份证号不合法"
|
ERROR_INVALID_CARDID = "身份证号不合法"
|
||||||
INVITE_CODE_INVALID = "邀请码无效"
|
INVITE_CODE_INVALID = "邀请码无效"
|
||||||
ERROR_ISLOCK = "用户已被锁定"
|
ERROR_ISLOCK = "用户已被锁定"
|
||||||
|
@ -8,14 +8,15 @@ import (
|
|||||||
//_ "dubbo.apache.org/dubbo-go/v3/imports"
|
//_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pb/account"
|
"github.com/fonchain/fonchain-artistinfo/pb/account"
|
||||||
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
||||||
|
contractMicroservice "github.com/fonchain/fonchain-artistinfo/pb/contract_microservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
GrpcArtistImpl = new(artist.ArtistClientImpl)
|
GrpcArtistImpl = new(artist.ArtistClientImpl)
|
||||||
|
|
||||||
AccountProvider = new(account.AccountClientImpl)
|
AccountProvider = new(account.AccountClientImpl)
|
||||||
ArtworkImpl = new(artwork.ArtworkClientImpl)
|
ArtworkImpl = new(artwork.ArtworkClientImpl)
|
||||||
ArtworkQueryImpl = new(artwork_query.ArtworkQueryClientImpl)
|
ArtworkQueryImpl = new(artwork_query.ArtworkQueryClientImpl)
|
||||||
|
ContractImpl = new(contractMicroservice.ContractMicroserviceClientImpl)
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -23,6 +24,7 @@ func init() {
|
|||||||
config.SetConsumerService(AccountProvider)
|
config.SetConsumerService(AccountProvider)
|
||||||
config.SetConsumerService(ArtworkImpl)
|
config.SetConsumerService(ArtworkImpl)
|
||||||
config.SetConsumerService(ArtworkQueryImpl)
|
config.SetConsumerService(ArtworkQueryImpl)
|
||||||
|
config.SetConsumerService(ContractImpl)
|
||||||
//if os.Args[len(os.Args)-1] == "unit-test" {
|
//if os.Args[len(os.Args)-1] == "unit-test" {
|
||||||
// _ = os.Setenv(constant.ConfigFileEnvKey, "../../conf/dubbogo.yaml")
|
// _ = os.Setenv(constant.ConfigFileEnvKey, "../../conf/dubbogo.yaml")
|
||||||
//}
|
//}
|
||||||
|
Loading…
Reference in New Issue
Block a user