新增部门接口

This commit is contained in:
2023-06-30 16:55:41 +08:00
parent 188a8f0d02
commit 002353cc30
10 changed files with 379 additions and 216 deletions
+26 -1
View File
@@ -1,6 +1,9 @@
package deptResponse
import "hospital-admin-api/api/model"
import (
"hospital-admin-api/api/model"
"strconv"
)
// GetDeptList 获取部门列表
type GetDeptList struct {
@@ -12,3 +15,25 @@ type GetDeptList struct {
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,
}
}