2023-06-30 16:55:41 +08:00

40 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package deptResponse
import (
"hospital-admin-api/api/model"
"strconv"
)
// GetDeptList 获取部门列表
type GetDeptList struct {
DeptId string `json:"dept_id"`
ParentId string `json:"parent_id"` // 父菜单ID0表示一级
DeptName string `json:"dept_name"` // 部门名称
DeptStatus int `json:"dept_status"` // 部门状态1:正常 2:删除)
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
Children []*GetDeptList `json:"children"` // 下级页面
}
// GetDept 部门详情
type getDept struct {
DeptId string `json:"dept_id"`
ParentId string `json:"parent_id"` // 父菜单ID0表示一级
DeptName string `json:"dept_name"` // 部门名称
DeptStatus int `json:"dept_status"` // 部门状态1:正常 2:删除)
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
}
// GetDeptResponse 部门详情
func GetDeptResponse(adminDept *model.AdminDept) *getDept {
return &getDept{
DeptId: strconv.Itoa(int(adminDept.DeptId)),
ParentId: strconv.Itoa(int(adminDept.ParentId)),
DeptName: adminDept.DeptName,
DeptStatus: adminDept.DeptStatus,
CreatedAt: adminDept.CreatedAt,
UpdatedAt: adminDept.UpdatedAt,
}
}