controllers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2017 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB int = 1 << (10 * iota)
	MB
	GB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	*revel.Controller
}

Admin controller. Admin 控制器,后代所有操作都在此控制器下

func (*Admin) AdminChecker

func (admin *Admin) AdminChecker() revel.Result

AdminChecker for get the value of which module user choose, and make the menu selected. TODO:Laily check if it is a admin user 检测 url 是访问后台哪个模块的操作

func (*Admin) Main

func (a *Admin) Main() revel.Result

Main page. 后台首页

type AdminParams

type AdminParams struct {
	Admin_user  string
	Admin_pass  string
	Admin_email string
}

type AdminTag

type AdminTag struct {
	Admin
}

func (*AdminTag) Del

func (a *AdminTag) Del(ids string) revel.Result

删除标签

func (*AdminTag) Edit

func (a *AdminTag) Edit(tagID int64, tagName, tagIdent string) revel.Result

编辑标签

func (*AdminTag) Index

func (a *AdminTag) Index() revel.Result

admin manage tag index page 后台管理标签首页

type Blog

type Blog struct {
	*revel.Controller
}

Blogger controller

func (Blog) BlogPage

func (b Blog) BlogPage(ident string) revel.Result

BloggerPage to display the blog detail. 显示博客详情

func (*Blog) LatestBlogger

func (b *Blog) LatestBlogger()

LatestBlogger get laster n blog 获取最新的 n 条博客

type BlogTag

type BlogTag struct {
	*revel.Controller
}

BlogTag controller

func (*BlogTag) GetAllTags

func (b *BlogTag) GetAllTags() revel.Result

GetAllTags to find all tags 获取所有的标签

func (*BlogTag) Index

func (b *BlogTag) Index(ident string) revel.Result

func (*BlogTag) QueryTags

func (b *BlogTag) QueryTags(t string) revel.Result

QueryTags to Search for tag 根据用户输入的单词匹配 tag

type Category

type Category struct {
	Admin
}

Category for blog, admin user can access 博客分类,后台用户操作

func (*Category) Add

func (c *Category) Add(ca_name string, ca_ident string, ca_p, ca_id int, ca_desc string) revel.Result

Add to add a new category 添加一个新的分类

func (*Category) AddPage

func (c *Category) AddPage() revel.Result

AddPage page of add a category 添加一个分类的页面

func (*Category) Del

func (c *Category) Del(id int) revel.Result

Del a category 删除一个分类

func (*Category) EditPage

func (c *Category) EditPage(cid int64) revel.Result

EditPage is a page to edit a category 编辑分类页面

func (*Category) Index

func (c *Category) Index() revel.Result

Index page for manage category 后台管理博客分类的首页

func (*Category) ListAll

func (c *Category) ListAll() revel.Result

ListAll . 列出所有分类

type Comment

type Comment struct {
	*revel.Controller
}

Comment controller.

func (*Comment) DelComment

func (c *Comment) DelComment() revel.Result

Delete comment.

func (*Comment) ModifyComment

func (c *Comment) ModifyComment() revel.Result

Modify comment.

func (*Comment) NewComment

func (c *Comment) NewComment(content, name string, blogid int64) revel.Result

New comment.

type DBParams

type DBParams struct {
	Db_host   string
	Db_user   string
	Db_pass   string
	Db_port   string
	Db_name   string
	Db_prefix string
	Driver    string
}

type FileInfo

type FileInfo struct {
	ContentType string
	Filename    string
	RealFormat  string `json:",omitempty"`
	Resolution  string `json:",omitempty"`
	Size        int
	Status      string `json:",omitempty"`
	Path        string
}

type Install

type Install struct {
	*revel.Controller
}

func (*Install) AddAdmin

func (i *Install) AddAdmin() revel.Result

AddAdmin to add a admin user when installing 用于在安装的时候添加一个管理员账号

func (*Install) AddDB

func (i *Install) AddDB() revel.Result

func (*Install) HandleInstall

func (i *Install) HandleInstall() revel.Result

func (*Install) Index

func (i *Install) Index() revel.Result

type Login

