Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Demo ¶
Demo 示例程序
func (*Demo) Create ¶
Create 创建数据 @Tags Demo @Summary 创建数据 @Param Authorization header string false "Bearer 用户令牌" @Param body body schema.Demo true "创建数据" @Success 200 {object} schema.Demo @Failure 400 {object} schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos [post]
func (*Demo) Delete ¶
Delete 删除数据 @Tags Demo @Summary 删除数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos/{id} [delete]
func (*Demo) Disable ¶
Disable 禁用数据 @Tags Demo @Summary 禁用数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos/{id}/disable [patch]
func (*Demo) Enable ¶
Enable 启用数据 @Tags Demo @Summary 启用数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos/{id}/enable [patch]
func (*Demo) Get ¶
Get 查询指定数据 @Tags Demo @Summary 查询指定数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 {object} schema.Demo @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 404 {object} schema.HTTPError "{error:{code:0,message:资源不存在}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos/{id} [get]
func (*Demo) Query ¶
Query 查询数据 @Tags Demo @Summary 查询数据 @Param Authorization header string false "Bearer 用户令牌" @Param current query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param code query string false "编号" @Param name query string false "名称" @Param status query int false "状态(1:启用 2:停用)" @Success 200 {array} schema.Demo "查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos [get]
func (*Demo) Update ¶
Update 更新数据 @Tags Demo @Summary 更新数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Param body body schema.Demo true "更新数据" @Success 200 {object} schema.Demo @Failure 400 {object} schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos/{id} [put]