初始
This commit is contained in:
108
api/v1/system/app_roles.go
Normal file
108
api/v1/system/app_roles.go
Normal file
@ -0,0 +1,108 @@
|
||||
// ==========================================================================
|
||||
// GFast自动生成api操作代码。
|
||||
// 生成日期:2024-05-28 15:11:36
|
||||
// 生成路径: api/v1/system/app_roles.go
|
||||
// 生成人:gfast
|
||||
// desc:app角色相关参数
|
||||
// company:云南奇讯科技有限公司
|
||||
// ==========================================================================
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/system/model"
|
||||
)
|
||||
|
||||
// AppRolesSearchReq 分页请求参数
|
||||
type AppRolesSearchReq struct {
|
||||
g.Meta `path:"/list" tags:"app角色" method:"get" summary:"app角色列表"`
|
||||
RoleId string `p:"roleId"` //
|
||||
RoleName string `p:"roleName"` // 角色名
|
||||
CreatedAt string `p:"createdAt" v:"createdAt@datetime#需为YYYY-MM-DD hh:mm:ss格式"` //
|
||||
commonApi.PageReq
|
||||
commonApi.Author
|
||||
}
|
||||
|
||||
// AppRolesSearchRes 列表返回结果
|
||||
type AppRolesSearchRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
commonApi.ListRes
|
||||
List []*model.AppRolesListRes `json:"list"`
|
||||
}
|
||||
|
||||
// AppRolesAddReq 添加操作请求参数
|
||||
type AppRolesAddReq struct {
|
||||
g.Meta `path:"/add" tags:"app角色" method:"post" summary:"app角色添加"`
|
||||
commonApi.Author
|
||||
RoleName string `p:"roleName" v:"required#角色名不能为空"`
|
||||
}
|
||||
|
||||
// AppRolesAddRes 添加操作返回结果
|
||||
type AppRolesAddRes struct {
|
||||
commonApi.EmptyRes
|
||||
}
|
||||
|
||||
// AppRolesAddMenuReq 添加角色时绑定菜单
|
||||
type AppRolesAddMenuReq struct {
|
||||
g.Meta `path:"/addMenu" tags:"app角色" method:"post" summary:"app添加角色的同时绑定菜单"`
|
||||
RoleName string `p:"roleName" v:"required#角色名不能为空" dc:"角色名"` // 角色名字
|
||||
MenuIds []int `p:"menuIds" v:"required#菜单ID不能为空" dc:"菜单ID 数组"` // 菜单ID
|
||||
commonApi.Author
|
||||
}
|
||||
|
||||
type AppRolesAddMenuRes struct {
|
||||
commonApi.EmptyRes
|
||||
}
|
||||
|
||||
// AppRolesEditReq 修改操作请求参数
|
||||
type AppRolesEditReq struct {
|
||||
g.Meta `path:"/edit" tags:"app角色" method:"put" summary:"app角色修改"`
|
||||
commonApi.Author
|
||||
RoleId uint `p:"roleId" v:"required#主键ID不能为空"`
|
||||
RoleName string `p:"roleName" v:"required#角色名不能为空"`
|
||||
MenuIds []int `p:"menuIds" dc:"菜单列表"` // 菜单列表
|
||||
}
|
||||
|
||||
// AppRolesEditRes 修改操作返回结果
|
||||
type AppRolesEditRes struct {
|
||||
commonApi.EmptyRes
|
||||
}
|
||||
|
||||
// AppRolesGetReq 获取一条数据请求
|
||||
type AppRolesGetReq struct {
|
||||
g.Meta `path:"/get" tags:"app角色" method:"get" summary:"获取app角色信息"`
|
||||
commonApi.Author
|
||||
RoleId uint `p:"roleId" v:"required#主键必须"` // 通过主键获取
|
||||
}
|
||||
|
||||
// AppRolesGetRes 获取一条数据结果
|
||||
type AppRolesGetRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
*model.AppRolesInfoRes
|
||||
}
|
||||
|
||||
// AppRolesDeleteReq 删除数据请求
|
||||
type AppRolesDeleteReq struct {
|
||||
g.Meta `path:"/delete" tags:"app角色" method:"delete" summary:"删除app角色"`
|
||||
commonApi.Author
|
||||
RoleIds []uint `p:"roleIds" v:"required#主键必须"` // 通过主键删除
|
||||
}
|
||||
|
||||
// AppRolesDeleteRes 删除数据返回
|
||||
type AppRolesDeleteRes struct {
|
||||
commonApi.EmptyRes
|
||||
}
|
||||
|
||||
// 获取一个角色的菜单
|
||||
type AppRolesGetMenuReq struct {
|
||||
g.Meta `path:"/getMenu" tags:"app角色" method:"get" summary:"获取角色的菜单"`
|
||||
commonApi.Author
|
||||
RoleId uint `p:"roleId" v:"required#角色ID不能为空"`
|
||||
}
|
||||
|
||||
type AppRolesGetMenuRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
List model.AppRoleDetails
|
||||
}
|
Reference in New Issue
Block a user