diff --git a/constants.go b/constants.go index eefc318..05abcfe 100644 --- a/constants.go +++ b/constants.go @@ -10,4 +10,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 1bddcf1..f22a5f2 100644 --- a/request.go +++ b/request.go @@ -38,3 +38,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 d5e5c4a..e1a6e6f 100644 --- a/struct.go +++ b/struct.go @@ -14,6 +14,11 @@ type CommonQuery struct { StaffID string `json:"staffID"` } +// GetTokenByPhoneBody ... +type GetTokenByPhoneBody struct { + Phone string `json:"phone"` +} + // Log ... type Log struct { Reference string `json:"reference"`