Documentation
¶
Index ¶
- func AddCategory(categoryName string) bool
- func AddTopic(topic *Topic) error
- func CheckIsExist(qs orm.QuerySeter, field string, value interface{}, skipId int) bool
- func CheckUser(username string) bool
- func CheckUserExists(username, email string) bool
- func CountObjects(qs orm.QuerySeter) (int64, error)
- func DeleteCategory(id int64) bool
- func DeleteTopic(id int64) bool
- func DeleteUser(id int64) bool
- func ListObjects(qs orm.QuerySeter, objs interface{}) (int64, error)
- func MD5(str string) string
- func ModifyCategory(category *Category) bool
- func ModifyTopic(topic *Topic) error
- func QuerySeter(tablename string) orm.QuerySeter
- func RegisterUser(user *User) error
- func UpdatePassWord(u *User) bool
- func UpdateUser(u *User) bool
- func UserModify(user *User) bool
- type Category
- type Topic
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIsExist ¶
func CheckIsExist(qs orm.QuerySeter, field string, value interface{}, skipId int) bool
检查结果集是否存在
func UpdatePassWord ¶
Types ¶
type Category ¶
type Category struct { Id int64 `orm:"auto" form:"id"` CategoryName string `orm:"size(30);index" form:"categoryname"` Created time.Time `orm:"index"` Updated time.Time `orm:"index"` }
Category结构体
type Topic ¶
type Topic struct { Id int64 `orm:"auto" form:"id"` Title string `valid:"Required" orm:"size(100);index" form:"title"` Content string `valid:"Required" orm:"size(5000);index" form:"content"` Category string `valid:"Required" orm:"size(100);index" form:"category"` Views int64 //浏览次数 ReplyCount int64 //回复次数 Username string `orm:"size(20)" valid:"Required" form:"username"` Author string `orm:"size(32)"` Created time.Time `orm:"index"` Updated time.Time `orm:"index"` }
Topic结构体
func QueryTopicByCategoryName ¶
根据CategoryName查询文章列表
type User ¶
type User struct { Id int64 `orm:"auto" form:"id"` Username string `orm:"size(20);MaxSize(20)" valid:"Required" form:"username"` Password string `orm:"size(32)" valid:"Required" form:"password"` Email string `orm:"size(32)" valid:"Required;Email;MaxSize(100)" form:"email"` Registed time.Time `orm:"index"` //注册时间 Registeip string `orm:"size(20)"` //注册ip Lastlogin time.Time `orm:"index"` //最后登录时间 Loginip string `orm:"size(20)"` //最后登录ip Nickname string `valid:"Required" orm:"size(20)" form:"nickname"` Uuid string `orm:"size(64)"` //用于验证找回密码,标识用户身份 Exprise string //找回密码失效时间 }
User结构体
func QueryUserByUsernameAndUUID ¶
根据用户名和uuid查询用户信息
Click to show internal directories.
Click to hide internal directories.