add more fields to device data
This commit is contained in:
parent
e78f8befa1
commit
b5e9f2dd9b
|
@ -12,7 +12,7 @@ func (s Service) GetDevicePermissionsByToken(token string) (doc StaffDevicePermi
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
stm, args, _ := s.Builder.
|
stm, args, _ := s.Builder.
|
||||||
Select("dm.id, s.account_type, sr.permissions").
|
Select("dm.id AS device_id, s.id, s.name, s.account_type, sr.permissions").
|
||||||
From(fmt.Sprintf("%s AS dm", TableDeviceMngt)).
|
From(fmt.Sprintf("%s AS dm", TableDeviceMngt)).
|
||||||
Join(fmt.Sprintf("LEFT JOIN %s s ON s.id = dm.owner_id", TableStaff)).
|
Join(fmt.Sprintf("LEFT JOIN %s s ON s.id = dm.owner_id", TableStaff)).
|
||||||
Join(fmt.Sprintf("LEFT JOIN %s sr ON s.role_id = sr.id", TableStaffRole)).
|
Join(fmt.Sprintf("LEFT JOIN %s sr ON s.role_id = sr.id", TableStaffRole)).
|
||||||
|
|
2
model.go
2
model.go
|
@ -59,6 +59,8 @@ type HeaderData struct {
|
||||||
// StaffDevicePermissions ...
|
// StaffDevicePermissions ...
|
||||||
type StaffDevicePermissions struct {
|
type StaffDevicePermissions struct {
|
||||||
ID string `db:"id"`
|
ID string `db:"id"`
|
||||||
|
Name string `db:"name"`
|
||||||
Permissions []string `db:"permissions"`
|
Permissions []string `db:"permissions"`
|
||||||
AccountType string `db:"account_type"`
|
AccountType string `db:"account_type"`
|
||||||
|
DeviceID string `db:"device_id"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue