models

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAdminRole = Role{
	Id:      "admin",
	Name:    "admin",
	Comment: "admin",
}
View Source
var DefaultAdminUserInfo = UserInfo{
	Id:            "admin",
	LoginName:     "admin",
	LoginPassword: "3ef7b7e37a0fe84e4c5cdcd1934db0852f608c5c925751b9ef6cf872eb6eeaca",
	Salt:          "init",
	UserName:      "admin",
	Email:         "admin@cali.io",
}
View Source
var DefaultAdminUserInfoRole = UserInfoRoleLink{
	Id:       "admin",
	UserInfo: "admin",
	Role:     "admin",
}
View Source
var (
	DefaultCaliCategory = CaliCategory{Id: "default", Category: "全部", CreatedAt: time.Now().Unix(), UpdatedAt: time.Now().Unix()}
)
View Source
var DefaultSysConfig = make([]SysConfig, 0)
View Source
var DefaultUserInfo = UserInfo{
	Id:            "init",
	LoginName:     "anyone",
	LoginPassword: "9fafdfffa1222faddec96c954ed67618aa78808842c8753d6d788e77258ada82",
	Salt:          "init",
	UserName:      "anyone",
	Email:         "anyone@cali.io",
}
View Source
var DefaultUserInfoRole = UserInfoRoleLink{
	Id:       "user",
	UserInfo: "init",
	Role:     "user",
}
View Source
var DefaultUserRole = Role{
	Id:      "user",
	Name:    "user",
	Comment: "user",
}
View Source
var DefaultWatcherRole = Role{
	Id:      "watcher",
	Name:    "watcher",
	Comment: "watcher",
}
View Source
var RoleActions = make([]RoleAction, 0)

Functions

This section is empty.

Types

type Api

type Api struct {
	Result     bool        `json:"result"`
	StatusCode int         `json:"statusCode"`
	Message    string      `json:"message"`
	Info       interface{} `json:"info"`
}

func NewErrorApi

func NewErrorApi() Api

func NewErrorApiWithInfo

func NewErrorApiWithInfo(info interface{}) Api

func NewErrorApiWithMessageAndInfo

func NewErrorApiWithMessageAndInfo(message string, info interface{}) Api

func NewOKApi

func NewOKApi() Api

func NewOKApiWithInfo

func NewOKApiWithInfo(info interface{}) Api

func NewOKApiWithMessageAndInfo

func NewOKApiWithMessageAndInfo(message string, info interface{}) Api

type CaliBook added in v0.1.0

type CaliBook struct {
	Id     string `json:"id" xorm:"pk 'id'"`
	Title  string `json:"title" xorm:"'title'"`
	Author string `json:"author" xorm:"'author'"`

	DownloadCount int    `json:"download_count" xorm:"'download_count'"`
	DoubanId      string `json:"douban_id" xorm:"'douban_id'"`
	DoubanJson    string `json:"douban_json" xorm:"'douban_json'"`

	CreatedAt int64 `json:"created" xorm:"'created'"`
	UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}

func (CaliBook) TableName added in v0.1.0

func (CaliBook) TableName() string

type CaliBookCategory added in v0.1.0

type CaliBookCategory struct {
	Id           string `json:"id" xorm:"pk 'id'"`
	CaliCategory string `json:"cali_category" xorm:"'cali_category'"`
	CaliBook     string `json:"cali_book" xorm:"'cali_book'"`

	CreatedAt int64 `json:"created" xorm:"'created'"`
	UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}

func (CaliBookCategory) TableName added in v0.1.0

func (CaliBookCategory) TableName() string

type CaliBookVo added in v0.1.0

type CaliBookVo struct {
	CaliBook

	Formats []CaliFormat `json:"formats"`

	Categories []CaliCategory `json:"categories"`
}

type CaliCategory added in v0.1.0

type CaliCategory struct {
	Id       string `json:"id" xorm:"pk 'id'"`
	Category string `json:"category" xorm:"'category'"`

	CreatedAt int64 `json:"created" xorm:"'created'"`
	UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}

func (CaliCategory) TableName added in v0.1.0

func (CaliCategory) TableName() string

type CaliFormat added in v0.1.0

type CaliFormat struct {
	Id       string `json:"id" xorm:"pk 'id'"`
	CaliBook string `json:"cali_book" xorm:"'cali_book'"`

	Format           string `json:"format" xorm:"'format'"`
	UncompressedSize int64  `json:"uncompressed_size" xorm:"'uncompressed_size'"`
	Title            string `json:"title" xorm:"'title'"`
	Author           string `json:"author" xorm:"'author'"`
	FileName         string `json:"file_name" xorm:"'file_name'"`
	Tag              string `json:"tag" xorm:"'tag'"`

	DownloadCount int `json:"download_count" xorm:"'download_count'"`

	CreatedAt int64 `json:"created" xorm:"'created'"`
	UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}

