Documentation ¶
Index ¶
- func AddBBS(bbs *BBS) (rows int64, err error)
- func AddKind(kinds *BBSKinds) (rows int64, err error)
- func AddRes(res *Response) (rows int64, err error)
- func AddUser(u *User) (int64, error)
- func DelById(id int64) (int64, error)
- func DeletUserById(id int64) (status int64, err error)
- func FindUserByUserName(userName string) bool
- func GetBBSCount() (int64, error)
- func GetBBSCountById(id int64) int64
- func GetBBSCountByUser(id int64) (int64, error)
- func GetKindsCount() (int64, error)
- func GetResCount(id int64) (count int64)
- func GetUserCount() int64
- func GetUserList(offset int, page_size int64, sort string) (users []orm.Params, count int64)
- func GetUserResCount(id int64) (count int64)
- func Orm() orm.Ormer
- func ToInt64(value interface{}) (d int64, err error)
- type BBS
- func BBSList() ([]*BBS, error)
- func BBSListOffset(offset int, page_size int64, sort string) ([]*BBS, error)
- func GetBBSById(id int64) (bbs BBS, err error)
- func GetBBSByKind(kind int64) ([]*BBS, error)
- func GetBBSByKindOffset(kind int64, offset int, page_size int64) ([]*BBS, error)
- func GetBBSByUserId(id int64) ([]*BBS, error)
- func GetBBSByUserIdOffset(id int64, offset int, page_size int64) ([]*BBS, int64, error)
- type BBSKinds
- type Paginator
- func (p *Paginator) HasNext() bool
- func (p *Paginator) HasPages() bool
- func (p *Paginator) HasPrev() bool
- func (p *Paginator) IsActive(page int) bool
- func (p *Paginator) Nums() int64
- func (p *Paginator) Offset() int
- func (p *Paginator) Page() int
- func (p *Paginator) PageLink(page int) string
- func (p *Paginator) PageLinkFirst() (link string)
- func (p *Paginator) PageLinkLast() (link string)
- func (p *Paginator) PageLinkNext() (link string)
- func (p *Paginator) PageLinkPrev() (link string)
- func (p *Paginator) PageNums() int
- func (p *Paginator) Pages() []int
- func (p *Paginator) SetNums(nums interface{})
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBBSCount ¶
func GetBBSCountById ¶
func GetBBSCountByUser ¶
func GetKindsCount ¶
func GetResCount ¶
func GetUserCount ¶
func GetUserCount() int64
func GetUserList ¶
query from database of user list
func GetUserResCount ¶
Types ¶
type BBS ¶
type BBS struct { BBSId int64 `orm:"auto;column(id)" form:"-"` BBSTitle string `orm:"column(bbsTitle)" form:"bbsName"` BBSContent string `orm:"column(bbsContent)" form:"content"` BBSKind *BBSKinds `orm:"rel(fk);column(bbsKind)" form:"-"` AddTime time.Time `orm:"auto_now_add;type(datetime);column(addTime)" form:"-"` AddAuthor *User `orm:"rel(fk);column(addAuthor)" form:"-"` }
func GetBBSById ¶
func GetBBSByKind ¶
func GetBBSByKindOffset ¶
func GetBBSByUserId ¶
func GetBBSByUserIdOffset ¶
func (*BBS) Valid ¶
func (this *BBS) Valid(v *validation.Validation)
type BBSKinds ¶
type BBSKinds struct { KindId int64 `orm:"auto;column(id)" form:"-"` KindName string `orm:"column(kindName)" valid:"MinSize(2);MaxSize(18)" form:"kindName"` Kindintro string `orm:"column(kindintro)" form:"kindIntro"` PicPath string `orm:"column(picPath)" form="-"` AddTime time.Time `orm:"auto_now_add;type(datetime);column(addTime)" form="-"` AddAuthor string `orm:"column(addAuthor)" form="-"` }
func GetKindsList ¶
func (BBSKinds) Valid ¶
func (this BBSKinds) Valid(v *validation.Validation)
type Paginator ¶
type Paginator struct { Request *http.Request PerPageNums int MaxPages int // contains filtered or unexported fields }
func (*Paginator) PageLinkFirst ¶
func (*Paginator) PageLinkLast ¶
func (*Paginator) PageLinkNext ¶
func (*Paginator) PageLinkPrev ¶
type Response ¶
type Response struct { ResId int64 `orm:"auto;column(id)" form:"-"` BBSId *BBS `orm:"rel(fk);column(bbsId)" form:"-"` Content string `orm:"column(content)" form:"content" valid:"Required;MinSize(1)"` AddTime time.Time `orm:"auto_now_add;type(datetime);column(addTime)" form:"-"` AddAuthor *User `orm:"rel(fk);column(addAuthor)" form:"-"` }
func GetResByUserId ¶
func (Response) Valid ¶
func (this Response) Valid(v *validation.Validation)
type User ¶
type User struct { UserId int64 `orm:"auto;column(id)"` UserName string `orm:"column(userName)" form:"userName" valid:"Required;MaxSize(20);MinSize(6)` Password string `orm:"column(password)" form:"password" valid:"Required;MaxSize(20);MinSize(6)"` RePassword string `orm:"-" form:"passRepeat" valid:"Required"` Sex string `orm:"column(sex)" form:"sex" valid:"Required"` Email string `orm:"column(email)" form:"email" valid:"Email"` RegTime time.Time `orm:"auto_now_add;type(datetime);column(regTime)"` UserType string `orm:"column(userType)"` PicUrl string `orm:"column(picUrl)"` }
user struct
func FindUserById ¶
func ValidateUser ¶
Click to show internal directories.
Click to hide internal directories.