Files
zmkgC/api/v1/system/app_user_roles.go

131 lines
4.4 KiB
Go
Raw Normal View History

2025-07-07 20:11:59 +08:00
// ==========================================================================
// GFast自动生成api操作代码。
// 生成日期2024-05-28 15:11:37
// 生成路径: api/v1/system/app_user_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"
)
// AppUserRolesSearchReq 分页请求参数
type AppUserRolesSearchReq struct {
g.Meta `path:"/list" tags:"app用户角色关联" method:"get" summary:"app用户角色关联列表"`
Id string `p:"id"` //
UserId string `p:"userId" v:"userId@integer#用户ID需为整数"` // 用户ID
RoleId string `p:"roleId" v:"roleId@integer#关联的角色ID需为整数"` // 关联的角色ID
CreatedAt string `p:"createdAt" v:"createdAt@datetime#需为YYYY-MM-DD hh:mm:ss格式"` //
commonApi.PageReq
commonApi.Author
}
// AppUserRolesSearchRes 列表返回结果
type AppUserRolesSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.AppUserRolesListRes `json:"list"`
}
// AppUserRolesAddReq 添加操作请求参数
type AppUserRolesAddReq struct {
g.Meta `path:"/add" tags:"app用户角色关联" method:"post" summary:"app用户角色关联添加"`
commonApi.Author
UserId int `p:"userId" `
RoleId int `p:"roleId" `
}
// AppUserRolesAddRes 添加操作返回结果
type AppUserRolesAddRes struct {
commonApi.EmptyRes
}
// AppUserRolesEditReq 修改操作请求参数
type AppUserRolesEditReq struct {
g.Meta `path:"/edit" tags:"app用户角色关联" method:"put" summary:"app用户角色关联修改"`
commonApi.Author
Id uint `p:"id"`
UserId int `p:"userId" `
RoleId int `p:"roleId" `
}
// AppUserRolesEditRes 修改操作返回结果
type AppUserRolesEditRes struct {
commonApi.EmptyRes
}
// AppUserRolesGetReq 获取一条数据请求
type AppUserRolesGetReq struct {
g.Meta `path:"/get" tags:"app用户角色关联" method:"get" summary:"获取app用户角色关联信息"`
commonApi.Author
Id uint `p:"id" v:"required#主键必须"` // 通过主键获取
}
// AppUserRolesGetRes 获取一条数据结果
type AppUserRolesGetRes struct {
g.Meta `mime:"application/json"`
*model.AppUserRolesInfoRes
}
// AppUserRolesDeleteReq 删除数据请求
type AppUserRolesDeleteReq struct {
g.Meta `path:"/delete" tags:"app用户角色关联" method:"delete" summary:"删除app用户角色关联"`
commonApi.Author
Ids []uint `p:"ids" v:"required#主键必须"` // 通过主键删除
}
// AppUserRolesDeleteRes 删除数据返回
type AppUserRolesDeleteRes struct {
commonApi.EmptyRes
}
// AppUserRolesBindReq 给用户绑定角色
type AppUserRolesBindReq struct {
g.Meta `path:"/bindRole" tags:"app用户角色关联" method:"post" summary:"给用户绑定角色"`
commonApi.Author
UserId int `p:"userId" v:"required#用户ID必须"`
AdminRole []int `p:"adminRole" dc:"管理员所绑定的角色 [1,2]"` // 管理员角色
ConstructionRole []int `p:"constructionRole" dc:"施工人员所绑定的角色 [7,8]"` // 施工人员角色
}
// AppUserRolesBindRes 给用户绑定角色返回
type AppUserRolesBindRes struct {
commonApi.EmptyRes
}
// AppUserRolesGetRolesReq 获取用户的角色
type AppUserRolesGetRolesReq struct {
g.Meta `path:"/getUserRoles" tags:"app用户角色关联" method:"get" summary:"获取用户的角色"`
UserID int `p:"userId" v:"required#用户ID必须"`
commonApi.Author
}
// AppUserRolesGetRolesRes 获取用户的角色返回
type AppUserRolesGetRolesRes struct {
g.Meta `mime:"application/json"`
// 管理员角色
AdminRole []model.Ruler `json:"adminRole"`
// 施工人员角色
ConstructionRole []model.Ruler `json:"constructionRole"`
}
// 返回所有管理员角色和施工人员角色
type AppUserRolesGetAllRolesReq struct {
g.Meta `path:"/getAllRoles" tags:"app用户角色关联" method:"get" summary:"获取所有角色"`
commonApi.Author
}
type AppUserRolesGetAllRolesRes struct {
g.Meta `mime:"application/json"`
// 管理员角色
AdminRole []model.AppRoles `json:"adminRole"`
// 施工人员角色
ConstructionRole []model.AppRoles `json:"constructionRole"`
}