This commit is contained in:
2023-06-30 14:54:43 +08:00
parent a7ca868a5f
commit c0c69eb602
14 changed files with 840 additions and 13 deletions
+36
View File
@@ -0,0 +1,36 @@
package requests
type ApiRequest struct {
GetApiPage // 获取接口列表-分页
AddApi // 新增接口
DeleteApi // 删除接口-批量
PutApi // 修改接口
}
// GetApiPage 获取接口列表-分页
type GetApiPage struct {
ApiName string `json:"api_name" form:"api_name" label:"api名称"`
ApiPath string `json:"api_path" form:"api_path" label:"接口路径"`
ApiMethod string `json:"api_method" form:"api_method" label:"请求类型"` // put:修改 post:新增 get:获取 delete:删除)
Page int `json:"page" form:"page" label:"页码"`
PageSize int `json:"page_size" form:"page_size" label:"每页个数"`
}
// AddApi 新增接口
type AddApi struct {
ApiName string `json:"api_name" form:"api_name" validate:"required" label:"接口名称"`
ApiPath string `json:"api_path" form:"api_path" validate:"required" label:"接口路径"`
ApiMethod string `json:"api_method" form:"api_method" validate:"required,oneof=GET POST PUT DELETE" label:"请求类型"`
}
// DeleteApi 删除接口-批量
type DeleteApi struct {
ApiIds []string `json:"api_ids" form:"api_ids" validate:"required" label:"接口id"`
}
// PutApi 修改接口
type PutApi struct {
ApiName string `json:"api_name" form:"api_name" label:"api名称"`
ApiMethod string `json:"api_method" form:"api_method" label:"请求类型"` // put:修改 post:新增 get:获取 delete:删除)
ApiPath string `json:"api_path" form:"api_path" validate:"required" label:"接口路径"`
}
+26
View File
@@ -0,0 +1,26 @@
package requests
type DeptRequest struct {
AddDept // 新增部门
DeleteDept // 删除部门-批量
PutDept // 修改部门
}
// AddDept 新增部门
type AddDept struct {
ParentId int64 `json:"parent_id" form:"parent_id" validate:"required" label:"上级部门"` // 本表父级id
DeptName string `json:"dept_name" form:"dept_name" validate:"required" label:"部门名称"`
DeptStatus int `json:"dept_status" form:"dept_status" validate:"required,oneof=1 2" label:"部门状态"` // 1:正常 2:删除)
}
// DeleteDept 删除部门-批量
type DeleteDept struct {
DeptIds []string `json:"dept_ids" form:"dept_ids" validate:"required" label:"部门id"`
}
// PutDept 修改部门
type PutDept struct {
ParentId int64 `json:"parent_id" form:"parent_id" validate:"required" label:"上级部门"` // 本表父级id
DeptName string `json:"dept_name" form:"dept_name" validate:"required" label:"部门名称"`
DeptStatus int `json:"dept_status" form:"dept_status" validate:"required,oneof=1 2" label:"部门状态"` // 1:正常 2:删除)
}