generated from PenaSide/GolangTemplate
add client for verify status in pkg
This commit is contained in:
parent
ca16a618c3
commit
aab18dfcec
@ -25,7 +25,7 @@ func NewCustomersClient(deps CustomersClientDeps) *CustomersClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *CustomersClient) SetVerifyAccount(ctx context.Context, req *customer.SetVerificationReq) (*customer.Account, error) {
|
func (receiver *CustomersClient) SetVerifyAccount(ctx context.Context, userId string, accountStatus string) (*customer.Account, error) {
|
||||||
connection, err := grpc.Dial(receiver.customerServiceHost, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
connection, err := grpc.Dial(receiver.customerServiceHost, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
receiver.logger.Error("failed to connect on <SetVerifyAccount> of <CustomerClient>", zap.Error(err), zap.String("customer host", receiver.customerServiceHost))
|
receiver.logger.Error("failed to connect on <SetVerifyAccount> of <CustomerClient>", zap.Error(err), zap.String("customer host", receiver.customerServiceHost))
|
||||||
@ -39,7 +39,10 @@ func (receiver *CustomersClient) SetVerifyAccount(ctx context.Context, req *cust
|
|||||||
|
|
||||||
client := customer.NewCustomerServiceClient(connection)
|
client := customer.NewCustomerServiceClient(connection)
|
||||||
|
|
||||||
account, err := client.SetAccountVerificationStatus(ctx, req)
|
account, err := client.SetAccountVerificationStatus(ctx, &customer.SetVerificationReq{
|
||||||
|
UserID: userId,
|
||||||
|
Status: customer.AccountStatus(customer.AccountStatus_value[accountStatus]),
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
receiver.logger.Error("failed Set Account Verification Status on <SetVerifyAccount> of <CustomerClient>", zap.Error(err))
|
receiver.logger.Error("failed Set Account Verification Status on <SetVerifyAccount> of <CustomerClient>", zap.Error(err))
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user