From 54f5c45488413b1df64ba153edcd3f178d58057a Mon Sep 17 00:00:00 2001 From: buiphuan0211 <57066954+buiphuan0211@users.noreply.github.com> Date: Sat, 24 Dec 2022 13:50:58 +0700 Subject: [PATCH] edit response checkTokenSupplier --- client/supplier.go | 6 +++--- model/supplier_response.go | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/supplier.go b/client/supplier.go index b10f982..56e0670 100644 --- a/client/supplier.go +++ b/client/supplier.go @@ -180,15 +180,15 @@ func (s Supplier) UpdateWarehouseIntoServiceSupplier(p model.UpdateSupplierWareh } // CheckTokenSupplier ... -func (s Supplier) CheckTokenSupplier(p model.CheckTokenSupplierPayload) (*model.ResponseSupplierInfo, error) { +func (s Supplier) CheckTokenSupplier(p model.CheckTokenSupplierPayload) (*model.ResponseCheckTokenSupplier, error) { msg, err := natsio.GetServer().Request(subject.Supplier.CheckTokenSupplier, toBytes(p)) if err != nil { return nil, err } var r struct { - Error string `json:"error"` - Data *model.ResponseSupplierInfo `json:"data"` + Error string `json:"error"` + Data *model.ResponseCheckTokenSupplier `json:"data"` } if err = json.Unmarshal(msg.Data, &r); err != nil { return nil, err diff --git a/model/supplier_response.go b/model/supplier_response.go index 2b9dd10..21dce15 100644 --- a/model/supplier_response.go +++ b/model/supplier_response.go @@ -33,3 +33,10 @@ type SupplierAll struct { type SupplierCountRes struct { Total int64 `json:"total"` } + +// ResponseCheckTokenSupplier ... +type ResponseCheckTokenSupplier struct { + Invalid bool `json:"invalid"` + Reason string `json:"reason"` + Supplier ResponseSupplierInfo `json:"supplier"` +}