models

package
v0.0.0-...-c62eee3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFilePath = "../config.toml"

Variables

This section is empty.

Functions

func Contains

func Contains(arr []int, u uint) bool

func GetDB

func GetDB() *gorm.DB

func GetDbUri

func GetDbUri() string

func GetEditionIds

func GetEditionIds() []int64

func ReadConfig

func ReadConfig() *toml.Tree

Types

type Code

type Code struct {
	Data string `json:"code" binding:"required"`
}

type Game

type Game struct {
	ID          uint      `gorm:"primarykey" json:"id"`
	CreatedAt   time.Time `json:"_"`
	UpdatedAt   time.Time `json:"_"`
	DeletedAt   time.Time `json:"_"`
	Title       string    `gorm:"type:varchar(100);unique_index" json:"title"`
	Cover       string    `gorm:"type:varchar(200)" json:"cover"`
	ReleaseDate string    `gorm:"type:varchar(200)" json:"release_date"` // 原谅我
	Rating      float64   `gorm:"type:decimal(10, 2)" json:"rating"`
	Area        string    `gorm:"type:varchar(100)" json:"area"`
	Languages   string    `gorm:"type:varchar(100)" json:"languages"`
	Platforms   string    `gorm:"type:varchar(100)" json:"platforms"`
	DoubanID    int       `gorm:"type:int" json:"douban_id"`
	Price       float64   `gorm:"type:decimal(10, 2)" json:"price"`
	Quantity    int       `gorm:"type:int" json:"quantity"`
	Desc        string    `gorm:"type:varchar(200)" json:"desc"`
	Subscribed  bool      `sql:"-" json:"subscribed"`
}

func (Game) IsRefresh

func (game Game) IsRefresh() bool

func (*Game) MarshalJSON

func (game *Game) MarshalJSON() ([]byte, error)

type GeekError

type GeekError struct {
	Msg string
}

func (GeekError) Error

func (e GeekError) Error() string

type GetAccessTokenResp

type GetAccessTokenResp struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   string `json:"expires_in"`
	Errcode     int    `json:"errcode"`
	Errmsg      string `json:"errmsg"`
}

type SubscribeData

type SubscribeData struct {
	Thing2  WxValue `json:"thing2"`
	Phrase5 WxValue `json:"phrase5"`
}

type SubscribeReq

type SubscribeReq struct {
	AccessToken string        `json:"access_token"`
	Touser      string        `json:"touser"`
	TemplateId  int           `json:"template_id"`
	Data        SubscribeData `json:"data"`
}

type Subscription

type Subscription struct {
	gorm.Model
	Uid string `gorm:"type:varchar(100)" json:"uid"`
	Gid int    `gorm:"type:int" json:"gid"`
}

type WeChatAuthResp

type WeChatAuthResp struct {
	OpenId     string `json:"openid"`
	SessionKey string `json:"session_key"`
	UnionId    string `json:"unionid"`
	ErrCode    int    `json:"errcode"`
	ErrMsg     string `json:"errmsg"`
}

type WxValue

type WxValue struct {
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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