Documentation
¶
Index ¶
- Constants
- Variables
- func EncryptPassword(password, salt string) string
- func GetEngine() *xorm.Engine
- func Init()
- type Category
- type Permissions
- type Product
- type Reply
- type SmtpType
- type Topic
- type User
- func (u User) AvatarImgSrc() string
- func (u User) GetPermissions() map[int]int
- func (u User) HasEmail() bool
- func (u User) HasName() bool
- func (u User) IsActive() bool
- func (u User) IsAdmin() bool
- func (u User) IsCustomAvatar() bool
- func (u User) IsDefaultAvatar(avatar string) bool
- func (user User) Validate(v *revel.Validation)
Constants ¶
View Source
const ( USER_STATUS_INACTIVE = iota USER_STATUS_ACTIVATED USER_STATUS_DISABLE )
Variables ¶
View Source
var ( Smtp SmtpType QiniuScope string QiniuDomain string CachePageSize int // 允许缓存前几页数据 )
View Source
var ( Avatars = []string{ "gopher_teal.jpg", "gopher_aqua.jpg", "gopher_brown.jpg", "gopher_strawberry_bg.jpg", "gopher_strawberry.jpg", } DefaultAvatar = Avatars[0] )
Functions ¶
Types ¶
type Permissions ¶
type Product ¶
type Product struct { Id int64 Name string Site string Author string Repository string Description string `xorm:"text"` Image string User User `xorm:"user_id bigint"` Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` }
func (Product) Validate ¶
func (product Product) Validate(v *revel.Validation)
type Topic ¶
type Topic struct { Id int64 Title string Content string `xorm:"text"` Category Category `xorm:"category_id bigint"` User User `xorm:"user_id bigint"` Hits int Replies int Good bool Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` }
func (Topic) Validate ¶
func (topic Topic) Validate(v *revel.Validation)
type User ¶
type User struct { Id int64 Name string Email string HashedPassword string Salt string Type int // 1管理员,2普通用户 Avatar string ValidateCode string Status int Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` Password string `xorm:"-"` ConfirmPassword string `xorm:"-"` Permissions map[int]int `xorm:"-"` }
func (User) GetPermissions ¶
func (User) IsCustomAvatar ¶
func (User) Validate ¶
func (user User) Validate(v *revel.Validation)
Click to show internal directories.
Click to hide internal directories.