app-cloudep-product-service/internal/logic/kyc_service/update_logic.go

52 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package kycservicelogic
import (
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
"context"
"google.golang.org/protobuf/proto"
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdateLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLogic {
return &UpdateLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// Update 更新使用者的 Kyc尚未審核
func (l *UpdateLogic) Update(in *product.UpdateKycInfoReq) (*product.OKResp, error) {
// 如果已完成應該不能
err := l.svcCtx.KYCUseCase.UpdateKYCInfo(l.ctx, in.GetId(), &usecase.KYCUpdateParams{
Name: proto.String(in.GetName()),
Identification: proto.String(in.GetIdentification()),
IdentificationType: proto.String(in.GetIdentificationType()),
Address: proto.String(in.GetAddress()),
PostalCode: proto.String(in.GetPostalCode()),
IDFrontImage: proto.String(in.GetIdFrontImage()),
IDBackImage: proto.String(in.GetIdBackImage()),
BankStatementImg: proto.String(in.GetBankStatementImg()),
BankCode: proto.String(in.GetBankCode()),
BankName: proto.String(in.GetBankName()),
BranchCode: proto.String(in.GetBranchCode()),
BranchName: proto.String(in.GetBranchName()),
BankAccount: proto.String(in.GetBankAccount()),
})
if err != nil {
return nil, err
}
return &product.OKResp{}, nil
}