From 0c704b80a99ac753c40bbc2522ae7bce102bcaff Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Fri, 3 Jun 2022 13:53:17 +0700 Subject: [PATCH] [Update] add new func --- constants.go | 2 ++ request.go | 5 +++++ struct.go | 5 +++++ 3 files changed, 12 insertions(+) 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"`