mergeDev/campaign #73
|
@ -16,16 +16,16 @@ func GetStaff() Staff {
|
|||
}
|
||||
|
||||
// GetListStaffInfoByNotificationAction ...
|
||||
func (s Staff) GetListStaffInfoByNotificationAction(p model.GetListStaffByNotificationActionRequest) (*model.ResponseListStaffInfoByNotificationAction, error) {
|
||||
msg, err := natsio.GetServer().Request(subject.Staff.GetListStaffInfoByNotificationAction, toBytes(p))
|
||||
func (s Staff) GetListStaffInfoByNotificationAction(p model.GetListStaffRequest) (*model.ResponseListStaffInfo, error) {
|
||||
msg, err := natsio.GetServer().Request(subject.Staff.GetListStaffInfo, toBytes(p))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var r struct {
|
||||
Data *model.ResponseListStaffInfoByNotificationAction `json:"data"`
|
||||
Error string `json:"error"`
|
||||
Data *model.ResponseListStaffInfo `json:"data"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(msg.Data, &r); err != nil {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package model
|
||||
|
||||
// GetListStaffByNotificationActionRequest ...
|
||||
type GetListStaffByNotificationActionRequest struct {
|
||||
CreatedBys []string `json:"createdBys"`
|
||||
ApprovedBys []string `json:"approvedBys"`
|
||||
CancelledBys []string `json:"cancelledBys"`
|
||||
// GetListStaffRequest ...
|
||||
type GetListStaffRequest struct {
|
||||
Staffs []string `json:"Staffs"`
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package model
|
||||
|
||||
// ResponseListStaffInfoByNotificationAction ...
|
||||
type ResponseListStaffInfoByNotificationAction struct {
|
||||
CreatedBys []ResponseStaffInfo `json:"CreatedBys"`
|
||||
ApprovedBys []ResponseStaffInfo `json:"ApprovedBys"`
|
||||
CancelledBys []ResponseStaffInfo `json:"CancelledBys"`
|
||||
// ResponseListStaffInfo ...
|
||||
type ResponseListStaffInfo struct {
|
||||
Staffs []ResponseStaffInfo `json:"staffs"`
|
||||
}
|
||||
|
||||
// ResponseStaffInfo ...
|
||||
|
|
|
@ -7,7 +7,7 @@ func getStaffValue(val string) string {
|
|||
}
|
||||
|
||||
var Staff = struct {
|
||||
GetListStaffInfoByNotificationAction string
|
||||
GetListStaffInfo string
|
||||
}{
|
||||
GetListStaffInfoByNotificationAction: getStaffValue("get_list_staff_info_by_notification_info"),
|
||||
GetListStaffInfo: getStaffValue("get_list_staff_info_by_notification_info"),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue