Compare commits
No commits in common. "cjy" and "main" have entirely different histories.
@ -39,12 +39,6 @@ func (d *DciProvider) UpdateDciUser(_ context.Context, req *dci.UpdateDciUserReq
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DciProvider) UpdateDciEnterpriseUser(_ context.Context, req *dci.UpdateDciEnterpriseUserRequest) (res *dci.UpdateDciEnterpriseUserResponse, err error) {
|
|
||||||
res = new(dci.UpdateDciEnterpriseUserResponse)
|
|
||||||
res, err = d.dciUser.UpdateDciEnterpriseUser(req)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *DciProvider) QueryDciUser(_ context.Context, req *dci.QueryDciUserRequest) (res *dci.QueryDciUserResponse, err error) {
|
func (d *DciProvider) QueryDciUser(_ context.Context, req *dci.QueryDciUserRequest) (res *dci.QueryDciUserResponse, err error) {
|
||||||
res = new(dci.QueryDciUserResponse)
|
res = new(dci.QueryDciUserResponse)
|
||||||
res, err = d.dciUser.QueryDciUser(req)
|
res, err = d.dciUser.QueryDciUser(req)
|
||||||
|
@ -5,16 +5,14 @@ import (
|
|||||||
"chain-dci/pkg/app"
|
"chain-dci/pkg/app"
|
||||||
errCommon "chain-dci/pkg/err"
|
errCommon "chain-dci/pkg/err"
|
||||||
"chain-dci/pkg/msg"
|
"chain-dci/pkg/msg"
|
||||||
"time"
|
|
||||||
|
|
||||||
bccrClient "github.com/antchain-openapi-sdk-go/bccr/client"
|
bccrClient "github.com/antchain-openapi-sdk-go/bccr/client"
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IDciUser interface {
|
type IDciUser interface {
|
||||||
AddDciUser(req *dci.AddDciUserRequest) (res *dci.AddDciUserResponse, err error)
|
AddDciUser(req *dci.AddDciUserRequest) (res *dci.AddDciUserResponse, err error)
|
||||||
UpdateDciUser(req *dci.UpdateDciUserRequest) (res *dci.UpdateDciUserResponse, err error)
|
UpdateDciUser(req *dci.UpdateDciUserRequest) (res *dci.UpdateDciUserResponse, err error)
|
||||||
UpdateDciEnterpriseUser(req *dci.UpdateDciEnterpriseUserRequest) (res *dci.UpdateDciEnterpriseUserResponse, err error)
|
|
||||||
QueryDciUser(req *dci.QueryDciUserRequest) (res *dci.QueryDciUserResponse, err error)
|
QueryDciUser(req *dci.QueryDciUserRequest) (res *dci.QueryDciUserResponse, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,44 +73,6 @@ func (u *DciUser) UpdateDciUser(req *dci.UpdateDciUserRequest) (res *dci.UpdateD
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateDciEnterpriseUser 企业著作权人 更新 DCI信息
|
|
||||||
func (u *DciUser) UpdateDciEnterpriseUser(req *dci.UpdateDciEnterpriseUserRequest) (res *dci.UpdateDciEnterpriseUserResponse, err error) {
|
|
||||||
errCommon.NoReturnInfo(req, "企业著作权人 更新 DCI信息 参数信息: ")
|
|
||||||
|
|
||||||
res = new(dci.UpdateDciEnterpriseUserResponse)
|
|
||||||
|
|
||||||
updateEnterpriseUserRequest := new(bccrClient.UpdateDciUserRequest)
|
|
||||||
// 构建企业用户更新请求
|
|
||||||
updateEnterpriseUserRequest.SetDciUserId(req.DciUserId)
|
|
||||||
updateEnterpriseUserRequest.SetCertFrontFileId(req.CertificateFrontFileId)
|
|
||||||
updateEnterpriseUserRequest.SetPhone(req.Phone)
|
|
||||||
|
|
||||||
updateEnterpriseUserRequest.SetLegalPersonInfo(&bccrClient.EnterpriseLegalPersonInfo{
|
|
||||||
LegalPersonCertName: &req.LegalPersonCertName,
|
|
||||||
LegalPersonCertType: &req.LegalPersonCertType,
|
|
||||||
LegalPersonCertNo: &req.LegalPersonCertNo,
|
|
||||||
})
|
|
||||||
|
|
||||||
// 创建clientToken,包含企业特有信息
|
|
||||||
clientToken, err := createToken(time.Now().UnixMilli(), req.DciUserId, req.CertificateFrontFileId, req.Phone, app.ModuleClients.SfNode.Generate().Base64())
|
|
||||||
if err != nil {
|
|
||||||
return nil, errCommon.ReturnError(err, msg.ErrCreateClientToken, "创建企业用户clientToken 失败: ")
|
|
||||||
}
|
|
||||||
updateEnterpriseUserRequest.SetClientToken(clientToken)
|
|
||||||
|
|
||||||
// 调用底层API
|
|
||||||
updateEnterpriseUserResponse, err := app.ModuleClients.BccrClient.UpdateDciUser(updateEnterpriseUserRequest)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errCommon.ReturnError(err, msg.ErrUpdateDciUser, "企业著作权人 更新 DCI信息 失败: ")
|
|
||||||
}
|
|
||||||
|
|
||||||
errCommon.NoReturnInfo(updateEnterpriseUserResponse, "企业著作权人 更新 DCI信息 成功: ")
|
|
||||||
|
|
||||||
_ = copier.CopyWithOption(&res, updateEnterpriseUserResponse, copier.Option{DeepCopy: false})
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryDciUser 著作权人 查询 DCI信息
|
// QueryDciUser 著作权人 查询 DCI信息
|
||||||
func (u *DciUser) QueryDciUser(req *dci.QueryDciUserRequest) (res *dci.QueryDciUserResponse, err error) {
|
func (u *DciUser) QueryDciUser(req *dci.QueryDciUserRequest) (res *dci.QueryDciUserResponse, err error) {
|
||||||
errCommon.NoReturnInfo(req, "著作权人 查询 DCI信息 参数信息: ")
|
errCommon.NoReturnInfo(req, "著作权人 查询 DCI信息 参数信息: ")
|
||||||
|
17
pb/dci.proto
17
pb/dci.proto
@ -13,7 +13,6 @@ service Dci {
|
|||||||
// dci user
|
// dci user
|
||||||
rpc AddDciUser(AddDciUserRequest) returns (AddDciUserResponse);
|
rpc AddDciUser(AddDciUserRequest) returns (AddDciUserResponse);
|
||||||
rpc UpdateDciUser(UpdateDciUserRequest) returns (UpdateDciUserResponse);
|
rpc UpdateDciUser(UpdateDciUserRequest) returns (UpdateDciUserResponse);
|
||||||
rpc UpdateDciEnterpriseUser(UpdateDciEnterpriseUserRequest) returns (UpdateDciEnterpriseUserResponse); // 更新企业用户
|
|
||||||
rpc QueryDciUser(QueryDciUserRequest) returns (QueryDciUserResponse);
|
rpc QueryDciUser(QueryDciUserRequest) returns (QueryDciUserResponse);
|
||||||
|
|
||||||
// dci work
|
// dci work
|
||||||
@ -356,20 +355,4 @@ message QueryDciFeedbackResponse {
|
|||||||
string feedbackStatus = 5 [json_name = "feedbackStatus"];
|
string feedbackStatus = 5 [json_name = "feedbackStatus"];
|
||||||
string DciContentId = 6 [json_name = "DciContentId"];
|
string DciContentId = 6 [json_name = "DciContentId"];
|
||||||
string msg = 7 [json_name = "msg"];
|
string msg = 7 [json_name = "msg"];
|
||||||
}
|
|
||||||
// Dci enterprise user 更新 - 专门用于企业用户
|
|
||||||
message UpdateDciEnterpriseUserRequest {
|
|
||||||
string dciUserId = 1 [json_name = "dciUserId",(validator.field) = {string_not_empty: true,human_error:"dci用户ID不能为空"}];
|
|
||||||
string certificateFrontFileId = 2 [json_name = "certificateFrontFileId",(validator.field) = {string_not_empty: true,human_error:"企业营业执照文件路径不能为空"}];
|
|
||||||
string legalPersonCertName = 3 [json_name = "legalPersonCertName"];
|
|
||||||
string legalPersonCertType = 4 [json_name = "legalPersonCertType"];
|
|
||||||
string legalPersonCertNo = 5 [json_name = "legalPersonCertNo"];
|
|
||||||
string phone = 6 [json_name = "phone"];
|
|
||||||
string clientToken = 7 [json_name = "clientToken"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message UpdateDciEnterpriseUserResponse {
|
|
||||||
string resultCode = 1 [json_name = "resultCode"];
|
|
||||||
string resultMsg = 2 [json_name = "resultMsg"];
|
|
||||||
string reqMsgId = 3 [json_name = "reqMsgId"];
|
|
||||||
}
|
}
|
848
pb/dci/dci.pb.go
848
pb/dci/dci.pb.go
File diff suppressed because it is too large
Load Diff
@ -335,15 +335,3 @@ func (this *QueryDciFeedbackRequest) Validate() error {
|
|||||||
func (this *QueryDciFeedbackResponse) Validate() error {
|
func (this *QueryDciFeedbackResponse) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *UpdateDciEnterpriseUserRequest) Validate() error {
|
|
||||||
if this.DciUserId == "" {
|
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("DciUserId", fmt.Errorf(`dci用户ID不能为空`))
|
|
||||||
}
|
|
||||||
if this.CertificateFrontFileId == "" {
|
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("CertificateFrontFileId", fmt.Errorf(`企业营业执照文件路径不能为空`))
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *UpdateDciEnterpriseUserResponse) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-triple v1.0.8
|
// - protoc-gen-go-triple v1.0.5
|
||||||
// - protoc v3.21.1
|
// - protoc v5.29.0--rc3
|
||||||
// source: pb/dci.proto
|
// source: pb/dci.proto
|
||||||
|
|
||||||
package dci
|
package dci
|
||||||
@ -33,7 +33,6 @@ type DciClient interface {
|
|||||||
// dci user
|
// dci user
|
||||||
AddDciUser(ctx context.Context, in *AddDciUserRequest, opts ...grpc_go.CallOption) (*AddDciUserResponse, common.ErrorWithAttachment)
|
AddDciUser(ctx context.Context, in *AddDciUserRequest, opts ...grpc_go.CallOption) (*AddDciUserResponse, common.ErrorWithAttachment)
|
||||||
UpdateDciUser(ctx context.Context, in *UpdateDciUserRequest, opts ...grpc_go.CallOption) (*UpdateDciUserResponse, common.ErrorWithAttachment)
|
UpdateDciUser(ctx context.Context, in *UpdateDciUserRequest, opts ...grpc_go.CallOption) (*UpdateDciUserResponse, common.ErrorWithAttachment)
|
||||||
UpdateDciEnterpriseUser(ctx context.Context, in *UpdateDciEnterpriseUserRequest, opts ...grpc_go.CallOption) (*UpdateDciEnterpriseUserResponse, common.ErrorWithAttachment)
|
|
||||||
QueryDciUser(ctx context.Context, in *QueryDciUserRequest, opts ...grpc_go.CallOption) (*QueryDciUserResponse, common.ErrorWithAttachment)
|
QueryDciUser(ctx context.Context, in *QueryDciUserRequest, opts ...grpc_go.CallOption) (*QueryDciUserResponse, common.ErrorWithAttachment)
|
||||||
// dci work
|
// dci work
|
||||||
CreateDciPreregistration(ctx context.Context, in *CreateDciPreregistrationRequest, opts ...grpc_go.CallOption) (*CreateDciPreregistrationResponse, common.ErrorWithAttachment)
|
CreateDciPreregistration(ctx context.Context, in *CreateDciPreregistrationRequest, opts ...grpc_go.CallOption) (*CreateDciPreregistrationResponse, common.ErrorWithAttachment)
|
||||||
@ -58,7 +57,6 @@ type DciClientImpl struct {
|
|||||||
GetUploadUrl func(ctx context.Context, in *GetUploadUrlRequest) (*GetUploadUrlResponse, error)
|
GetUploadUrl func(ctx context.Context, in *GetUploadUrlRequest) (*GetUploadUrlResponse, error)
|
||||||
AddDciUser func(ctx context.Context, in *AddDciUserRequest) (*AddDciUserResponse, error)
|
AddDciUser func(ctx context.Context, in *AddDciUserRequest) (*AddDciUserResponse, error)
|
||||||
UpdateDciUser func(ctx context.Context, in *UpdateDciUserRequest) (*UpdateDciUserResponse, error)
|
UpdateDciUser func(ctx context.Context, in *UpdateDciUserRequest) (*UpdateDciUserResponse, error)
|
||||||
UpdateDciEnterpriseUser func(ctx context.Context, in *UpdateDciEnterpriseUserRequest) (*UpdateDciEnterpriseUserResponse, error)
|
|
||||||
QueryDciUser func(ctx context.Context, in *QueryDciUserRequest) (*QueryDciUserResponse, error)
|
QueryDciUser func(ctx context.Context, in *QueryDciUserRequest) (*QueryDciUserResponse, error)
|
||||||
CreateDciPreregistration func(ctx context.Context, in *CreateDciPreregistrationRequest) (*CreateDciPreregistrationResponse, error)
|
CreateDciPreregistration func(ctx context.Context, in *CreateDciPreregistrationRequest) (*CreateDciPreregistrationResponse, error)
|
||||||
QueryDciPreregistration func(ctx context.Context, in *QueryDciPreregistrationRequest) (*QueryDciPreregistrationResponse, error)
|
QueryDciPreregistration func(ctx context.Context, in *QueryDciPreregistrationRequest) (*QueryDciPreregistrationResponse, error)
|
||||||
@ -103,12 +101,6 @@ func (c *dciClient) UpdateDciUser(ctx context.Context, in *UpdateDciUserRequest,
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateDciUser", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateDciUser", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *dciClient) UpdateDciEnterpriseUser(ctx context.Context, in *UpdateDciEnterpriseUserRequest, opts ...grpc_go.CallOption) (*UpdateDciEnterpriseUserResponse, common.ErrorWithAttachment) {
|
|
||||||
out := new(UpdateDciEnterpriseUserResponse)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateDciEnterpriseUser", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *dciClient) QueryDciUser(ctx context.Context, in *QueryDciUserRequest, opts ...grpc_go.CallOption) (*QueryDciUserResponse, common.ErrorWithAttachment) {
|
func (c *dciClient) QueryDciUser(ctx context.Context, in *QueryDciUserRequest, opts ...grpc_go.CallOption) (*QueryDciUserResponse, common.ErrorWithAttachment) {
|
||||||
out := new(QueryDciUserResponse)
|
out := new(QueryDciUserResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -190,7 +182,6 @@ type DciServer interface {
|
|||||||
// dci user
|
// dci user
|
||||||
AddDciUser(context.Context, *AddDciUserRequest) (*AddDciUserResponse, error)
|
AddDciUser(context.Context, *AddDciUserRequest) (*AddDciUserResponse, error)
|
||||||
UpdateDciUser(context.Context, *UpdateDciUserRequest) (*UpdateDciUserResponse, error)
|
UpdateDciUser(context.Context, *UpdateDciUserRequest) (*UpdateDciUserResponse, error)
|
||||||
UpdateDciEnterpriseUser(context.Context, *UpdateDciEnterpriseUserRequest) (*UpdateDciEnterpriseUserResponse, error)
|
|
||||||
QueryDciUser(context.Context, *QueryDciUserRequest) (*QueryDciUserResponse, error)
|
QueryDciUser(context.Context, *QueryDciUserRequest) (*QueryDciUserResponse, error)
|
||||||
// dci work
|
// dci work
|
||||||
CreateDciPreregistration(context.Context, *CreateDciPreregistrationRequest) (*CreateDciPreregistrationResponse, error)
|
CreateDciPreregistration(context.Context, *CreateDciPreregistrationRequest) (*CreateDciPreregistrationResponse, error)
|
||||||
@ -222,9 +213,6 @@ func (UnimplementedDciServer) AddDciUser(context.Context, *AddDciUserRequest) (*
|
|||||||
func (UnimplementedDciServer) UpdateDciUser(context.Context, *UpdateDciUserRequest) (*UpdateDciUserResponse, error) {
|
func (UnimplementedDciServer) UpdateDciUser(context.Context, *UpdateDciUserRequest) (*UpdateDciUserResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateDciUser not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateDciUser not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedDciServer) UpdateDciEnterpriseUser(context.Context, *UpdateDciEnterpriseUserRequest) (*UpdateDciEnterpriseUserResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateDciEnterpriseUser not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedDciServer) QueryDciUser(context.Context, *QueryDciUserRequest) (*QueryDciUserResponse, error) {
|
func (UnimplementedDciServer) QueryDciUser(context.Context, *QueryDciUserRequest) (*QueryDciUserResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method QueryDciUser not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method QueryDciUser not implemented")
|
||||||
}
|
}
|
||||||
@ -376,35 +364,6 @@ func _Dci_UpdateDciUser_Handler(srv interface{}, ctx context.Context, dec func(i
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Dci_UpdateDciEnterpriseUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UpdateDciEnterpriseUserRequest)
|
|
||||||
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("UpdateDciEnterpriseUser", 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 _Dci_QueryDciUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Dci_QueryDciUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(QueryDciUserRequest)
|
in := new(QueryDciUserRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -772,10 +731,6 @@ var Dci_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "UpdateDciUser",
|
MethodName: "UpdateDciUser",
|
||||||
Handler: _Dci_UpdateDciUser_Handler,
|
Handler: _Dci_UpdateDciUser_Handler,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
MethodName: "UpdateDciEnterpriseUser",
|
|
||||||
Handler: _Dci_UpdateDciEnterpriseUser_Handler,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
MethodName: "QueryDciUser",
|
MethodName: "QueryDciUser",
|
||||||
Handler: _Dci_QueryDciUser_Handler,
|
Handler: _Dci_QueryDciUser_Handler,
|
||||||
|
Loading…
Reference in New Issue
Block a user