52 lines
1.6 KiB
Go
52 lines
1.6 KiB
Go
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
|
||
}
|