edit response checkTokenSupplier

This commit is contained in:
buiphuan0211 2022-12-24 13:50:58 +07:00
parent b5d7425114
commit 54f5c45488
2 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -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"`
}