| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | package modelimport (	pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow")type SystemDept struct {	Id        int64                 `json:"id"`	Name      string                `json:"name"`	Remarks   string                `json:"remarks"`	DeptType  pasturePb.Depth_Kind  `json:"dept_type"`	LeaderId  int64                 `json:"leader_id"`	ParentId  int64                 `json:"parent_id"`	Sort      int32                 `json:"sort"`	IsShow    pasturePb.IsShow_Kind `json:"is_show"`	IsDelete  pasturePb.IsShow_Kind `json:"is_delete"`	CreatedAt int64                 `json:"created_at"`	UpdatedAt int64                 `json:"updated_at"`}func (s *SystemDept) TableName() string {	return "system_dept"}type SystemDeptSlice []*SystemDeptfunc (s SystemDeptSlice) ToPB(systemUserList []*SystemUser) []*pasturePb.SearchDeptRequest {	res := make([]*pasturePb.SearchDeptRequest, len(s))	for i, d := range s {		leaderName := ""		for _, v := range systemUserList {			if d.LeaderId != v.Id {				continue			}			leaderName = v.Name		}		res[i] = &pasturePb.SearchDeptRequest{			Id:         int32(d.Id),			Name:       d.Name,			Remarks:    d.Remarks,			ParentId:   int32(d.ParentId),			DepthType:  d.DeptType,			LeaderId:   int32(d.LeaderId),			LeaderName: leaderName,			Sort:       d.Sort,			IsShow:     d.IsShow,			IsDelete:   d.IsDelete,			CreatedAt:  int32(d.CreatedAt),			UpdatedAt:  int32(d.UpdatedAt),		}	}	return res}
 |