controllers

package
v0.0.0-...-8adfce3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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

func Init

func Init()

Types

type Admin

type Admin struct {
	Base
}

func (Admin) ActivateUser

func (c Admin) ActivateUser(id int64) revel.Result

func (Admin) DeleteCategory

func (c Admin) DeleteCategory(id int64) revel.Result

func (Admin) DeleteUser

func (c Admin) DeleteUser(id int64) revel.Result

func (Admin) EditCategory

func (c Admin) EditCategory(id int64) revel.Result

func (Admin) EditCategoryPost

func (c Admin) EditCategoryPost(id int64, category models.Category) revel.Result

func (Admin) Index

func (c Admin) Index() revel.Result

func (Admin) ListCategory

func (c Admin) ListCategory() revel.Result

func (Admin) ListUser

func (c Admin) ListUser() revel.Result

func (Admin) NewCategory

func (c Admin) NewCategory() revel.Result

func (Admin) NewCategoryPost

func (c Admin) NewCategoryPost(category models.Category) revel.Result

type App

type App struct {
	Base
}

func (App) Index

func (c App) Index() revel.Result

type Base

type Base struct {
	*revel.Controller
}

type PageNum

type PageNum struct {
	Num       int
	Url       string
	IsCurrent bool
}

type Pagination

type Pagination struct {
	// contains filtered or unexported fields
}

func GetTopics

func GetTopics(page int, where string, order string, url string) ([]models.Topic, *Pagination)

func NewPagination

func NewPagination(page, rowCount int, url string) *Pagination

func (*Pagination) Pages

func (p *Pagination) Pages() []PageNum

type Product

type Product struct {
	Base
}

func (Product) Edit

func (c Product) Edit(id int64) revel.Result

func (Product) EditPost

func (c Product) EditPost(id int64, product models.Product) revel.Result

func (Product) Index

func (c Product) Index() revel.Result

func (Product) New

func (c Product) New() revel.Result

func (Product) NewPost

func (c Product) NewPost(product models.Product) revel.Result

type Sizer

type Sizer interface {
	Size() int64
}

type Topic

type Topic struct {
	Base
}

func (Topic) Category

func (c Topic) Category(id int64, page int) revel.Result

帖子分类查询,帖子列表按时间排序

func (Topic) Edit

func (c Topic) Edit(id int64) revel.Result

func (Topic) EditPost

func (c Topic) EditPost(id int64, topic models.Topic, category int64) revel.Result

func (Topic) Good

func (c Topic) Good(page int) revel.Result

func (Topic) Hot

func (c Topic) Hot(page int) revel.Result

func (Topic) Index

func (c Topic) Index(page int) revel.Result

帖子列表

func (Topic) New

func (c Topic) New() revel.Result

func (Topic) NewPost

func (c Topic) NewPost(topic models.Topic, category int64) revel.Result

func (Topic) Reply

func (c Topic) Reply(id int64, content string) revel.Result

回复帖子

func (Topic) SetGood

func (c Topic) SetGood(id int64) revel.Result

func (Topic) Show

func (c Topic) Show(id int64) revel.Result

帖子详细

type User

type User struct {
	Base
}

func (User) Edit

func (c User) Edit() revel.Result

func (User) EditPost

func (c User) EditPost(avatar string) revel.Result

func (User) ForgotPassword

func (c User) ForgotPassword() revel.Result

func (User) ForgotPasswordPost

func (c User) ForgotPasswordPost(email string) revel.Result

func (User) ResetPassword

func (c User) ResetPassword(code string) revel.Result

func (User) ResetPasswordPost

func (c User) ResetPasswordPost(code, password, confirmPassword string) revel.Result

func (User) Signin

func (c User) Signin() revel.Result

func (User) SigninPost

func (c User) SigninPost(name, password string) revel.Result

func (User) Signout

func (c User) Signout() revel.Result

func (User) Signup

func (c User) Signup() revel.Result

func (User) SignupPost

func (c User) SignupPost(user models.User) revel.Result

func (User) Validate

func (c User) Validate(code string) revel.Result

type Vars

type Vars map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL