department.go 887 字节
package protocol

import "time"

const (
	DepartmentAll  = iota + 1 //公司所有部门
	DepartmentUser            //用户所有部门
)

/*Departments */
type DepartmentsRequest struct {
	Type int `json:"type" valid:"Required"` //1:公司所有部门  2:用户所在部门
}
type DepartmentsResponse struct {
	Departments []*Department `json:"departments,omitempty"`
}

type Department struct {
	DepartmentId  int           `orm:"column(department_id)" json:"id"`
	Name          string        `orm:"column(name)" json:"name"`
	PId           int           `orm:"column(parent_id)" json:"-"`
	ManagerString string        `orm:"column(managers)" json:"-"`
	Relation      string        `orm:"column(relation)" json:"-"`
	CreateTime    time.Time     `orm:"column(create_time)" json:"-"`
	Managers      []int         `json:"-"`
	Departments   []*Department `json:"departments,omitempty"`
}