add more fields to device data
This commit is contained in:
parent
b5e9f2dd9b
commit
7c8cf0eb1b
|
@ -7,8 +7,8 @@ import (
|
||||||
"github.com/Selly-Modules/logger"
|
"github.com/Selly-Modules/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetDevicePermissionsByToken ...
|
// GetStaffPermissionsByToken ...
|
||||||
func (s Service) GetDevicePermissionsByToken(token string) (doc StaffDevicePermissions) {
|
func (s Service) GetStaffPermissionsByToken(token string) (doc StaffPermissions) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
stm, args, _ := s.Builder.
|
stm, args, _ := s.Builder.
|
||||||
|
@ -19,7 +19,7 @@ func (s Service) GetDevicePermissionsByToken(token string) (doc StaffDevicePermi
|
||||||
Where("dm.auth_token = ?", token).
|
Where("dm.auth_token = ?", token).
|
||||||
ToSql()
|
ToSql()
|
||||||
if err := s.DB.GetContext(ctx, &doc, stm, args...); err != nil {
|
if err := s.DB.GetContext(ctx, &doc, stm, args...); err != nil {
|
||||||
logger.Error("devicemngt - GetDevicePermissionsByToken", logger.LogData{
|
logger.Error("devicemngt - GetStaffPermissionsByToken", logger.LogData{
|
||||||
"token": token,
|
"token": token,
|
||||||
"error": err.Error(),
|
"error": err.Error(),
|
||||||
})
|
})
|
4
model.go
4
model.go
|
@ -56,8 +56,8 @@ type HeaderData struct {
|
||||||
AuthToken string
|
AuthToken string
|
||||||
}
|
}
|
||||||
|
|
||||||
// StaffDevicePermissions ...
|
// StaffPermissions ...
|
||||||
type StaffDevicePermissions struct {
|
type StaffPermissions struct {
|
||||||
ID string `db:"id"`
|
ID string `db:"id"`
|
||||||
Name string `db:"name"`
|
Name string `db:"name"`
|
||||||
Permissions []string `db:"permissions"`
|
Permissions []string `db:"permissions"`
|
||||||
|
|
Loading…
Reference in New Issue