Files
arenax-server/api/role/v1/role.go
2025-06-12 09:18:25 +08:00

68 lines
2.3 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 v1
import (
"github.com/gogf/gf/v2/frame/g"
)
// ListReq 获取角色列表请求参数
type ListReq struct {
g.Meta `path:"/role" method:"get" tags:"Role" summary:"(系统、商户门店后台)获取角色列表"`
Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"每页数量"`
Status int `json:"status" dc:"状态1=启用2=禁用"`
}
// ListRes 获取角色列表响应参数
type ListRes struct {
List interface{} `json:"list" dc:"角色列表"`
Total int `json:"total" dc:"总数"`
}
// CreateReq 创建角色请求参数
type CreateReq struct {
g.Meta `path:"/role" method:"post" tags:"Role" summary:"(系统、商户门店后台)创建角色"`
Name string `json:"name" v:"required" dc:"角色名称"`
Code string `json:"code" v:"required" dc:"角色编码"`
Description string `json:"description" dc:"角色描述"`
Status int `json:"status" v:"required|in:1,2" dc:"状态1=启用2=禁用"`
}
// CreateRes 创建角色响应参数
type CreateRes struct {
Id int64 `json:"id" dc:"角色ID"`
}
// UpdateReq 更新角色请求参数
type UpdateReq struct {
g.Meta `path:"/role" method:"put" tags:"Role" summary:"(系统、商户门店后台)更新角色"`
Id int64 `json:"id" v:"required" dc:"角色ID"`
Name string `json:"name" v:"required" dc:"角色名称"`
Code string `json:"code" v:"required" dc:"角色编码"`
Description string `json:"description" dc:"角色描述"`
Status int `json:"status" v:"required|in:1,2" dc:"状态1=启用2=禁用"`
}
// UpdateRes 更新角色响应参数
type UpdateRes struct {
Success bool `json:"success" dc:"是否成功"`
}
// DeleteReq 删除角色请求参数
type DeleteReq struct {
g.Meta `path:"/role/{id}" method:"delete" tags:"Role" summary:"(系统、商户门店后台)删除角色"`
Id int64 `json:"id" in:"path" v:"required" dc:"角色ID"`
}
// DeleteRes 删除角色响应参数
type DeleteRes struct {
Success bool `json:"success" dc:"是否成功"`
}
type BatchDeleteReq struct {
g.Meta `path:"/role" method:"delete" tags:"Role" summary:"(系统、商户门店后台)批量删除角色"`
Ids []int `json:"ids" v:"required" dc:"角色ID"`
}
type BatchDeleteRes struct {
Success bool `json:"success" dc:"是否成功"`
}