From f36d9a5cfafa265e78a6dd96a191d5f7508a16b2 Mon Sep 17 00:00:00 2001 From: songchuang <192749120@qq.com> Date: Fri, 17 Mar 2023 17:36:09 +0800 Subject: [PATCH] =?UTF-8?q?contract=20=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/contract.go | 4 +- cmd/internal/logic/contract.go | 896 +++++++++++++++++---------------- pb/contract/contract.pb.go | 307 ++++++----- pb/contract/contract.proto | 4 + 4 files changed, 635 insertions(+), 576 deletions(-) diff --git a/cmd/internal/dao/contract.go b/cmd/internal/dao/contract.go index b9eebf5..a6871aa 100644 --- a/cmd/internal/dao/contract.go +++ b/cmd/internal/dao/contract.go @@ -190,8 +190,8 @@ func GetContractInfo(contractUid string) (contractInfo model.Contract, err error 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 { +func UpdateContract(tx *gorm.DB, req *contract.SignContractRequest) (err error) { + if err = tx.Model(&model.Contract{}).Where("uid = ?", req.ContractUid).Updates(model.Contract{ViewUrl: req.ViewPdfUrl, DownloadUrl: req.DownloadUrl, ContractId: req.ContractNo, TransactionId: req.TransactionId, State: 1}).Error; err != nil { zap.L().Error("update contract info err", zap.Error(err)) err = errors.New(m.UPDATE_FAILED) return diff --git a/cmd/internal/logic/contract.go b/cmd/internal/logic/contract.go index 6e52ca0..84f3c21 100644 --- a/cmd/internal/logic/contract.go +++ b/cmd/internal/logic/contract.go @@ -2,18 +2,14 @@ package logic import ( "context" - "encoding/json" "errors" "fmt" - "strings" - "time" "github.com/fonchain/fonchain-artistinfo/cmd/internal/dao" "github.com/fonchain/fonchain-artistinfo/cmd/model" "github.com/fonchain/fonchain-artistinfo/pb/artist" "github.com/fonchain/fonchain-artistinfo/pb/artwork" 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" "github.com/fonchain/fonchain-artistinfo/pkg/m" "github.com/fonchain/fonchain-artistinfo/pkg/service" @@ -119,10 +115,15 @@ func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *con return } } - //创建画家画作合同,类型3 - if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 3, userInfo.LatestLockTime); err != nil { - tx.Rollback() - return + + //创建画家画作合同,类型3,每个画作一个合同 + for _, v := range req.ArtworkUid { + var artworkUid []string + artworkUid = append(artworkUid, v) + if err = dao.CreateArtworkContract(tx, artworkUid, req.ArtistUid, 3, userInfo.LatestLockTime); err != nil { + tx.Rollback() + return + } } case 5: @@ -133,10 +134,14 @@ func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *con return } } - //创建画家画作合同,类型3 - if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 5, userInfo.LatestLockTime); err != nil { - tx.Rollback() - return + //创建画家画作合同,类型5 + for _, v := range req.ArtworkUid { + var artworkUid []string + artworkUid = append(artworkUid, v) + if err = dao.CreateArtworkContract(tx, artworkUid, req.ArtistUid, 5, userInfo.LatestLockTime); err != nil { + tx.Rollback() + return + } } default: @@ -190,7 +195,7 @@ func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contrac if err != nil { return } - fmt.Println("ContractData:", ContractData) + rep = &contract.ContractListRespond{ Data: ContractData, } @@ -201,435 +206,10 @@ func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contrac func (a *Contract) SignContract(req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error) { rep = &contract.SignContractRespond{} - //遇到错误数据库回滚 tx := db.DB.Begin() - - //根据合同uid获取具体合同信息 - contractInfo, err := dao.GetContractInfo(req.ContractUid) - if err != nil { - return - } - - // //根据画家id获取画家具体信息 - // artistDetailResponse, customerId, err := GetArtistInfoById(req.ArtistUid) - // if err != nil { - // return rep, err - // } - - //返回画家信息 - artistDetailResponse, err := dao.GetArtistInfoByArtistUid(req.ArtistUid) - if err != nil { - return - } - - var ( - realName string - address string - idNum string - telNum string - ) - if artistDetailResponse.RealNameInfo != nil { - realName = artistDetailResponse.RealNameInfo.Name - address = artistDetailResponse.RealNameInfo.Address - idNum = artistDetailResponse.RealNameInfo.IdNum - telNum = artistDetailResponse.RealNameInfo.TelNum - } else { - fmt.Printf("用户%s 实名信息为空", artistDetailResponse.MgmtArtistUid) - } - - 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"] = realName - parameterMap["PartyAAddress"] = address - parameterMap["PartyAIdentityCard"] = idNum - parameterMap["PartyATelNum"] = artistDetailResponse.TelNum - 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), - } - - fmt.Println("合同111") - 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", - } - - fmt.Println("合同11") - _, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest) - if err != nil { - return rep, err - } - - fmt.Println("合同1") - //更新合同表,将合同的下载、在线、id保存 - err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo) - if err != nil { - return rep, err - } - fmt.Println("合同2") - - 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"] = realName - parameterMap["partyAAddress"] = address - parameterMap["partyAIdentityCard"] = idNum - parameterMap["partyATelNum"] = telNum - 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 := GetArtworkProfileByArtworkUid(contractInfo.ArtworkUid) - if err != nil { - return rep, err - } - - var parameterMap = make(map[string]string) - parameterMap["PartyAName"] = realName - parameterMap["PartyAIdCard"] = idNum - 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 := 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 := 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.RealNameInfo.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.ContractUid) - 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: artistDetailResponse.CustomerId, - ReturnUrl: fmt.Sprintf("%v/contractwrite?htmltype=%s&envtype=%s&token= %s", "192.168.10.7", req.HtmlType, req.EnvType, req.Token), - DocTitle: contractInfo.ContractId, - OpenEnvironment: "0", - MobileSignType: "2", - SignKeyword: signKeyword, - Keyx: "100", - Keyy: "-5", - SignatureShowTime: signShowTime, - PcHandSignature: "2", - } - - jumpCommonResponse, err := service.ContractImpl.ExtSign(context.Background(), extSignRequest) - if err != nil { - return rep, err - } - - err = dao.UpdateContractTx(tx, contractInfo.Uid, transactionId) - if err != nil { - return - } - rep.JumpUrl = jumpCommonResponse.JumpUrl - - return rep, nil + //更新合同状态并获取合同信息 + err = dao.UpdateContract(tx, req) + return } func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) { @@ -649,6 +229,440 @@ func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *con return } +// func (a *Contract) SignContract(req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error) { +// rep = &contract.SignContractRespond{} + +// //遇到错误数据库回滚 +// tx := db.DB.Begin() + +// //根据合同uid获取具体合同信息 +// contractInfo, err := dao.GetContractInfo(req.ContractUid) +// if err != nil { +// return +// } + +// // //根据画家id获取画家具体信息 +// // artistDetailResponse, customerId, err := GetArtistInfoById(req.ArtistUid) +// // if err != nil { +// // return rep, err +// // } + +// //返回画家信息 +// artistDetailResponse, err := dao.GetArtistInfoByArtistUid(req.ArtistUid) +// if err != nil { +// return +// } + +// var ( +// realName string +// address string +// idNum string +// telNum string +// ) +// if artistDetailResponse.RealNameInfo != nil { +// realName = artistDetailResponse.RealNameInfo.Name +// address = artistDetailResponse.RealNameInfo.Address +// idNum = artistDetailResponse.RealNameInfo.IdNum +// telNum = artistDetailResponse.RealNameInfo.TelNum +// } else { +// fmt.Printf("用户%s 实名信息为空", artistDetailResponse.MgmtArtistUid) +// } + +// 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"] = realName +// parameterMap["PartyAAddress"] = address +// parameterMap["PartyAIdentityCard"] = idNum +// parameterMap["PartyATelNum"] = artistDetailResponse.TelNum +// 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), +// } + +// fmt.Println("合同111") +// 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", +// } + +// fmt.Println("合同11") +// _, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest) +// if err != nil { +// return rep, err +// } + +// fmt.Println("合同1") +// //更新合同表,将合同的下载、在线、id保存 +// err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo) +// if err != nil { +// return rep, err +// } +// fmt.Println("合同2") + +// 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"] = realName +// parameterMap["partyAAddress"] = address +// parameterMap["partyAIdentityCard"] = idNum +// parameterMap["partyATelNum"] = telNum +// 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 := GetArtworkProfileByArtworkUid(contractInfo.ArtworkUid) +// if err != nil { +// return rep, err +// } + +// var parameterMap = make(map[string]string) +// parameterMap["partyAName"] = realName +// parameterMap["partyAIdCard"] = idNum +// 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 := 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 := 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.RealNameInfo.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.ContractUid) +// 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: artistDetailResponse.CustomerId, +// ReturnUrl: fmt.Sprintf("%v/contractwrite?htmltype=%s&envtype=%s&token= %s", "192.168.10.7", req.HtmlType, req.EnvType, req.Token), +// DocTitle: contractInfo.ContractId, +// OpenEnvironment: "0", +// MobileSignType: "2", +// SignKeyword: signKeyword, +// Keyx: "100", +// Keyy: "-5", +// SignatureShowTime: signShowTime, +// PcHandSignature: "2", +// } + +// jumpCommonResponse, err := service.ContractImpl.ExtSign(context.Background(), extSignRequest) +// if err != nil { +// return rep, err +// } + +// err = dao.UpdateContractTx(tx, contractInfo.Uid, transactionId) +// if err != nil { +// return +// } +// rep.JumpUrl = jumpCommonResponse.JumpUrl + +// return rep, nil +// } + func (a *Contract) GetContractInfoByContractUid(req *contract.GetContractInfoByContractUidRequest) (rep *contract.GetContractInfoByContractUidRespond, err error) { rep = &contract.GetContractInfoByContractUidRespond{} diff --git a/pb/contract/contract.pb.go b/pb/contract/contract.pb.go index fd13153..5a76445 100644 --- a/pb/contract/contract.pb.go +++ b/pb/contract/contract.pb.go @@ -522,11 +522,15 @@ type SignContractRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ArtistUid string `protobuf:"bytes,1,opt,name=ArtistUid,json=artist_uid,proto3" json:"ArtistUid,omitempty"` - ContractUid string `protobuf:"bytes,2,opt,name=ContractUid,json=contract_uid,proto3" json:"ContractUid,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,json=token,proto3" json:"Token,omitempty"` - HtmlType string `protobuf:"bytes,4,opt,name=HtmlType,json=html_type,proto3" json:"HtmlType,omitempty"` - EnvType string `protobuf:"bytes,5,opt,name=EnvType,json=env_type,proto3" json:"EnvType,omitempty"` + ArtistUid string `protobuf:"bytes,1,opt,name=ArtistUid,json=artist_uid,proto3" json:"ArtistUid,omitempty"` + ContractUid string `protobuf:"bytes,2,opt,name=ContractUid,json=contract_uid,proto3" json:"ContractUid,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token,json=token,proto3" json:"Token,omitempty"` + HtmlType string `protobuf:"bytes,4,opt,name=HtmlType,json=html_type,proto3" json:"HtmlType,omitempty"` + EnvType string `protobuf:"bytes,5,opt,name=EnvType,json=env_type,proto3" json:"EnvType,omitempty"` + ViewPdfUrl string `protobuf:"bytes,6,opt,name=ViewPdfUrl,json=view_pdf_url,proto3" json:"ViewPdfUrl,omitempty"` + DownloadUrl string `protobuf:"bytes,7,opt,name=DownloadUrl,json=download_url,proto3" json:"DownloadUrl,omitempty"` + ContractNo string `protobuf:"bytes,8,opt,name=ContractNo,json=contract_no,proto3" json:"ContractNo,omitempty"` + TransactionId string `protobuf:"bytes,9,opt,name=TransactionId,json=transaction_id,proto3" json:"TransactionId,omitempty"` } func (x *SignContractRequest) Reset() { @@ -596,6 +600,34 @@ func (x *SignContractRequest) GetEnvType() string { return "" } +func (x *SignContractRequest) GetViewPdfUrl() string { + if x != nil { + return x.ViewPdfUrl + } + return "" +} + +func (x *SignContractRequest) GetDownloadUrl() string { + if x != nil { + return x.DownloadUrl + } + return "" +} + +func (x *SignContractRequest) GetContractNo() string { + if x != nil { + return x.ContractNo + } + return "" +} + +func (x *SignContractRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + type SignContractRespond struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1399,7 +1431,7 @@ var file_contract_proto_rawDesc = []byte{ 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6d, 0x73, 0x67, 0x22, 0xa5, 0x01, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, + 0x03, 0x6d, 0x73, 0x67, 0x22, 0xb2, 0x02, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0b, 0x43, @@ -1409,136 +1441,145 @@ var file_contract_proto_rawDesc = []byte{ 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x08, 0x48, 0x74, 0x6d, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x74, 0x6d, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x07, 0x45, 0x6e, 0x76, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x42, 0x0a, 0x13, - 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x07, 0x4a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x12, 0x10, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, - 0x22, 0x3e, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x22, 0x5b, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, - 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x4d, - 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x6e, 0x0a, - 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x58, 0x0a, - 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0a, + 0x56, 0x69, 0x65, 0x77, 0x50, 0x64, 0x66, 0x55, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70, 0x64, 0x66, 0x5f, 0x75, 0x72, 0x6c, 0x12, 0x21, + 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x75, 0x72, + 0x6c, 0x12, 0x1f, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4e, 0x6f, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, + 0x6e, 0x6f, 0x12, 0x25, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x42, 0x0a, 0x13, 0x53, 0x69, 0x67, + 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, + 0x12, 0x19, 0x0a, 0x07, 0x4a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x3e, 0x0a, + 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x5b, 0x0a, + 0x15, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x73, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x6e, 0x0a, 0x15, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x58, 0x0a, 0x15, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x52, 0x04, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6d, 0x73, 0x67, 0x22, 0x49, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x55, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0b, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x66, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x52, - 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x49, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, - 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x66, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, - 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x44, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, - 0x22, 0xfd, 0x03, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x67, - 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6d, 0x67, 0x6d, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x72, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, - 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x69, - 0x65, 0x77, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x69, 0x65, - 0x77, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, - 0x55, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, - 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, - 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, - 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x4f, 0x0a, 0x17, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x32, 0xe3, 0x05, 0x0a, 0x0e, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x60, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x61, 0x72, 0x74, - 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x10, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x12, 0x27, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xfd, 0x03, + 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x63, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x67, 0x6d, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x67, 0x6d, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x72, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x69, 0x65, 0x77, 0x55, + 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x69, 0x65, 0x77, 0x55, 0x72, + 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x45, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x17, 0x0a, + 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x4f, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x64, 0x32, 0xe3, 0x05, 0x0a, 0x0e, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x60, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x67, 0x6d, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, - 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x23, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x5a, - 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x23, - 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0e, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x61, - 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, - 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, - 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x8a, - 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x12, - 0x33, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, - 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x42, 0x13, 0x5a, 0x11, 0x2e, - 0x2f, 0x3b, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x12, 0x27, 0x2e, 0x61, 0x72, + 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x67, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, + 0x5a, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x23, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0c, 0x53, + 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x23, 0x2e, 0x61, 0x72, + 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0e, 0x46, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, 0x2e, 0x61, 0x72, + 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x54, 0x78, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x1c, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, + 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x12, 0x33, 0x2e, 0x61, + 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x33, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x42, 0x13, 0x5a, 0x11, 0x2e, 0x2f, 0x3b, 0x61, + 0x72, 0x74, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/contract/contract.proto b/pb/contract/contract.proto index b8e0964..837c7c9 100644 --- a/pb/contract/contract.proto +++ b/pb/contract/contract.proto @@ -73,6 +73,10 @@ message SignContractRequest { string Token = 3 [json_name="token"]; string HtmlType = 4 [json_name="html_type"]; string EnvType = 5 [json_name= "env_type"]; + string ViewPdfUrl = 6 [json_name= "view_pdf_url"]; + string DownloadUrl = 7 [json_name= "download_url"]; + string ContractNo = 8 [json_name= "contract_no"]; + string TransactionId = 9 [json_name= "transaction_id"]; } message SignContractRespond {