Documentation ¶
Index ¶
- func DeleteSession(session *Session)
- func DeleteUserSession(userid string)
- func EditPage(id, name, header, body, footer string, siteID *primitive.ObjectID) error
- func NewBBS(name, parentID, description string, siteID primitive.ObjectID) error
- func NewOnlineActive(siteid primitive.ObjectID, ua, clientIP string, session *Session)
- func NewPage(name, header, body, footer, alias string, siteID *primitive.ObjectID) error
- func NewResource(name, contentType, raw string) error
- type Article
- type ArticleReply
- type BBS
- type BBSContext
- type File
- type Online
- type OnlineObj
- type Page
- type Reply
- type Resource
- type Session
- type Site
- type SiteExtra
- type Stats
- type Theme
- type Thread
- func LoadThreadByAlias(alias string) (*Thread, error)
- func LoadThreadByID(id string) (*Thread, error)
- func LoadThreadsByBBSID(siteID primitive.ObjectID, bbsID primitive.ObjectID, page, size int64) ([]*Thread, error)
- func LoadThreadsByFilterAndOptions(siteID primitive.ObjectID, size int64, filter *bson.M, ...) ([]*Thread, error)
- type User
- func LoadUserByActiveToken(token string) (*User, error)
- func LoadUserByEmail(email string) (*User, error)
- func LoadUserByID(userID string) (*User, error)
- func LoadUserByLoginID(user string) (*User, error)
- func LoadUserByName(name string) (*User, error)
- func NewActivedUser(name, email, phone, password string, coin int64, createTime time.Time, ...) (*User, error)
- func NewUser(name, email, password string, siteID primitive.ObjectID) (*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOnlineActive ¶
NewOnlineActive 在线活动
Types ¶
type Article ¶
type Article struct { ID primitive.ObjectID `bson:"_id"` Title string Content string CreateTime time.Time Author *Session Replies []*ArticleReply ViewCount int64 }
Article 文章
func NewArticle ¶
NewArticle 新文章
type ArticleReply ¶
type ArticleReply struct { ID primitive.ObjectID `bson:"_id"` Content string CreateTime time.Time UserAgent string Author *Session }
ArticleReply 文章回复
type BBS ¶
type BBS struct { ID primitive.ObjectID `bson:"_id"` SiteID primitive.ObjectID Name string ParentID *primitive.ObjectID BBSContexts []*BBSContext Description string CreateTime time.Time Stats *Stats }
BBS 论坛
type BBSContext ¶
BBSContext 版块上下文
type Online ¶
type Online struct { SiteID primitive.ObjectID User *Session UserAgent string LastActiveTime time.Time IP string }
Online 在线用户
func LoadOnline ¶
LoadOnline 加载在线用户
type Page ¶
type Page struct { ID primitive.ObjectID `bson:"_id"` SiteID primitive.ObjectID Alias string Name string SysPage bool Body template.HTML Header template.HTML CreateTime time.Time }
Page Site Pages
func LoadPageByAlias ¶
LoadPageByAlias 按别名加载站点页面
type Reply ¶
type Reply struct { ID primitive.ObjectID `bson:"_id"` Content string CreateTime time.Time Author *Session UserAgent string }
Reply 帖子回复
type Resource ¶
type Resource struct { ID primitive.ObjectID `bson:"_id"` Name string ContentType string Raw []byte Etag string }
Resource 资源
type Session ¶
type Session struct { SID string Name string Avatar string Email string UserID string Active bool CreateTime time.Time }
Session 用户会话
type Site ¶
type Site struct { ID primitive.ObjectID `bson:"_id"` Name string User *User Main bool Hosts []string CreateTime time.Time Themes []*Theme Header template.HTML }
Site 站点
func NewSiteBundleUser ¶
NewSiteBundleUser 新站点并绑定用户
func (*Site) UpdatePkiValidation ¶
UpdatePkiValidation 更新PkiValidation
type Thread ¶
type Thread struct { ID primitive.ObjectID `bson:"_id"` SiteID primitive.ObjectID BBSID primitive.ObjectID BBSContexts []*BBSContext Title string Alias string Author *Session UserAgent string Content string CreateTime time.Time LastActiveTime time.Time ViewCount int64 GoodCount int64 GoodUsers []*Session Replies []*Reply }
Thread 帖子
func LoadThreadByAlias ¶
LoadThreadByAlias 按别名获取帖子
func LoadThreadsByBBSID ¶
func LoadThreadsByBBSID(siteID primitive.ObjectID, bbsID primitive.ObjectID, page, size int64) ([]*Thread, error)
LoadThreadsByBBSID LoadThreadsByBBSID
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id"` SiteID primitive.ObjectID Name string Password string Avatar string Phone string Email string CreateTime time.Time Coins *map[string]int64 OnlineDuration *map[string]*OnlineObj Active bool ActiveToken string }
User 用户
func LoadUserByActiveToken ¶
LoadUserByActiveToken 按激活码加载用户
func LoadUserByLoginID ¶
LoadUserByLoginID 按登录ID加载
func NewActivedUser ¶
func NewActivedUser(name, email, phone, password string, coin int64, createTime time.Time, siteID primitive.ObjectID) (*User, error)
NewActivedUser 新用户(更多初始化信息)
func (*User) ChangePassword ¶
ChangePassword 更改密码
Source Files ¶
Click to show internal directories.
Click to hide internal directories.