diff --git a/constants.go b/constants.go index a107bb1..1840ff6 100644 --- a/constants.go +++ b/constants.go @@ -12,4 +12,6 @@ const ( SubjectRequestNatsAddLogs = "authentication.request.logs.create" SubjectRequestNatsLogsGetList = "authentication.request.logs.list" + + SubjectRequestNatsGetTokenWithPhone = "authentication.request.staff.get_token" ) diff --git a/request.go b/request.go index a80a6e1..e3e88b3 100644 --- a/request.go +++ b/request.go @@ -48,3 +48,8 @@ func (Request) SaveLog(payload Log) (*Response, error) { func (Request) GetListLogs(payload *CommonQuery) (*Response, error) { return requestNats(SubjectRequestNatsLogsGetList, toBytes(payload)) } + +// GetTokenWithPhoneNumber ... +func (Request) GetTokenWithPhoneNumber(payload *GetTokenByPhoneBody) (*Response, error) { + return requestNats(SubjectRequestNatsGetTokenWithPhone, toBytes(payload)) +} diff --git a/struct.go b/struct.go index 0074aa6..66da354 100644 --- a/struct.go +++ b/struct.go @@ -16,6 +16,16 @@ type CommonQuery struct { StaffID string `json:"staffID"` } +// GetTokenByPhoneBody ... +type GetTokenByPhoneBody struct { + Phone string `json:"phone"` +} + +// GetTokenByPhoneResponse ... +type GetTokenByPhoneResponse struct { + Token string `json:"token"` +} + // GetInfoStaff ... type GetInfoStaff struct { Condition interface{} `json:"condition"`