type Login struct {
	*revel.Controller
}

Login controller

func (Login) SignIn

func (l Login) SignIn() revel.Result

SignIn page.

func (Login) SignInHandler

func (l Login) SignInHandler(name, passwd string) revel.Result

handle Sign

func (Login) SignOut

func (l Login) SignOut() revel.Result

SignOut

func (Login) SignUp

func (l Login) SignUp() revel.Result

SignUp page.

func (Login) SignUpHandler

func (l Login) SignUpHandler(name, email, passwd string) revel.Result

handle sign up.

type Main

type Main struct {
	*revel.Controller
}

Main controller.

func (*Main) Blog4Category

func (m *Main) Blog4Category(ca string) revel.Result

某个分类下的博客

func (*Main) Main

func (m *Main) Main() revel.Result

Main page. 博客首页

type Post

type Post struct {
	Admin
}

User for User Controller

func (*Post) CreateTag

func (p *Post) CreateTag(name string) revel.Result

CreateTag to create a new tag when create a blog 在创建博客的时候创建一个标签

func (*Post) Delete

func (p *Post) Delete(ids string) revel.Result

Delete a blog 删除博客

func (*Post) Index

func (p *Post) Index(postid int64) revel.Result

Index page to create or edit a blog 创建博客页面,编辑页面也是这个

func (*Post) ManagePost

func (p *Post) ManagePost(uid, category int64) revel.Result

ManagePost . 管理博客页面

func (*Post) NewPostHandler

func (p *Post) NewPostHandler() revel.Result

NewPostHandler to Add new article. 添加博客

func (*Post) QueryCategorys

func (p *Post) QueryCategorys() revel.Result

type PostData

type PostData struct {
	Id          int64
	Title       string // 博客标题
	Ident       string // 博客标示,用作url
	ContentMD   string // 博客内容 MD
	ContentHTML string // 博客内容 HTML
	Category    int64  // 博客类别
	Tag         string // 标签 格式:12,14,32
	Keywords    string // 关键词 格式:java,web开发

	Summary    string // 博客摘要
	Type       int    // 0 表示 markdown,1 表示 html
	NewTag     string // 新添加的标签
	Createtime string // 创建时间
	// contains filtered or unexported fields
}

PostData model. 发布博客前端提交的数据

type ResultJson

type ResultJson struct {
	Success bool
	Msg     string
	Data    interface{}
}

ResultJson is a json struct used in controller response

type Search struct {
	*revel.Controller
}

func (*Search) Index

func (s *Search) Index(q string) revel.Result

type Setting

type Setting struct {
	Admin
}

Setting controller

func (*Setting) SiteSetHandler

func (s *Setting) SiteSetHandler(title, subtitle, url, seo, reg, foot,
	statistics, status, comment string) revel.Result

Site setting handler.

func (*Setting) SiteSetPage

func (s *Setting) SiteSetPage() revel.Result

Site setting page.

type SiteInfo

type SiteInfo struct {
	Title     string
	SubTitle  string
	Copyright string
}

SiteInfo model

type Upload

type Upload struct {
	*revel.Controller
}

func (*Upload) Before

func (c *Upload) Before() revel.Result

func (*Upload) HandleUpload

func (c *Upload) HandleUpload() revel.Result

type User

type User struct {
	Admin
}

User for User Controller 用户管理控制器

func (*User) Create

func (user *User) Create() revel.Result

Create user 创建用户页面

func (*User) CreateHandler

func (user *User) CreateHandler(username, nickname, password, email string, group int) revel.Result

CreateHandler for do create user 处理创建用户的请求

func (*User) Delete

func (user *User) Delete(ids string) revel.Result

Delete a user 删除用户

func (*User) Edit

func (user *User) Edit(id int64) revel.Result

Edit User 编辑用户

func (*User) EditHandler

func (user *User) EditHandler(username, nickname, password, email string, group int, id int64) revel.Result

EditHandler to update user info 处理编辑用户的方法

func (*User) Main

func (user *User) Main() revel.Result

Main to list all users 用户管理首页,列出所有用户

Jump to

Keyboard shortcuts

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