department.go
931 字节
package protocol
import "time"
const (
DepartmentUser = iota //用户所有部门
DepartmentAll //公司所有部门
)
/*Departments */
type DepartmentsRequest struct {
//Type int `json:"type" valid:"Required"` //1:公司所有部门 2:用户所在部门
Type int `json:"type"` //0:用户所在部门 1:公司所有部门
}
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)"`
CreateTime time.Time `orm:"column(create_time)"`
Managers []int `json:"-"`
Departments []*Department `json:"departments,omitempty"`
}