feat(架构): 完善基础架构设计
This commit is contained in:
@@ -76,9 +76,14 @@ type ResponseBuilder interface {
|
||||
NotFound(c *gin.Context, message ...string)
|
||||
Conflict(c *gin.Context, message string)
|
||||
InternalError(c *gin.Context, message ...string)
|
||||
ValidationError(c *gin.Context, errors interface{})
|
||||
TooManyRequests(c *gin.Context, message ...string)
|
||||
|
||||
// 分页响应
|
||||
Paginated(c *gin.Context, data interface{}, pagination PaginationMeta)
|
||||
|
||||
// 自定义响应
|
||||
CustomResponse(c *gin.Context, statusCode int, data interface{})
|
||||
}
|
||||
|
||||
// RequestValidator 请求验证器接口
|
||||
@@ -90,6 +95,9 @@ type RequestValidator interface {
|
||||
|
||||
// 绑定和验证
|
||||
BindAndValidate(c *gin.Context, dto interface{}) error
|
||||
|
||||
// 直接验证结构体
|
||||
ValidateStruct(dto interface{}) error
|
||||
}
|
||||
|
||||
// PaginationMeta 分页元数据
|
||||
|
||||
Reference in New Issue
Block a user