company.go 2.8 KB
package protocol

//RequestDepartmentAdd 部门设置
type RequestDepartmentAdd struct {
	CompanyID int64   `json:"company_id"` //公司
	Name      string  `json:"name"`       //部门名字
	ParentID  int64   `json:"parent_id"`  //父级部门Id
	Managers  []int64 `json:"manages"`    //主管userid
}

type ResponseDepartmenrAdd struct {
	DepartmentId int64 `json:"id"` // 部门id
}

type DepartmentManager struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

//RequestDepartmentEdit 编辑
type RequestDepartmentEdit struct {
	ID int64 `json:"id"`
	RequestDepartmentAdd
}

//RequestDepartmentDelete ...
type RequestDepartmentDelete struct {
	IDs       []int64 `json:"ids"`
	CompanyID int64   `json:"company_id"` //公司
}

//ResponseDepartmentInfo ...
type ResponseDepartmentInfo struct {
	ID        int64               `json:"id"`
	CompanyID int64               `json:"company_id"` //公司
	Name      string              `json:"name"`       //部门名字
	ParantID  int64               `json:"parant_id"`  //父级部门Id
	Manages   []DepartmentManager `json:"manages"`    //部门管理员
	Member    int                 `json:"member"`     //成员数
}

//ResponseDepartmentList ....
type ResponseDepartmentList struct {
	List []ResponseDepartmentInfo
}

//RequestPositionAdd 添加职位
type RequestPositionAdd struct {
	CompanyID int64  `json:"company_id"`
	Name      string `json:"name"`
	ParentID  int64  `json:"parent_id"`
}

//RequestPositionEdit 编辑职位
type RequestPositionEdit struct {
	ID int64 `json:"id"`
	RequestPositionAdd
}

//ResponsePositionInfo ...
type ResponsePositionInfo struct {
	Id         int64  `json:"id" orm:"column(id)"`
	Name       string `json:"name"  orm:"column(name)"`
	ParentId   int64  `json:"parent_id"  orm:"column(parent_id)"`
	ParemtName string `json:"parent_name,omitempty"  orm:"-"`
}

type RequestPositionDelete struct {
	CompanyID int64   `json:"company_id"`
	IDs       []int64 `json:"ids"`
}

//RequestUserAdd 添加用户
type RequestUserAdd struct {
	Name        string  `json:"name"`
	CompanyId   int64   `json:"company_id"`
	Phone       string  `json:"phone"`
	Departments []int64 `json:"departments"`
	Positions   []int64 `json:"positions"`
	Roles       []int64 `json:"roles"`
}

//RequestUserEdit 编辑用户
type RequestUserEdit struct {
	ID int64 `json:"id"`
	RequestUserAdd
}

//RequestUserList 获取用户列表
type RequestUserList struct {
	RequestPageInfo
	NickName string `json:"nick_name"`
}

//ResponseUserList 响应的用户列表
type ResponseUserList struct {
	ResponsePageInfo
	List []UserListItem `json:"list"`
}

type UserListItem struct {
	Id         int64  `json:"id"`
	NickName   string `json:"nick_name"`
	Position   string `json:"position"`
	Role       string `json:"role"`
	Department string `json:"department"`
	Status     int8   `json:"status"`
}