model

package
v0.0.0-...-ec8cf66 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserTable = "Users"
)

Functions

func AddExam

func AddExam(question string, options []string, anwser int8, resolve string) (int, error)

*

  • add exam..

func AddUser

func AddUser(UserName, UserPwd string, UserCoin, UserWin, UserLose int) (int, error)

*

  • 注册一个用户

func GetAllExamId

func GetAllExamId() ([]int, error)

*

  • get all exam ids..

func NewModel

func NewModel(url string)

Types

type Exam

type Exam struct {
	Id_          bson.ObjectId `bson:"_id"`
	ExamId       int
	ExamQuestion string
	ExamOption   []string
	ExamAnwser   int8
	ExamResolve  string
	ExamTime     time.Time
}

func GetExam

func GetExam(examId int) (Exam, error)

*

  • get exam by examid.

type Model

type Model struct {
}

type Status

type Status struct {
	Id_       bson.ObjectId `bson:"_id"`
	UserIndex int
	ExamIndex int
}

func GetStatus

func GetStatus() Status

*

  • 获取状态

type Users

type Users struct {
	Id_         bson.ObjectId `bson:"_id"`
	UserId      int
	UserName    string
	UserPwd     string
	UserCoin    int
	UserWin     int
	UserLose    int
	UserRegTime time.Time
}

func GetUser

func GetUser(UserName string) (Users, error)

*

  • 根据用户名获取用户信息

func GetUserById

func GetUserById(UserId int) (Users, error)

Jump to

Keyboard shortcuts

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