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

53 lines
1.6 KiB
Go
Raw Permalink Normal View History

2025-04-09 14:46:53 +00:00
package kycservicelogic
2025-04-08 09:20:34 +00:00
import (
"context"
2025-04-10 07:59:30 +00:00
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
2025-04-08 09:20:34 +00:00
"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"
)
2025-04-09 14:46:53 +00:00
type UpdateLogic struct {
2025-04-08 09:20:34 +00:00
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
2025-04-09 14:46:53 +00:00
func NewUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLogic {
return &UpdateLogic{
2025-04-08 09:20:34 +00:00
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
2025-04-09 14:46:53 +00:00
// Update 更新使用者的 Kyc尚未審核
func (l *UpdateLogic) Update(in *product.UpdateKycInfoReq) (*product.OKResp, error) {
2025-04-08 09:20:34 +00:00
// 如果已完成應該不能
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
}