This commit is contained in:
parent
fda56a4690
commit
7ccdfe6cb3
@ -19,4 +19,11 @@ https://cdns.fontree.cn/fonchain-main/test/image/0/chain-dci/file/b2b9ebf8-5e8a-
|
||||
```text
|
||||
1,不需要的参数就不设置
|
||||
2,文件像素要求是 下限400*400,上限5000*5000
|
||||
```
|
||||
|
||||
|
||||
### protot文件编译指令
|
||||
|
||||
```shell
|
||||
protoc --proto_path=. --proto_path=D:/go_workspace/src --go_out=./pb --govalidators_out=./pb --go-triple_out=./pb ./pb/dci.proto
|
||||
```
|
@ -8,7 +8,6 @@ import (
|
||||
"chain-dci/pkg/app"
|
||||
"fmt"
|
||||
"google.golang.org/grpc"
|
||||
"gorm.io/gorm"
|
||||
"net"
|
||||
|
||||
//common "chain-dci/pkg/init"
|
||||
@ -21,7 +20,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func NewApp(Lg *zap.Logger, JaegerTracer *tracing.JaegerProvider, BccrClient *bccrClient.Client, SfNode *snowflake.Node, DciDB *gorm.DB) *app.App {
|
||||
func NewApp(Lg *zap.Logger, JaegerTracer *tracing.JaegerProvider, BccrClient *bccrClient.Client, SfNode *snowflake.Node) *app.App {
|
||||
return &app.App{
|
||||
Lg: Lg,
|
||||
JaegerTracer: JaegerTracer,
|
||||
|
@ -7,7 +7,6 @@ package main
|
||||
import (
|
||||
"chain-dci/pkg/app"
|
||||
"chain-dci/pkg/bccr"
|
||||
"chain-dci/pkg/db"
|
||||
"chain-dci/pkg/logger"
|
||||
"chain-dci/pkg/snowf"
|
||||
"chain-dci/pkg/tracing"
|
||||
@ -15,6 +14,6 @@ import (
|
||||
)
|
||||
|
||||
func InitApp() (*app.App, error) {
|
||||
wire.Build(logger.Provider, tracing.Provider, bccr.Provider, snowf.Provider, db.DciProvider, NewApp)
|
||||
wire.Build(logger.Provider, tracing.Provider, bccr.Provider, snowf.Provider, NewApp)
|
||||
return &app.App{}, nil
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ package main
|
||||
import (
|
||||
"chain-dci/pkg/app"
|
||||
"chain-dci/pkg/bccr"
|
||||
"chain-dci/pkg/db"
|
||||
"chain-dci/pkg/logger"
|
||||
"chain-dci/pkg/snowf"
|
||||
"chain-dci/pkg/tracing"
|
||||
@ -28,7 +27,6 @@ func InitApp() (*app.App, error) {
|
||||
jaegerProvider := tracing.NewTracing()
|
||||
client := bccr.NewBccrClient()
|
||||
node := snowf.NewSf()
|
||||
gormDB := db.NewDci()
|
||||
appApp := NewApp(zapLogger, jaegerProvider, client, node, gormDB)
|
||||
appApp := NewApp(zapLogger, jaegerProvider, client, node)
|
||||
return appApp, nil
|
||||
}
|
||||
|
16
pb/dci.proto
16
pb/dci.proto
@ -58,7 +58,7 @@ message AddDciUserRequest {
|
||||
string legalPersonCertNo = 8 [json_name = "legalPersonCertNo"];
|
||||
string phone = 9 [json_name = "phone",(validator.field) = {string_not_empty: true,human_error:"手机号不能为空"}];
|
||||
string areaType = 10 [json_name = "areaType",(validator.field) = {string_not_empty: true,human_error:"所属地区不能为空"}];
|
||||
string clientToken = 11 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 11 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message AddDciUserResponse {
|
||||
@ -75,7 +75,7 @@ message UpdateDciUserRequest {
|
||||
string certFrontFileId = 2 [json_name = "certFrontFileId",(validator.field) = {string_not_empty: true,human_error:"证件正面文件路径不能为空"}];
|
||||
string certBackFileId = 3 [json_name = "certBackFileId"];
|
||||
string phone = 4 [json_name = "phone"];
|
||||
string clientToken = 5 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 5 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message UpdateDciUserResponse {
|
||||
@ -121,7 +121,7 @@ message CreateDciPreregistrationRequest {
|
||||
DciRightInfo rightInfo = 11 [json_name = "rightInfo",(validator.field) = {string_not_empty: true,human_error:"权利信息不能为空"}];
|
||||
string preRegistrationTrueWill = 12 [json_name = "preRegistrationTrueWill",(validator.field) = {string_not_empty: true,human_error:"真实意愿表达信息不能为空"}];
|
||||
repeated string copyrightOwnerIds = 13 [json_name = "copyrightOwnerIds",(validator.field) = {string_not_empty: true,human_error:"著作权人用户id列表不能为空"}];
|
||||
string clientToken = 14 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 14 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message DciCreationInfo {
|
||||
@ -189,7 +189,7 @@ message CreateDciRegistrationRequest {
|
||||
DciExplanationInfo explanationInfo = 2 [json_name = "explanationInfo",(validator.field) = {string_not_empty: true,human_error:"作品创作说明不能为空"}];
|
||||
InvoiceInfo invoiceInfo = 3 [json_name = "invoiceInfo",(validator.field) = {string_not_empty: true,human_error:"发票信息不能为空"}];
|
||||
AdditionalFileInfo additionalFileInfo = 4 [json_name = "additionalFileInfo"];
|
||||
string clientToken = 5 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 5 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message DciExplanationInfo {
|
||||
@ -252,7 +252,7 @@ message QueryDciRegistrationResponse {
|
||||
// 数登 数登支付链接获取
|
||||
message GetDciPayUrlRequest {
|
||||
string digitalRegisterId = 1 [json_name = "digitalRegisterId",(validator.field) = {string_not_empty: true,human_error:"数登申请ID不能为空"}];
|
||||
string clientToken = 2 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 2 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message GetDciPayUrlResponse {
|
||||
@ -277,7 +277,7 @@ message QueryDciPayResponse {
|
||||
// 数登 获取数登证书下载
|
||||
message GetDciRegistrationcertRequest {
|
||||
string digitalRegisterId = 1 [json_name = "digitalRegisterId",(validator.field) = {string_not_empty: true,human_error:"数登申请ID不能为空"}];
|
||||
string clientToken = 2 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 2 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message GetDciRegistrationcertResponse {
|
||||
@ -296,7 +296,7 @@ message RetryDciRegistrationRequest {
|
||||
string dciContentId = 2 [json_name = "dciContentId"];
|
||||
DciExplanationInfo explanationInfo = 3 [json_name = "explanationInfo"];
|
||||
AdditionalFileInfo additionalFileInfo = 4 [json_name = "additionalFileInfo"];
|
||||
string clientToken = 5 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 5 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
message RetryDciRegistrationResponse {
|
||||
@ -310,7 +310,7 @@ message CloseDciRegistrationRequest {
|
||||
string digitalRegisterId = 1 [json_name = "digitalRegisterId",(validator.field) = {string_not_empty: true,human_error:"数登申请ID不能为空"}];
|
||||
string name = 2 [json_name = "name",(validator.field) = {string_not_empty: true,length_lt: 41,human_error:"退费人名称不能为空"}];
|
||||
string mobileNo = 3 [json_name = "mobileNo",(validator.field) = {string_not_empty: true,human_error:"联系手机号不能为空"}];
|
||||
string clientToken = 5 [json_name = "clientToken",(validator.field) = {string_not_empty: true,human_error:"客户端token不能为空"}];
|
||||
string clientToken = 5 [json_name = "clientToken"];
|
||||
}
|
||||
|
||||
|
||||
|
1160
pb/dci/dci.pb.go
1160
pb/dci/dci.pb.go
File diff suppressed because it is too large
Load Diff
@ -45,9 +45,6 @@ func (this *AddDciUserRequest) Validate() error {
|
||||
if this.AreaType == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("AreaType", fmt.Errorf(`所属地区不能为空`))
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *AddDciUserResponse) Validate() error {
|
||||
@ -60,9 +57,6 @@ func (this *UpdateDciUserRequest) Validate() error {
|
||||
if this.CertFrontFileId == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("CertFrontFileId", fmt.Errorf(`证件正面文件路径不能为空`))
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateDciUserResponse) Validate() error {
|
||||
@ -131,9 +125,6 @@ func (this *CreateDciPreregistrationRequest) Validate() error {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("CopyrightOwnerIds", fmt.Errorf(`著作权人用户id列表不能为空`))
|
||||
}
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DciCreationInfo) Validate() error {
|
||||
@ -203,9 +194,6 @@ func (this *CreateDciRegistrationRequest) Validate() error {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("AdditionalFileInfo", err)
|
||||
}
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DciExplanationInfo) Validate() error {
|
||||
@ -257,9 +245,6 @@ func (this *GetDciPayUrlRequest) Validate() error {
|
||||
if this.DigitalRegisterId == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DigitalRegisterId", fmt.Errorf(`数登申请ID不能为空`))
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetDciPayUrlResponse) Validate() error {
|
||||
@ -278,9 +263,6 @@ func (this *GetDciRegistrationcertRequest) Validate() error {
|
||||
if this.DigitalRegisterId == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DigitalRegisterId", fmt.Errorf(`数登申请ID不能为空`))
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetDciRegistrationcertResponse) Validate() error {
|
||||
@ -300,9 +282,6 @@ func (this *RetryDciRegistrationRequest) Validate() error {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("AdditionalFileInfo", err)
|
||||
}
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *RetryDciRegistrationResponse) Validate() error {
|
||||
@ -321,9 +300,6 @@ func (this *CloseDciRegistrationRequest) Validate() error {
|
||||
if this.MobileNo == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("MobileNo", fmt.Errorf(`联系手机号不能为空`))
|
||||
}
|
||||
if this.ClientToken == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ClientToken", fmt.Errorf(`客户端token不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *CloseDciRegistrationResponse) Validate() error {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// - protoc v3.21.4
|
||||
// source: pb/dci.proto
|
||||
|
||||
package grpc
|
||||
package dci
|
||||
|
||||
import (
|
||||
context "context"
|
@ -4,7 +4,7 @@
|
||||
// - protoc v3.21.4
|
||||
// source: pb/dci.proto
|
||||
|
||||
package dci
|
||||
package grpc
|
||||
|
||||
import (
|
||||
context "context"
|
@ -2,12 +2,11 @@ package db
|
||||
|
||||
import (
|
||||
dciConfig "chain-dci/config"
|
||||
"github.com/google/wire"
|
||||
"gorm.io/gorm"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var DciProvider = wire.NewSet(NewDci)
|
||||
//var DciProvider = wire.NewSet(NewDci)
|
||||
|
||||
func NewDci() *gorm.DB {
|
||||
connDci := strings.Join([]string{dciConfig.Data.ChainDci.User, ":", dciConfig.Data.ChainDci.Password,
|
||||
|
Loading…
Reference in New Issue
Block a user