Documentation
¶
Index ¶
- type ErrorTestHandler
- func (h *ErrorTestHandler) SimpleError(c *gin.Context)
- func (h *ErrorTestHandler) TestApiError(c *gin.Context)
- func (h *ErrorTestHandler) TestBadRequestError(c *gin.Context)
- func (h *ErrorTestHandler) TestClientError(c *gin.Context)
- func (h *ErrorTestHandler) TestCustomResponse(c *gin.Context)
- func (h *ErrorTestHandler) TestNotFoundError(c *gin.Context)
- func (h *ErrorTestHandler) TestPanicError(c *gin.Context)
- func (h *ErrorTestHandler) TestSqlError(c *gin.Context)
- func (h *ErrorTestHandler) TestSuccess(c *gin.Context)
- func (h *ErrorTestHandler) TestUnauthorizedError(c *gin.Context)
- func (h *ErrorTestHandler) TestValidationError(c *gin.Context)
- type ProductHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorTestHandler ¶
type ErrorTestHandler struct{}
ErrorTestHandler 错误测试处理器
func NewErrorTestHandler ¶
func NewErrorTestHandler() *ErrorTestHandler
NewErrorTestHandler 创建错误测试处理器
func (*ErrorTestHandler) SimpleError ¶ added in v1.3.2
func (h *ErrorTestHandler) SimpleError(c *gin.Context)
SimpleError 简单错误响应(不使用 response 包)
func (*ErrorTestHandler) TestApiError ¶
func (h *ErrorTestHandler) TestApiError(c *gin.Context)
TestApiError 测试 API 异常 GET /test/error/api
func (*ErrorTestHandler) TestBadRequestError ¶ added in v1.3.2
func (h *ErrorTestHandler) TestBadRequestError(c *gin.Context)
TestBadRequestError 测试错误请求 GET /test/error/badrequest
func (*ErrorTestHandler) TestClientError ¶
func (h *ErrorTestHandler) TestClientError(c *gin.Context)
TestClientError 测试客户端请求异常 GET /test/error/client
func (*ErrorTestHandler) TestCustomResponse ¶ added in v1.3.2
func (h *ErrorTestHandler) TestCustomResponse(c *gin.Context)
TestCustomResponse 测试自定义响应 GET /test/custom
func (*ErrorTestHandler) TestNotFoundError ¶ added in v1.3.2
func (h *ErrorTestHandler) TestNotFoundError(c *gin.Context)
TestNotFoundError 测试未找到错误 GET /test/error/notfound
func (*ErrorTestHandler) TestPanicError ¶ added in v1.3.2
func (h *ErrorTestHandler) TestPanicError(c *gin.Context)
TestPanicError 测试 Panic 错误 GET /test/error/panic
func (*ErrorTestHandler) TestSqlError ¶
func (h *ErrorTestHandler) TestSqlError(c *gin.Context)
TestSqlError 测试 SQL 异常 GET /test/error/sql
func (*ErrorTestHandler) TestSuccess ¶ added in v1.3.2
func (h *ErrorTestHandler) TestSuccess(c *gin.Context)
TestSuccess 测试成功响应 GET /test/success
func (*ErrorTestHandler) TestUnauthorizedError ¶ added in v1.3.2
func (h *ErrorTestHandler) TestUnauthorizedError(c *gin.Context)
TestUnauthorizedError 测试未授权错误 GET /test/error/unauthorized
func (*ErrorTestHandler) TestValidationError ¶
func (h *ErrorTestHandler) TestValidationError(c *gin.Context)
TestValidationError 测试参数验证异常 GET /test/error/validation
type ProductHandler ¶ added in v1.3.2
type ProductHandler struct {
// contains filtered or unexported fields
}
ProductHandler 产品处理器
func NewProductHandler ¶ added in v1.3.2
func NewProductHandler() *ProductHandler
NewProductHandler 创建产品处理器
func (*ProductHandler) List ¶ added in v1.3.2
func (h *ProductHandler) List(c *gin.Context)
获取产品列表
GET /api/products?page=1&page_size=20&status=1&keyword=xxx&column_id=1