V1 #1

Merged
trunglt251292 merged 13 commits from v1 into master 2022-05-31 03:35:14 +00:00
3 changed files with 20 additions and 0 deletions
Showing only changes of commit 29bdeb7d40 - Show all commits

View File

@ -4,4 +4,5 @@ const (
SubjectRequestNatsCheckPermission = "authentication.request.staff.check_permission"
SubjectRequestNatsGetPermission = "authentication.request.staff.list_permission"
SubjectRequestNatsSyncStaff = "authentication.request.staff.sync_data"
SubjectRequestNatsSyncRole = "authentication.request.role.sync_data"
)

View File

@ -18,3 +18,8 @@ func (Request) GetPermission(payload StaffGetPermissions) (*Response, error) {
func (Request) SyncData(payload ListStaff) (*Response, error) {
return requestNats(SubjectRequestNatsSyncStaff, toBytes(payload))
}
// SyncRoleData ...
func (Request) SyncRoleData(payload ListRole) (*Response, error) {
return requestNats(SubjectRequestNatsSyncRole, toBytes(payload))
}

View File

@ -4,6 +4,20 @@ import (
"github.com/Selly-Modules/natsio"
)
// Role ...
type Role struct {
ID string `bson:"_id"`
Name string `bson:"name"`
CreatedAt string `bson:"createdAt"`
UpdatedAt string `bson:"updatedAt"`
Permissions []string `bson:"permissions"`
}
// ListRole ...
type ListRole struct {
Roles []Role `json:"roles"`
}
// Staff ...
type Staff struct {
ID string `json:"_id"` // ObjectID