api

package
v0.0.0-...-160c400 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseJSON

func ResponseJSON(ctx *gin.Context, errCode int, msg string, data interface{})

Types

type DefaultController

type DefaultController struct {
}

func NewDefaultController

func NewDefaultController() *DefaultController

func (DefaultController) RegisterRoute

func (c DefaultController) RegisterRoute(root *gin.RouterGroup)

type GetRecordForm

type GetRecordForm struct {
	Period string `json:"period" form:"period" binding:"required"`
	Type   string `json:"type" form:"type" binding:"required,oneof=TwoToneSphere SuperLotto"`
}

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 Pager

type Pager struct {
	Cursor  int64 `json:"cursor"`
	Size    int64 `json:"size"`
	HasMore bool  `json:"has_more"`
}

type Response

type Response struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type TicketForm

type TicketForm struct {
	Number string `json:"number" form:"number" binding:"required"`
	Period string `json:"period" form:"period" binding:"required"`
	Type   string `json:"type" form:"type" binding:"required"`
}

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]

type UserForm

type UserForm struct {
	Name  string `json:"name" form:"name" binding:"required"`
	Phone string `json:"phone" form:"phone" binding:"required,email"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL