123456789101112131415161718192021222324252627282930313233 |
- package model
- import (
- operationPb "kpt-tmr-group/proto/go/backend/operation"
- )
- type SystemRole struct {
- Id int64 `json:"id,omitempty"`
- Name string `json:"name,omitempty"`
- Remarks string `json:"remarks,omitempty"`
- IsShow operationPb.IsShow_Kind `json:"is_show,omitempty"`
- PastureId int64 `json:"pasture_id"`
- PastureName string `json:"pasture_name"`
- CreateUser string `json:"create_user,omitempty"`
- CreatedAt int64 `json:"created_at,omitempty"`
- UpdatedAt int64 `json:"updated_at,omitempty"`
- }
- func (s *SystemRole) TableName() string {
- return "system_role"
- }
- func NewSystemRoleList(reqs []*operationPb.AddRoleRequest) []*SystemRole {
- systemRoleList := make([]*SystemRole, len(reqs))
- for k, role := range reqs {
- systemRoleList[k] = &SystemRole{
- Name: role.Name,
- Remarks: role.Remarks,
- IsShow: operationPb.IsShow_OK,
- }
- }
- return systemRoleList
- }
|