Documentation ¶
Index ¶
- func ResponseJSON(ctx *gin.Context, errCode int, msg string, data interface{})
- type DefaultController
- type GetRecordForm
- type JwtController
- type LotteryController
- func (c LotteryController) CheckTicket(ctx *gin.Context)
- func (c LotteryController) CreateRecord(ctx *gin.Context)
- func (c LotteryController) CreateTicket(ctx *gin.Context)
- func (c LotteryController) GetRecord(ctx *gin.Context)
- func (c LotteryController) GetTicket(ctx *gin.Context)
- func (c LotteryController) Migration(ctx *gin.Context)
- func (c LotteryController) RegisterRoute(engine *gin.RouterGroup)
- type Pager
- type Response
- type TicketForm
- type UserController
- func (c UserController) CreateUser(ctx *gin.Context)
- func (c UserController) DeleteUser(ctx *gin.Context)
- func (c UserController) GetUser(ctx *gin.Context)
- func (c UserController) GetUserList(ctx *gin.Context)
- func (c UserController) Migration(ctx *gin.Context)
- func (c UserController) RegisterRoute(root *gin.RouterGroup)
- func (c UserController) UpdateUser(ctx *gin.Context)
- type UserForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultController ¶
type DefaultController struct { }
func NewDefaultController ¶
func NewDefaultController() *DefaultController
func (DefaultController) RegisterRoute ¶
func (c DefaultController) RegisterRoute(root *gin.RouterGroup)
type GetRecordForm ¶
type JwtController ¶
type JwtController struct {
// contains filtered or unexported fields
}
func NewJwtController ¶
func NewJwtController(jwt *middleware.JWTMiddleware) *JwtController
func (JwtController) RegisterRoute ¶
func (j JwtController) RegisterRoute(engine *gin.RouterGroup)
func (JwtController) TestJwt ¶
func (j JwtController) TestJwt(ctx *gin.Context)
type LotteryController ¶
type LotteryController struct {
// contains filtered or unexported fields
}
func NewLotteryController ¶
func NewLotteryController(lotteryService *service.LotteryService, jwtMiddleware *middleware.JWTMiddleware) *LotteryController
func (LotteryController) CheckTicket ¶
func (c LotteryController) CheckTicket(ctx *gin.Context)
func (LotteryController) CreateRecord ¶
func (c LotteryController) CreateRecord(ctx *gin.Context)
func (LotteryController) CreateTicket ¶
func (c LotteryController) CreateTicket(ctx *gin.Context)
func (LotteryController) GetRecord ¶
func (c LotteryController) GetRecord(ctx *gin.Context)
func (LotteryController) GetTicket ¶
func (c LotteryController) GetTicket(ctx *gin.Context)
func (LotteryController) Migration ¶
func (c LotteryController) Migration(ctx *gin.Context)
@create lottery tables @Summary init lottery table @Produce json @Success 200 {object} Response @Failure 500 {object} Response @Router /tool/migration/ticket [get]
func (LotteryController) RegisterRoute ¶
func (c LotteryController) RegisterRoute(engine *gin.RouterGroup)
type TicketForm ¶
type UserController ¶
type UserController struct {
UserSimpleService *repository.UserRepository
}
func NewUserController ¶
func NewUserController(userSimpleService *repository.UserRepository) *UserController
func (UserController) CreateUser ¶
func (c UserController) CreateUser(ctx *gin.Context)
@创建用户 @Summary create a user @Param name body string true "name" @Param phone body string true "phone" @Success 200 {object} Response @Failure 200 {object} Response @Router /v1/user [post]
func (UserController) DeleteUser ¶
func (c UserController) DeleteUser(ctx *gin.Context)
@更新用户 @Summary delete a user @Produce json @Param id path string true "id" @Success 200 {object} Response @Failure 500 {object} Response @Router /v1/user/{id} [delete]
func (UserController) GetUser ¶
func (c UserController) GetUser(ctx *gin.Context)
@获取指定ID用户 @Summary Get a single user @Produce json @Param id path int true "ID" @Success 200 {object} Response @Failure 500 {object} Response @Router /v1/user/{id} [get]
func (UserController) GetUserList ¶
func (c UserController) GetUserList(ctx *gin.Context)
@获取用户列表 @Summary Get user list @Produce json @Success 200 {object} Response @Failure 500 {object} Response @Router /v1/user [get]
func (UserController) Migration ¶
func (c UserController) Migration(ctx *gin.Context)
@创建用户表 @Summary init user table @Produce json @Success 200 {object} Response @Failure 500 {object} Response @Router /tool/migration/user [get]
func (UserController) RegisterRoute ¶
func (c UserController) RegisterRoute(root *gin.RouterGroup)
func (UserController) UpdateUser ¶
func (c UserController) UpdateUser(ctx *gin.Context)
@更新用户 @Summary update a user @Param name body string true "name" @Param phone body string true "phone" @Success 200 {object} Response @Failure 200 {object} Response @Router /v1/user [put]