system_mobile_permissions.go 919 B

12345678910111213141516171819202122232425262728
  1. package model
  2. import operationPb "kpt-tmr-group/proto/go/backend/operation"
  3. type SystemMobilePermissions struct {
  4. Id int64 `json:"id,omitempty"`
  5. RoleId int64 `json:"role_id"`
  6. MobileId int64 `json:"mobile_id"`
  7. IsShow operationPb.IsShow_Kind `json:"is_show"`
  8. CreatedAt int64 `json:"created_at"`
  9. UpdatedAt int64 `json:"updated_at"`
  10. }
  11. func (s *SystemMobilePermissions) TableName() string {
  12. return "system_mobile_permissions"
  13. }
  14. func NewSystemMobilePermissions(roleID int64, mobileIds []uint32) []*SystemMobilePermissions {
  15. systemMobilePermissions := make([]*SystemMobilePermissions, len(mobileIds))
  16. for i, v := range mobileIds {
  17. systemMobilePermissions[i] = &SystemMobilePermissions{
  18. RoleId: roleID,
  19. MobileId: int64(v),
  20. IsShow: operationPb.IsShow_OK,
  21. }
  22. }
  23. return systemMobilePermissions
  24. }