From d780aa9094c3c7cda995899a454b5e259fd2e703 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Tue, 23 Aug 2022 09:13:59 +0700 Subject: [PATCH] [Update] Add request verify code --- constants.go | 1 + request.go | 5 +++++ struct.go | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/constants.go b/constants.go index c345c2e..ea0a08f 100644 --- a/constants.go +++ b/constants.go @@ -6,6 +6,7 @@ const ( SubjectRequestNatsCheckPermission = "authentication.request.staff.check_permission" SubjectRequestNatsGetPermission = "authentication.request.staff.list_permission" SubjectRequestNatsSyncStaff = "authentication.request.staff.sync_data" + SubjectRequestNatsVerifyCode = "authentication.request.staff.verify_code" SubjectRequestNatsStaffCreate = "authentication.request.staff.create" SubjectRequestNatsStaffUpdate = "authentication.request.staff.update" diff --git a/request.go b/request.go index 73be2dc..f91e3b0 100644 --- a/request.go +++ b/request.go @@ -9,6 +9,11 @@ func (Request) CheckPermission(payload StaffCheckPermissionBody) (*Response, err return requestNats(SubjectRequestNatsCheckPermission, toBytes(payload)) } +// VerifyCode ... +func (Request) VerifyCode(payload StaffVerifyCodeBody) (*Response, error) { + return requestNats(SubjectRequestNatsVerifyCode, toBytes(payload)) +} + // GetPermission ... func (Request) GetPermission(payload StaffGetPermissions) (*Response, error) { return requestNats(SubjectRequestNatsGetPermission, toBytes(payload)) diff --git a/struct.go b/struct.go index 01cafaf..1cba0df 100644 --- a/struct.go +++ b/struct.go @@ -5,6 +5,13 @@ import ( "go.mongodb.org/mongo-driver/bson" ) +// StaffVerifyCodeBody ... +type StaffVerifyCodeBody struct { + Code string `json:"code"` + StaffID string `json:"staffId"` + Source string `json:"source"` +} + // CommonQuery ... type CommonQuery struct { Page int64 `json:"page"`