Documentation ¶
Index ¶
- Constants
- Variables
- func CommunityHandler(c *gin.Context)
- func CreatePostHandler(c *gin.Context)
- func GetCommunityDetail(c *gin.Context)
- func GetPostDetailHandler(c *gin.Context)
- func GetPosts2Handler(c *gin.Context)
- func GetPostsHandler(c *gin.Context)
- func GetUserInfo(c *gin.Context) (int64, error)
- func InitTrans(locale string) (err error)
- func LoginHandler(c *gin.Context)
- func PingHandler(c *gin.Context)
- func RefreshTokenHandler(c *gin.Context)
- func ResponseError(c *gin.Context, code ResCode)
- func ResponseErrorWithMsg(c *gin.Context, code ResCode, msg interface{})
- func ResponseSuccess(c *gin.Context, data interface{})
- func SignUpHandler(c *gin.Context)
- func SignUpParamStructLevelValidation(sl validator.StructLevel)
- func VoteHandler(c *gin.Context)
- type ResCode
- type ResponseData
Constants ¶
View Source
const (
UserInfoKey = "user_id"
)
Variables ¶
View Source
var ErrUserNotLogin = errors.New("用户未登录")
Functions ¶
func ResponseError ¶
func ResponseErrorWithMsg ¶
func ResponseSuccess ¶
func SignUpHandler ¶
@Summary 用户注册 @Description 用户注册 @Tags 用户注册 @Accept application/json @Produce application/json @Param Authorization header string false "Bearer 用户令牌" @Param object query models.ParamPostList false "查询参数" @Security ApiKeyAuth @Success 200 {object} _ResponsePostList @Router /api/v1/signup [post] SignUpHandler 用户注册
func SignUpParamStructLevelValidation ¶
func SignUpParamStructLevelValidation(sl validator.StructLevel)
SignUpParamStructLevelValidation 自定义SignUpParam结构体校验函数
Types ¶
type ResponseData ¶
type ResponseData struct { Code ResCode `json:"code"` Msg interface{} `json:"msg"` Data interface{} `json:"data"` }
Click to show internal directories.
Click to hide internal directories.