Documentation ¶
Index ¶
- Constants
- Variables
- func Init()
- type Admin
- func (c Admin) ActivateUser(id int64) revel.Result
- func (c Admin) DeleteCategory(id int64) revel.Result
- func (c Admin) DeleteUser(id int64) revel.Result
- func (c Admin) EditCategory(id int64) revel.Result
- func (c Admin) EditCategoryPost(id int64, category models.Category) revel.Result
- func (c Admin) Index() revel.Result
- func (c Admin) ListCategory() revel.Result
- func (c Admin) ListUser() revel.Result
- func (c Admin) NewCategory() revel.Result
- func (c Admin) NewCategoryPost(category models.Category) revel.Result
- type App
- type Base
- type PageNum
- type Pagination
- type Product
- type Sizer
- type Topic
- func (c Topic) Category(id int64, page int) revel.Result
- func (c Topic) Edit(id int64) revel.Result
- func (c Topic) EditPost(id int64, topic models.Topic, category int64) revel.Result
- func (c Topic) Good(page int) revel.Result
- func (c Topic) Hot(page int) revel.Result
- func (c Topic) Index(page int) revel.Result
- func (c Topic) New() revel.Result
- func (c Topic) NewPost(topic models.Topic, category int64) revel.Result
- func (c Topic) Reply(id int64, content string) revel.Result
- func (c Topic) SetGood(id int64) revel.Result
- func (c Topic) Show(id int64) revel.Result
- type User
- func (c User) Edit() revel.Result
- func (c User) EditPost(avatar string) revel.Result
- func (c User) ForgotPassword() revel.Result
- func (c User) ForgotPasswordPost(email string) revel.Result
- func (c User) ResetPassword(code string) revel.Result
- func (c User) ResetPasswordPost(code, password, confirmPassword string) revel.Result
- func (c User) Signin() revel.Result
- func (c User) SigninPost(name, password string) revel.Result
- func (c User) Signout() revel.Result
- func (c User) Signup() revel.Result
- func (c User) SignupPost(user models.User) revel.Result
- func (c User) Validate(code string) revel.Result
- type Vars
Constants ¶
View Source
const ( ROWS_PER_PAGE = 11 // 每页几条记录 PAGES_PER_VIEW = 10 // 最多显示几个页码 )
View Source
const ( ADMIN_GROUP = iota + 1 MEMBER_GROUP )
Variables ¶
View Source
var ( UPLOAD_PATH string IMAGE_EXTS string = ".jpg.jpeg.png" IMAGE_LIMIT_SIZE int64 = 500 * 1024 )
View Source
var ( SUCCESS_JSON = map[string]bool{"status": true} ERROR_JSON = map[string]bool{"status": false} )
View Source
var Permissions = map[string]int{ "Admin.Index": ADMIN_GROUP, "Admin.ListUser": ADMIN_GROUP, "Admin.DeleteUser": ADMIN_GROUP, "Admin.NewCategory": ADMIN_GROUP, "Admin.EditCategory": ADMIN_GROUP, "Admin.ListCategory": ADMIN_GROUP, "Admin.DeleteCategory": ADMIN_GROUP, "Admin.DeleteProduct": ADMIN_GROUP, "Topic.New": MEMBER_GROUP, "Topic.Edit": MEMBER_GROUP, "Topic.Reply": MEMBER_GROUP, "Topic.SetGood": ADMIN_GROUP, "User.Edit": MEMBER_GROUP, "Product.New": MEMBER_GROUP, "Product.Edit": MEMBER_GROUP, }
Functions ¶
Types ¶
type Admin ¶
type Admin struct {
Base
}
func (Admin) EditCategoryPost ¶
func (Admin) ListCategory ¶
func (Admin) NewCategory ¶
type Base ¶
type Base struct {
*revel.Controller
}
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
func NewPagination ¶
func NewPagination(page, rowCount int, url string) *Pagination
func (*Pagination) Pages ¶
func (p *Pagination) Pages() []PageNum
Click to show internal directories.
Click to hide internal directories.