build auth sms
This commit is contained in:
parent
77f22993d4
commit
6cade7d133
|
@ -37,14 +37,14 @@ 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"`
|
||||
Data *model.GetListUserResponse `json:"data"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
|
@ -72,5 +72,4 @@ type UpdateStatusRequest struct {
|
|||
|
||||
type ResetPasswordRequest struct {
|
||||
ID string `json:"_id"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Reference in New Issue