Documentation ¶
Index ¶
- type ArticleController
- func (c *ArticleController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *ArticleController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *ArticleController) Get(ctx *gin.Context) (res interface{}, err error)
- func (c *ArticleController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *ArticleController) Update(ctx *gin.Context) (res interface{}, err error)
- type MenuController
- func (c *MenuController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *MenuController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *MenuController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *MenuController) Tree(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *MenuController) Update(ctx *gin.Context) (res interface{}, err error)
- type OperationController
- type ResourceController
- func (c *ResourceController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *ResourceController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *ResourceController) Get(ctx *gin.Context) (res interface{}, err error)
- func (c *ResourceController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *ResourceController) Update(ctx *gin.Context) (res interface{}, err error)
- type RestController
- func (c *RestController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *RestController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *RestController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *RestController) Update(ctx *gin.Context) (res interface{}, err error)
- type RoleController
- func (c *RoleController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *RoleController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *RoleController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *RoleController) Update(ctx *gin.Context) (res interface{}, err error)
- func (c *RoleController) UpdateMenu(ctx *gin.Context) (res interface{}, err error)
- func (c *RoleController) UpdateRest(ctx *gin.Context) (res interface{}, err error)
- type TagController
- func (c *TagController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *TagController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *TagController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *TagController) Update(ctx *gin.Context) (res interface{}, err error)
- type UserController
- func (c *UserController) Create(ctx *gin.Context) (res interface{}, err error)
- func (c *UserController) Delete(ctx *gin.Context) (res interface{}, err error)
- func (c *UserController) List(ctx *gin.Context) (res interface{}, total int64, err error)
- func (c *UserController) Update(ctx *gin.Context) (res interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleController ¶
type ArticleController struct {
// contains filtered or unexported fields
}
func NewArticleController ¶
func (*ArticleController) Create ¶
func (c *ArticleController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建文章 @Description 创建带标签的文章 @Tags Article @Produce json @Accept json @Security JWT @param CreateArticleRequest body service.CreateArticleRequest true "创建文章" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/articles [post]
func (*ArticleController) Delete ¶
func (c *ArticleController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除文章 @Description 删除文章 @Tags Article @Produce json @Security JWT @Param id path integer true "文章ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/articles/{id} [delete]
func (*ArticleController) Get ¶
func (c *ArticleController) Get(ctx *gin.Context) (res interface{}, err error)
@Summary 获取单个文章 @Description 获取单个文章详细信息 @Tags Article @Accept json @Produce json @Security JWT @Param id path integer true "文章ID" @Success 200 {object} app.CommResponse{data=model.Article} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/article/{id} [get]
func (*ArticleController) List ¶
func (c *ArticleController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个文章 @Description 根据条件获取多个文章详细信息 @Tags Article @Produce json @Security JWT @param name query string false "文章名称" @param state query integer false "状态" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]model.Article} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/articles [get]
func (*ArticleController) Update ¶
func (c *ArticleController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改文章 @Description 修改带标签的文章 @Tags Article @Produce json @Accept json @Security JWT @Param id path integer true "文章ID" @param UpdateArticleRequest body service.UpdateArticleRequest true "修改文章" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/articles/{id} [put]
type MenuController ¶
type MenuController struct {
// contains filtered or unexported fields
}
func NewMenuController ¶
func NewMenuController(store store.Factory, logger log.Logger) *MenuController
func (*MenuController) Create ¶
func (c *MenuController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建菜单 @Description 创建菜单 @Tags Menu @Produce json @Accept json @Security JWT @param CreateRestRequest body service.CreateSysMenuRequest true "创建接口" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/menu [post]
func (*MenuController) Delete ¶
func (c *MenuController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除菜单 @Description 删除菜单 @Tags Menu @Produce json @Security JWT @Param id path integer true "菜单ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/menu [delete]
func (*MenuController) List ¶
func (c *MenuController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取菜单列表 @Description 获取菜单列表及其子菜单 @Tags Menu @Produce json @Security JWT @param name query string false "菜单名称" @param sort query string false "排序方式" @Success 200 {object} app.ListResponse{data=[]entity.SysMenu} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/menus [get]
func (*MenuController) Tree ¶
func (c *MenuController) Tree(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取菜单树 @Description 根据角色获取菜单树结构 @Tags Menu @Produce json @Security JWT @param name query string false "菜单名称" @param sort query string false "排序方式" @Success 200 {object} app.ListResponse{data=[]entity.SysMenu} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/menu/tree [get]
func (*MenuController) Update ¶
func (c *MenuController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改菜单 @Description 修改菜单 @Tags Menu @Produce json @Accept json @Security JWT @Param id path integer true "才带你ID" @param UpdateRestRequest body service.UpdateSysMenuRequest true "修改接口" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/menu [put]
type OperationController ¶
type OperationController struct {
// contains filtered or unexported fields
}
func NewOperationController ¶
func NewOperationController(store store.Factory, logger log.Logger) *OperationController
func (*OperationController) List ¶
func (c *OperationController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个操作日志 @Description 获取多个操作日志 @Tags Operation @Produce json @Security JWT @param username query string false "用户名" @param action query string false "操作" @param object query string false "对象" @param result query string false "结果" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]model.OperationLog} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/operation [get]
type ResourceController ¶
type ResourceController struct {
// contains filtered or unexported fields
}
func NewResourceController ¶
func NewResourceController(store store.Factory, logger log.Logger) *ResourceController
func (*ResourceController) Create ¶
func (c *ResourceController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建资源 @Description 创建资源 @Tags Resource @Produce json @Accept multipart/form-data @Security JWT @param file formData file true "file" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/resource [post]
func (*ResourceController) Delete ¶
func (c *ResourceController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除资源 @Description 删除资源 @Tags Resource @Produce json @Security JWT @Param id path integer true "标签ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/resource [delete]
func (*ResourceController) Get ¶
func (c *ResourceController) Get(ctx *gin.Context) (res interface{}, err error)
@Summary 获取单个资源 @Description 获取单个资源详细信息 @Tags Resource @Accept json @Produce json @Security JWT @Param id path integer true "资源ID" @Success 200 {object} app.CommResponse{data=entity.Resource} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/resource/{id} [get]
func (*ResourceController) List ¶
func (c *ResourceController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个资源 @Description 获取多个资源 @Tags Resource @Produce json @Security JWT @param name query string false "标签名称" @param state query integer false "状态" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]entity.Resource} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/resources [get]
func (*ResourceController) Update ¶
func (c *ResourceController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改资源 @Description 修改资源 @Tags Resource @Produce json @Accept json @Security JWT @Param id path integer true "标签ID" @param UpdateResourceRequest body service.UpdateResourceRequest true "修改资源" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/resource [put]
type RestController ¶
type RestController struct {
// contains filtered or unexported fields
}
func NewRestController ¶
func NewRestController(store store.Factory, logger log.Logger) *RestController
func (*RestController) Create ¶
func (c *RestController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建接口 @Description 创建接口 @Tags Rest @Produce json @Accept json @Security JWT @param CreateRestRequest body service.CreateRestRequest true "创建接口" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/rest [post]
func (*RestController) Delete ¶
func (c *RestController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除接口 @Description 删除接口 @Tags Rest @Produce json @Security JWT @Param id path integer true "接口ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/rest [delete]
func (*RestController) List ¶
func (c *RestController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个接口 @Description 获取多个接口 @Tags Rest @Produce json @Security JWT @param name query string false "标签名称" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]model.SysRest} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/rests [get]
func (*RestController) Update ¶
func (c *RestController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改接口 @Description 修改接口 @Tags Rest @Produce json @Accept json @Security JWT @Param id path integer true "接口ID" @param UpdateRestRequest body service.UpdateRestRequest true "修改接口" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/rest [put]
type RoleController ¶
type RoleController struct {
// contains filtered or unexported fields
}
func NewRoleController ¶
func NewRoleController(store store.Factory, logger log.Logger) *RoleController
func (*RoleController) Create ¶
func (c *RoleController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建角色 @Description 创建角色 @Tags Role @Produce json @Accept json @Security JWT @param CreateRoleRequest body service.CreateRoleRequest true "创建标签" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/role [post]
func (*RoleController) Delete ¶
func (c *RoleController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除角色 @Description 删除角色 @Tags Role @Produce json @Security JWT @Param id path integer true "角色ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/role [delete]
func (*RoleController) List ¶
func (c *RoleController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个角色 @Description 获取多个角色 @Tags Role @Produce json @Security JWT @param name query string false "角色名称" @param state query integer false "状态" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]model.Role} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/roles [get]
func (*RoleController) Update ¶
func (c *RoleController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改角色 @Description 修改角色 @Tags Role @Produce json @Accept json @Security JWT @Param id path integer true "角色ID" @param UpdateRoleRequest body service.UpdateRoleRequest true "修改文章" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/role [put]
func (*RoleController) UpdateMenu ¶
func (c *RoleController) UpdateMenu(ctx *gin.Context) (res interface{}, err error)
@Summary 修改角色菜单 @Description 修改角色菜单 @Tags Role @Produce json @Accept json @Security JWT @Param id path integer true "角色ID" @param UpdateRoleRequest body service.UpdateRoleMenuRequest true "修改角色菜单" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/role/:id/menu [put]
func (*RoleController) UpdateRest ¶
func (c *RoleController) UpdateRest(ctx *gin.Context) (res interface{}, err error)
@Summary 修改角色接口 @Description 修改角色接口 @Tags Role @Produce json @Accept json @Security JWT @Param id path integer true "角色ID" @param UpdateRoleRequest body service.UpdateRoleRestRequest true "修改角色接口" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/role/:id/rest [put]
type TagController ¶
type TagController struct {
// contains filtered or unexported fields
}
func NewTagController ¶
func NewTagController(store store.Factory, logger log.Logger) *TagController
func (*TagController) Create ¶
func (c *TagController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建标签 @Description 创建标签 @Tags Tag @Produce json @Accept json @Security JWT @param CreateTagRequest body service.CreateTagRequest true "创建标签" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/tag [post]
func (*TagController) Delete ¶
func (c *TagController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除标签 @Description 删除标签 @Tags Tag @Produce json @Security JWT @Param id path integer true "标签ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/tag [delete]
func (*TagController) List ¶
func (c *TagController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个标签 @Description 获取多个标签 @Tags Tag @Produce json @Security JWT @param name query string false "标签名称" @param state query integer false "状态" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]model.Tag} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/tags [get]
func (*TagController) Update ¶
func (c *TagController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改标签 @Description 修改标签 @Tags Tag @Produce json @Accept json @Security JWT @Param id path integer true "标签ID" @param UpdateTagRequest body service.UpdateTagRequest true "修改文章" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/tag [put]
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
func NewUserController ¶
func NewUserController(store store.Factory, logger log.Logger) *UserController
func (*UserController) Create ¶
func (c *UserController) Create(ctx *gin.Context) (res interface{}, err error)
@Summary 创建用户 @Description 创建用户 @Tags User @Produce json @Accept json @Security JWT @param CreateUserRequest body service.CreateUserRequest true "创建用户" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/user [post]
func (*UserController) Delete ¶
func (c *UserController) Delete(ctx *gin.Context) (res interface{}, err error)
@Summary 删除用户 @Description 删除用户 @Tags User @Produce json @Security JWT @Param id path integer true "用户ID" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/user [delete]
func (*UserController) List ¶
func (c *UserController) List(ctx *gin.Context) (res interface{}, total int64, err error)
@Summary 获取多个用户 @Description 获取多个用户 @Tags User @Produce json @Security JWT @param name query string false "用户名称" @param state query integer false "状态" @param sort query string false "排序方式" @param page query integer false "页码" @param limit query integer false "页面大小" @Success 200 {object} app.ListResponse{data=[]model.User} "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/users [get]
func (*UserController) Update ¶
func (c *UserController) Update(ctx *gin.Context) (res interface{}, err error)
@Summary 修改用户 @Description 修改用户信息 @Tags User @Produce json @Accept json @Security JWT @Param id path integer true "用户ID" @param UpdateUserRequest body service.UpdateUserRequest true "修改用户" @Success 200 {object} app.CommResponse "成功" @Failure 400 {object} app.ErrResponse "请求错误" @Failure 500 {object} app.ErrResponse "内部错误" @Router /api/v1/user [put]