func (CaliFormat) TableName added in v0.1.0

func (CaliFormat) TableName() string

type Role added in v0.0.2

type Role struct {
	Id      string `json:"id" xorm:"pk 'id'"`
	Name    string `json:"name" xorm:"varchar(32) 'name'"`
	Comment string `json:"comment" xorm:"varchar(64) 'comment'"`
}

func (Role) TableName added in v0.0.2

func (Role) TableName() string

type RoleAction added in v0.0.2

type RoleAction struct {
	Id         string `json:"id" xorm:"pk 'id'"`
	Role       string `json:"role" xorm:"varchar(32) 'role'"`
	Controller string `json:"controller" xorm:"'controller'"`
	Method     string `json:"method" xorm:"'method'"`
	Comments   string `json:"comments" xorm:"'comments'"` //zhu shi
}

func (RoleAction) TableName added in v0.0.2

func (RoleAction) TableName() string

type SysConfig added in v0.0.3

type SysConfig struct {
	Id        string `json:"id" xorm:"pk 'id'"`
	Key       string `json:"key" xorm:"'key'"`
	Value     string `json:"value" xorm:"'value'"`
	Comments  string `json:"comments" xorm:"'comments'"`
	CreatedAt int64  `json:"created" xorm:"'created'"`
	UpdatedAt int64  `json:"updated" xorm:"'updated'"`
}

func (SysConfig) TableName added in v0.0.3

func (SysConfig) TableName() string

type SysStatus added in v0.0.4

type SysStatus struct {
	Id        string `json:"id" xorm:"pk 'id'"`
	Key       string `json:"key" xorm:"'key'"`
	Value     string `json:"value" xorm:"'value'"`
	Comments  string `json:"comments" xorm:"'comments'"`
	CreatedAt int64  `json:"created" xorm:"'created'"`
	UpdatedAt int64  `json:"updated" xorm:"'updated'"`
}

func (SysStatus) TableName added in v0.0.4

func (SysStatus) TableName() string

type UserConfig added in v0.1.0

type UserConfig struct {
	Id          string `json:"id" xorm:"pk 'id'"`
	UserInfo    string `json:"user_info" xorm:"'user_info'"`
	MaxDownload int    `json:"max_download" xorm:"'max_download' default 5"`
}

func NewUserConfig added in v0.1.0

func NewUserConfig(userInfoId string) UserConfig

func (UserConfig) TableName added in v0.1.0

func (UserConfig) TableName() string

type UserInfo added in v0.0.2

type UserInfo struct {
	Id            string `json:"id" xorm:"pk 'id'"`
	LoginName     string `json:"loginName" xorm:"varchar(64) notnull 'login_name'"`
	LoginPassword string `json:"loginPassword" xorm:"varchar(128) notnull 'login_password'"`
	Salt          string `json:"salt" xorm:"varchar(128) notnull 'salt'"`
	Email         string `json:"email" xorm:"varchar(128) 'email'"`

	UserName string `json:"userName" xorm:"varchar(64) notnull 'user_name'"`
	Img      string `json:"img" xorm:"varchar(256) 'img'"`

	Valid int `json:"valid" xorm:"int default 0 'valid'"` //0 有效 1 无效  2 wait active

	CreatedAt int64 `json:"created" xorm:"'created'"`
	UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}

func (UserInfo) TableName added in v0.0.2

func (UserInfo) TableName() string
type UserInfoBookDownloadLink struct {
	Id         string `json:"id" xorm:"pk 'id'"`
	UserInfo   string `json:"user_info" xorm:"'user_info'"`
	CaliFormat string `json:"cali_format" xorm:"'cali_format'"`
	CreatedAt  int64  `json:"created" xorm:"'created'"`
	UpdatedAt  int64  `json:"updated" xorm:"'updated'"`
}

func (UserInfoBookDownloadLink) TableName added in v0.0.4

func (UserInfoBookDownloadLink) TableName() string
type UserInfoBookUploadLink struct {
	Id         string `json:"id" xorm:"pk 'id'"`
	UserInfo   string `json:"user_info" xorm:"'user_info'"`
	CaliFormat string `json:"cali_format" xorm:"'cali_format'"`
	CreatedAt  int64  `json:"created" xorm:"'created'"`
	UpdatedAt  int64  `json:"updated" xorm:"'updated'"`
}

func (UserInfoBookUploadLink) TableName added in v0.0.4

func (UserInfoBookUploadLink) TableName() string
type UserInfoRoleLink struct {
	Id       string `json:"id" xorm:"pk 'id'"`
	UserInfo string `json:"user_info" xorm:"'user_info'"`
	Role     string `json:"role" xorm:"'role'"`
}

func (UserInfoRoleLink) TableName added in v0.0.2

func (UserInfoRoleLink) TableName() string

Jump to

Keyboard shortcuts

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