cfg

package
v0.0.0-...-bbde6db Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// TimeLayout 时间格式化
	TimeLayout = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func FreeDB

func FreeDB()

FreeDB 释放数据库连接

func GetDB

func GetDB() *sql.DB

GetDB 获取数据库连接

func HomeTmpl

func HomeTmpl() []byte

HomeTmpl 获取首页模板.

func InitDB

func InitDB() (err error)

InitDB 初始化数据库连接

func InitTmpl

func InitTmpl()

InitTmpl 初始化模板, 从硬盘中加载HTML.

func LoadEnv

func LoadEnv()

LoadEnv 加载环境变量文件, 并检查必填的环境变量

Types

type Member

type Member struct {
	ID         int    `json:"id"`
	OpenID     string `json:"openid"`
	Name       string `json:"name"`
	Tel        string `json:"tel"`
	Email      string `json:"email"`
	Edu        string `json:"edu"`
	WechatAuth string `json:"wechatauth"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
	// contains filtered or unexported fields
}

Member 会员信息

func (*Member) CreatedTs

func (member *Member) CreatedTs() int64

CreatedTs 获取创建时间戳

func (*Member) EduMajor

func (member *Member) EduMajor(school string) (sid, psw string)

EduMajor 获取主修专业账号

func (*Member) EduSecond

func (member *Member) EduSecond(school string) (sid2, psw2 string)

EduSecond 获取辅修专业账号

func (*Member) UpdatedTs

func (member *Member) UpdatedTs() int64

UpdatedTs 获取更新时间戳

func (*Member) WechatAuthObj

func (member *Member) WechatAuthObj() (result *WechatAuth)

WechatAuthObj 获取微信授权信息

type WechatAuth

type WechatAuth struct {
	OpenID     string   `json:"openid"`
	Nickname   string   `json:"nickname"`
	Sex        int      `json:"sex"`
	Province   string   `json:"province"`
	City       string   `json:"city"`
	Country    string   `json:"country"`
	HeadImgURL string   `json:"headimgurl"`
	Privilege  []string `json:"privilege"`
	UnionID    string   `json:"unionid"`
}

WechatAuth 微信授权信息

Jump to

Keyboard shortcuts

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