Update permission #4

Merged
trunglt251292 merged 8 commits from update-permission into master 2022-07-01 02:26:53 +00:00
3 changed files with 17 additions and 0 deletions
Showing only changes of commit e4a02107f3 - Show all commits

View File

@ -12,4 +12,6 @@ const (
SubjectRequestNatsAddLogs = "authentication.request.logs.create" SubjectRequestNatsAddLogs = "authentication.request.logs.create"
SubjectRequestNatsLogsGetList = "authentication.request.logs.list" SubjectRequestNatsLogsGetList = "authentication.request.logs.list"
SubjectRequestNatsGetTokenWithPhone = "authentication.request.staff.get_token"
) )

View File

@ -48,3 +48,8 @@ func (Request) SaveLog(payload Log) (*Response, error) {
func (Request) GetListLogs(payload *CommonQuery) (*Response, error) { func (Request) GetListLogs(payload *CommonQuery) (*Response, error) {
return requestNats(SubjectRequestNatsLogsGetList, toBytes(payload)) return requestNats(SubjectRequestNatsLogsGetList, toBytes(payload))
} }
// GetTokenWithPhoneNumber ...
func (Request) GetTokenWithPhoneNumber(payload *GetTokenByPhoneBody) (*Response, error) {
return requestNats(SubjectRequestNatsGetTokenWithPhone, toBytes(payload))
}

View File

@ -16,6 +16,16 @@ type CommonQuery struct {
StaffID string `json:"staffID"` StaffID string `json:"staffID"`
} }
// GetTokenByPhoneBody ...
type GetTokenByPhoneBody struct {
Phone string `json:"phone"`
}
// GetTokenByPhoneResponse ...
type GetTokenByPhoneResponse struct {
Token string `json:"token"`
}
// GetInfoStaff ... // GetInfoStaff ...
type GetInfoStaff struct { type GetInfoStaff struct {
Condition interface{} `json:"condition"` Condition interface{} `json:"condition"`