refactor-location #134

Closed
trunglam wants to merge 270 commits from refactor-location into master
4 changed files with 10 additions and 11 deletions
Showing only changes of commit 9407b2df6b - Show all commits

View File

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

View File

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

View File

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

View File

@ -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"),