From 9407b2df6bf257cb9317340080b77e566d02e6b8 Mon Sep 17 00:00:00 2001 From: Tue Date: Thu, 3 Nov 2022 10:46:56 +0700 Subject: [PATCH] build auth sms --- client/supplier_user.go | 10 +++++----- model/supplier_user_request.go | 5 ++--- model/supplier_user_response.go | 2 +- subject/supplier_user.go | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/client/supplier_user.go b/client/supplier_user.go index d2cf98d..2a1939a 100644 --- a/client/supplier_user.go +++ b/client/supplier_user.go @@ -37,15 +37,15 @@ func (s SupplierUser) LoginUser(p model.LoginUserRequest) (*model.LoginUserRespo return r.Data, nil } -func (s SupplierUser) GetListOwner(p model.GetListOwnerRequest) (*model.GetListOwnerResponse, error) { - msg, err := natsio.GetServer().Request(subject.SupplierUser.GetListOwner, toBytes(p)) +func (s SupplierUser) GetListUser(p model.GetListUserRequest) (*model.GetListUserResponse, error) { + msg, err := natsio.GetServer().Request(subject.SupplierUser.GetListUser, toBytes(p)) if err != nil { return nil, err } var r struct { - Data *model.GetListOwnerResponse `json:"data"` - Error string `json:"error"` + Data *model.GetListUserResponse `json:"data"` + Error string `json:"error"` } if err = json.Unmarshal(msg.Data, &r); err != nil { @@ -141,7 +141,7 @@ func (s SupplierUser) UpdateSupplierStaffUsers(p model.UpdateStaffRequest) error } func (s SupplierUser) UpdateStatus(p model.UpdateStatusRequest) error { - msg, err := natsio.GetServer().Request(subject.SupplierUser.UpdateStaff, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.SupplierUser.UpdateStatus, toBytes(p)) if err != nil { return err } diff --git a/model/supplier_user_request.go b/model/supplier_user_request.go index 0c5f69a..32c148f 100644 --- a/model/supplier_user_request.go +++ b/model/supplier_user_request.go @@ -17,7 +17,7 @@ type LoginUserRequest struct { IsMobile bool `json:"isMobile"` } -type GetListOwnerRequest struct { +type GetListUserRequest struct { Page int `json:"page"` Limit int `json:"limit"` Status string `json:"status"` @@ -71,6 +71,5 @@ type UpdateStatusRequest struct { } type ResetPasswordRequest struct { - ID string `json:"_id"` - Password string `json:"password"` + ID string `json:"_id"` } diff --git a/model/supplier_user_response.go b/model/supplier_user_response.go index 5f59100..01826ce 100644 --- a/model/supplier_user_response.go +++ b/model/supplier_user_response.go @@ -7,7 +7,7 @@ type LoginUserResponse struct { SupplierID string `json:"supplierId"` } -type GetListOwnerResponse struct { +type GetListUserResponse struct { SupplierUsers []SupplierUserBrief `json:"supplierUsers"` Total int64 `json:"total"` } diff --git a/subject/supplier_user.go b/subject/supplier_user.go index d7b21fa..2ad5b4d 100644 --- a/subject/supplier_user.go +++ b/subject/supplier_user.go @@ -9,7 +9,7 @@ func getSupplierUserValue(val string) string { var SupplierUser = struct { // Users LoginUser string - GetListOwner string + GetListUser string CreateOwner string UpdateOwner string CreateStaff string @@ -19,7 +19,7 @@ var SupplierUser = struct { }{ // Users LoginUser: getSupplierUserValue("login_user"), - GetListOwner: getSupplierUserValue("get_list_owner"), + GetListUser: getSupplierUserValue("get_list_user"), CreateOwner: getSupplierUserValue("create_owner"), UpdateOwner: getSupplierUserValue("update_owner"), CreateStaff: getSupplierUserValue("create_staff"),