| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | 
							- package model
 
- import (
 
- 	"time"
 
- 	pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
 
- )
 
- type SystemRole struct {
 
- 	Id        int64                 `json:"id,omitempty"`
 
- 	Name      string                `json:"name,omitempty"`
 
- 	Remarks   string                `json:"remarks,omitempty"`
 
- 	IsShow    pasturePb.IsShow_Kind `json:"is_show,omitempty"`
 
- 	IsDelete  pasturePb.IsShow_Kind `json:"is_delete,omitempty"`
 
- 	CreatedAt int64                 `json:"created_at,omitempty"`
 
- 	UpdatedAt int64                 `json:"updated_at,omitempty"`
 
- }
 
- func (s *SystemRole) TableName() string {
 
- 	return "system_role"
 
- }
 
- const (
 
- 	LayoutTime   = "2006-01-02 15:04:05"
 
- 	LayoutDate   = "20060102"
 
- 	LayoutDate2  = "2006-01-02"
 
- 	LayoutMonth  = "2006-01"
 
- 	LayoutHour   = "2006-01-02 15"
 
- 	LayoutMinute = "2006-01-02 15:04"
 
- 	LayoutYear   = "2006"
 
- 	LayoutTime2  = "2006/1/2 15:04:05"
 
- )
 
- type SystemRoleSlice []*SystemRole
 
- func (s SystemRoleSlice) ToPB() []*pasturePb.SearchRoleRequest {
 
- 	res := make([]*pasturePb.SearchRoleRequest, len(s))
 
- 	for i, v := range s {
 
- 		res[i] = &pasturePb.SearchRoleRequest{
 
- 			Id:              int32(v.Id),
 
- 			Name:            v.Name,
 
- 			Remarks:         v.Remarks,
 
- 			IsShow:          v.IsShow,
 
- 			CreatedAtFormat: time.Unix(v.CreatedAt, 0).Local().Format(LayoutTime),
 
- 			UpdatedAtFormat: time.Unix(v.UpdatedAt, 0).Local().Format(LayoutTime),
 
- 		}
 
- 	}
 
- 	return res
 
- }
 
 
  |