api

package
v0.0.0-...-35f9073 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChipTypeConfs = []*ChipTypeConf{}

ChipTypeConfs ...

View Source
var CodeMap = map[int32]string{
	2000001: "token为空",
	2000002: "wrong token",
	2000003: "Invalid token1",
	2000004: "Invalid token2",
}

CodeMap 返回码映射表

Functions

func Authentication

func Authentication() gin.HandlerFunc

Authentication 认证

func BalanceAdd

func BalanceAdd(c *gin.Context)

BalanceAdd 增加结算类型

func BalanceDetailAdd

func BalanceDetailAdd(c *gin.Context)

BalanceDetailAdd 增加结算类型

func BalanceDetailList

func BalanceDetailList(c *gin.Context)

BalanceDetailList ...

func ChipAdd

func ChipAdd(c *gin.Context)

ChipAdd ...

func ChipList

func ChipList(c *gin.Context)

ChipList ...

func DecodeToken

func DecodeToken(tokenStr string) (claims jwt.MapClaims, code int32)

DecodeToken 解析token

func GenPassword

func GenPassword(certificate string) (passHash string, err error)

GenPassword ...

func GetToken

func GetToken(u *dao.UserAuth) (tokenStr string, err error)

GetToken 生成一个简单的token, 后续优化

func GuessAdd

func GuessAdd(c *gin.Context)

GuessAdd 增加竞猜

func GuessDelete

func GuessDelete(c *gin.Context)

GuessDelete 删除竞猜

func GuessRecordAdd

func GuessRecordAdd(c *gin.Context)

GuessRecordAdd 增加竞猜

func GuessRecordList

func GuessRecordList(c *gin.Context)

GuessRecordList ...

func GuessTypeAdd

func GuessTypeAdd(c *gin.Context)

GuessTypeAdd 增加结算类型

func GuessTypeList

func GuessTypeList(c *gin.Context)

GuessTypeList ...

func LoadChipTypeConf

func LoadChipTypeConf()

LoadChipTypeConf 加载

func ResetPassword

func ResetPassword(c *gin.Context)

ResetPassword ...

func SettleList

func SettleList(c *gin.Context)

SettleList ...

func SettleTypeAdd

func SettleTypeAdd(c *gin.Context)

SettleTypeAdd 增加结算类型

func SignIn

func SignIn(c *gin.Context)

SignIn 登录

func SignUp

func SignUp(c *gin.Context)

SignUp 注册

func TeamList

func TeamList(c *gin.Context)

TeamList _

Types

type ChipTypeConf

type ChipTypeConf struct {
	ID   int64  `json:"id"`
	Name string `json:"name" form:"name" binding:"required"`
	Desc string `json:"desc" form:"desc" binding:"required"`
}

ChipTypeConf ...

type GuessInfo

type GuessInfo struct {
	ID           int64     `json:"id,omitempty" form:"id" db:"id"`
	UID          int64     `json:"uid" form:"uid" db:"uid"`
	Name         string    `json:"name" form:"name" db:"name" `
	SettleTypeID int64     `json:"settle_type_id" form:"settle_type_id" db:"settle_type_id" `
	GuessTypeID  int64     `json:"guess_type_id" form:"guess_type_id" db:"chip_type_id" `
	ChipTypeID   int64     `json:"chip_type_id" form:"chip_type_id" db:"chip_type_id" `
	Result       int64     `json:"result" form:"result" db:"result" `
	FundPool     int64     `json:"fund_pool" form:"fund_pool" db:"fund_pool"`
	Info         Info      `json:"Info" form:"Info" db:"Info" `
	StartTime    string    `json:"start_time" form:"start_time" db:"start_time" `
	EndTime      string    `json:"end_time" form:"end_time" db:"end_time" `
	CreatedAt    time.Time `json:"created_at" form:"created_at" db:"created_at"`
	UpdateAt     time.Time `json:"updated_at" form:"updated_at" db:"updated_at"`
	Status       int8      `json:"status" form:"updated_at" db:"status"`
}

GuessInfo 竞猜信息表

type GuessListConf

type GuessListConf struct {
	Num  int64 `json:"num" form:"num" binding:"required"`
	Page int64 `json:"page" form:"page" binding:"required"`
}

GuessListConf 参数

type GuessRecord

type GuessRecord struct {
	ID          int64     `json:"id omitempty" form:"id"`
	UID         int64     `json:"uid" form:"uid" binding:"required"`
	GID         int64     `json:"gid" form:"gid" binding:"required"`
	Amount      int64     `json:"Amount" form:"Amount" binding:"required"`
	GuessTypeID int64     `json:"guess_type_id" form:"guess_type_id" binding:"required"`
	ChipTypeID  int64     `json:"chip_type_id" form:"chip_type_id" binding:"required"`
	Result      int64     `json:"result" form:"result" binding:"required"`
	Earnings    int64     `json:"earnings" form:"earnings" binding:"required"`
	Odds        int64     `json:"odds" form:"odds" binding:"required"`
	CreatedAt   time.Time `json:"created_at" form:"created_at"`
	UpdateAt    time.Time `json:"updated_at" form:"updated_at"`
	Status      int8      `json:"status" form:"updated_at"`
}

GuessRecord 竞猜信息

type GuessRecordConf

type GuessRecordConf struct {
	Num  int64 `json:"num" form:"num" binding:"required"`
	Page int64 `json:"page" form:"page" binding:"required"`
}

GuessRecordConf 参数

type Info

type Info struct {
	Teams   []int64
	Options []*Option
}

Info ...

type Option

type Option struct {
	Name  string `json:"name" form:"name" db:"name"`
	Value int    `json:"value" form:"value" db:"name"`
}

Option ...

type UserAuth

type UserAuth struct {
	ID          int64     `form:"id" json:"id,omitempty"`
	AuthType    int8      `form:"auth_type" json:"auth_type"`
	Identifier  string    `form:"identifier" json:"identifier" binding:"required"`
	Certificate string    `form:"certificate" json:"certificate" binding:"required"`
	CreatedAt   time.Time `form:"created_at" json:"created_at"`
	UpdateAt    time.Time `form:"updated_at" json:"updated_at"`
	Status      int8      `form:"status" json:"status"`
}

UserAuth ...

Jump to

Keyboard shortcuts

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