Documentation ¶
Index ¶
- Constants
- func NewArchive(event Event)
- type Article
- type ArticleComment
- type ArticleForm
- type ArticleLike
- type Block
- type BlockConfig
- type Category
- type CommentLike
- type Event
- type EventType
- type Image
- type ImageForm
- type Profile
- type RegisterForm
- type Style
- type Template
- type UploadResultJSON
- type User
Constants ¶
View Source
const ( EVENT_JOIN = iota EVENT_LEAVE EVENT_MESSAGE )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article struct { Id int `orm:"column(id);auto"` User *User `orm:"rel(fk)"` Title string `orm:"column(title);size(255);"` Content string `orm:"column(content);size(128)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` Type int Stars int // we may need redis help with this AllowComments bool Category *Category `orm:"rel(fk);null;default(null)"` ArticleComment []*ArticleComment `orm:"reverse(many)"` Likes []*ArticleLike `orm:"reverse(many)"` }
Article model articles in db
type ArticleComment ¶
type ArticleComment struct { Id int `orm:"column(id);auto"` User *User `orm:"rel(fk)"` Article *Article `orm:"rel(fk)"` Likes []*CommentLike `orm:"reverse(many)"` }
ArticleComment model articles_comments in db
type ArticleForm ¶
type ArticleForm struct { Id int `form:"-"` Title string `form:"title" valid:"Required;MinSize(4);MaxSize(300)"` Category int `form:"category"` Content string `form:"content" valid:"Required;MinSize(50);MaxSize(2000)"` TopicTags string `form:"topic-tags" valid:"MinSize(4);MaxSize(300)"` TaggedUsers string `form:"tagged-users" valid:"MinSize(4);MaxSize(300)"` AllowReviews bool `form:"allow-reviews" valid:"Required"` AllowComments bool `form:"allow-comments" valid:"Required"` InvalidFields map[string]string `form:"-"` }
ArticleForm ...
type ArticleLike ¶
type ArticleLike struct { Id int `orm:"column(id);auto"` User *User `orm:"rel(fk)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` Article *Article `orm:"rel(fk)"` }
ArticleLike model
type Block ¶
type Block struct { Id int `orm:"column(id);auto"` Name string `orm:"column(title);size(255);"` Content string `orm:"column(content);size(128)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` Type string `orm:"column(type);size(128)"` IsActive bool Position int }
Block model blocks in db
type BlockConfig ¶
type BlockConfig struct { Id int `orm:"column(id);auto"` Block *Block `orm:"rel(fk)"` Key string `orm:"column(title);size(255);"` Value string `orm:"column(title);size(255);"` Type string `orm:"column(title);size(255);"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` Config []*BlockConfig `orm:"reverse(many)"` }
BlockConfig model
type Category ¶
type Category struct { Id int `orm:"column(id);auto"` Name string `orm:"column(name);size(128)"` Articles []*Article `orm:"reverse(many)"` }
Category model categories in db
type CommentLike ¶
type CommentLike struct { Id int `orm:"column(id);auto"` User *User `orm:"rel(fk)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` Comment *ArticleComment `orm:"rel(fk)"` }
CommentLike model
type Event ¶
type Image ¶
type Image struct { Id int `orm:"column(id);auto"` User *User `orm:"rel(fk)"` Title string `orm:"column(title);size(255);"` Url string `orm:"column(url);size(255);"` Type int Category *Category `orm:"rel(fk);null;default(null)"` }
Image model articles in db
type ImageForm ¶
type ImageForm struct { Name string `form:"name" valid:"Required;"` User int `form:"user" valid:"Required;Numeric"` Targets string `form:"target" valid:"Required;"` PivoteX int `form:"pivotex" valid:"Required;Numeric"` PivoteY int `form:"pivotey" valid:"Required;Numeric"` ImageType string `form:"name" valid:"Required;"` Description string `form:"description" valid:"Required;AlphaNumeric;MinSize(4);MaxSize(300)"` File []byte `form:"-"` InvalidFields map[string]string `form:"-"` }
ImageForm ...
type Profile ¶
type Profile struct { Id int User *User `orm:"reverse(one)"` Name string Avatar string Age int16 Lema string Description string Gender bool }
Profile model
func (*Profile) GetPermissions ¶
GetPermissions get user permissions data
type RegisterForm ¶
type RegisterForm struct { Name string `form:"name" valid:"Required;"` Email string `form:"email" valid:"Required;"` Username string `form:"username" valid:"Required;AlphaNumeric;MinSize(4);MaxSize(300)"` Password string `form:"password" valid:"Required;MinSize(4);MaxSize(30)"` PasswordRe string `form:"passwordre" valid:"Required;MinSize(4);MaxSize(30)"` Gender bool `form:"gender" valid:"Required"` InvalidFields map[string]string `form:"-"` }
RegisterForm ...
func (*RegisterForm) Validate ¶
func (form *RegisterForm) Validate() bool
Validate RegisterForm data
type Style ¶
type Style struct { Id int `orm:"column(id);auto"` Name string `orm:"column(name);size(50);unique"` Template *Template `orm:"rel(fk)"` Active bool `orm:"column(active)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` }
Style model
type Template ¶
type Template struct { Id int `orm:"column(id);auto"` Name string `orm:"column(name);size(50);unique"` Style []*Style `orm:"reverse(many)"` Active bool `orm:"column(active)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` }
Template model
type UploadResultJSON ¶
type UploadResultJSON struct { Id int `json:"id"` Msg string `json:"message"` Url string `orm:"column(url);size(255);"` }
UploadResultJSON model articles in db
type User ¶
type User struct { Id int `orm:"column(id);auto"` Username string `orm:"column(username);size(50);unique"` Email string `orm:"column(email);size(255);"` Password string `orm:"column(password);size(128)"` CreateTime time.Time `orm:"column(create_time);type(timestamp);auto_now_add"` Admin bool `orm:"column(admin)"` Rands string `orm:"size(10)"` Profile *Profile `orm:"rel(one)"` Article []*Article `orm:"reverse(many)"` Permissions string }
User model
Click to show internal directories.
Click to hide internal directories.