controllers

package
v0.0.0-...-a5e9c71 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2015 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaiduSocialCheck

func BaiduSocialCheck(token string, id string) bool

判断token对应的id是否合法

func FindImages

func FindImages(content string, number int) []string

查找markdown语法中的图片 * @params content 文章内容 * @params number 查找数量

func HandleNewImage

func HandleNewImage(content string, prefix string) (int64, string)

* 将新发布文章图片移动到指定文件夹 * content *string 文章内容 * prefix string 移动后前缀 eg: game/blog/123456000/123456000/123456000 * @return int64 新增图片大小 * @return string 更新地址后内容

func HandleUpdateImage

func HandleUpdateImage(oldContent string, newContent string, prefix string) (int64, string)

* 删除编辑后删除的图片(必须包含前缀路径保证是此文章的) * 移动编辑后新增的图片(并返回更新路径后的内容) * content *string 文章内容 * prefix string 移动后前缀 eg: game/blog/123456000/123456000/123456000 * @return int64 新增图片大小 * @return string 更新地址后内容

func IsProxy

func IsProxy(domain string) bool

验证是否被恶意代理

func MD5

func MD5(text string) string

md5简化用法

func RemoveMarkdown

func RemoveMarkdown(content string) string

移除markdown标识

func StringToIntArray

func StringToIntArray(stringArray []string) []int

将[]string 转化为 []int

func StructDecode

func StructDecode(data []byte, to interface{}) error

字节流解码为结构体

func StructEncode

func StructEncode(data interface{}) ([]byte, error)

结构体编码为字节流

Types

type ApiController

type ApiController struct {
	beego.Controller
}

type ArticleController

type ArticleController struct {
	beego.Controller
}

func (*ArticleController) Add

func (this *ArticleController) Add()

新增文章

func (*ArticleController) AddReply

func (this *ArticleController) AddReply()

评论某个文章

func (*ArticleController) Article

func (this *ArticleController) Article()

获取某个文章内容

func (*ArticleController) ChangeCategory

func (this *ArticleController) ChangeCategory()

修改分类

func (*ArticleController) Delete

func (this *ArticleController) Delete()

删除文章

func (*ArticleController) Edit

func (this *ArticleController) Edit()

编辑文章

func (*ArticleController) List

func (this *ArticleController) List()

查询文章

func (*ArticleController) Reply

func (this *ArticleController) Reply()

查询评论

func (*ArticleController) Top

func (this *ArticleController) Top()

置顶文章

type CheckController

type CheckController struct {
	beego.Controller
}

func (*CheckController) CurrentUser

func (this *CheckController) CurrentUser()

获取登陆用户信息

func (*CheckController) GetToken

func (this *CheckController) GetToken()

获取github token

func (*CheckController) HasOauth

func (this *CheckController) HasOauth()

社交化平台查询是否有账号,若有自动登陆

func (*CheckController) OauthRegister

func (this *CheckController) OauthRegister()

第三方平台注册用户

func (*CheckController) Register

func (this *CheckController) Register()

注册用户

func (*CheckController) SetState

func (this *CheckController) SetState()

设置一个session

func (*CheckController) SignOut

func (this *CheckController) SignOut()

注销用户

type GlobalController

type GlobalController struct {
	beego.Controller
}

type IndexController

type IndexController struct {
	beego.Controller
}

func (*IndexController) Global

func (this *IndexController) Global()

type QiniuController

type QiniuController struct {
	beego.Controller
}

func (*QiniuController) CreateUpToken

func (this *QiniuController) CreateUpToken()

生成上传token

func (*QiniuController) DeleteAll

func (this *QiniuController) DeleteAll(bucketName string, prefix string)

删除某个前缀下所有文件

func (*QiniuController) DeleteFile

func (this *QiniuController) DeleteFile(bucketSrc string, keySrc string) bool

删除某个文件

func (*QiniuController) DeleteFiles

func (this *QiniuController) DeleteFiles(bucketSrc string, keySrc []string) bool

批量删除文件

func (*QiniuController) GetInfo

func (this *QiniuController) GetInfo(bucketSrc string, keySrc string) (bool, rs.Entry)

获得某个图片信息

func (*QiniuController) GetInfos

func (this *QiniuController) GetInfos(bucketSrc string, keySrc []string) []rs.BatchStatItemRet

批量获取图片信息

func (*QiniuController) MoveFile

func (this *QiniuController) MoveFile(bucketSrc string, keySrc string, bucketDest string, keyDest string) bool

移动某个文件

func (*QiniuController) MoveFiles

func (this *QiniuController) MoveFiles(bucketSrc string, keySrc []string, bucketDest string, keyDest []string) []rs.BatchItemRet

批量移动文件

type TagController

type TagController struct {
	beego.Controller
}

func (*TagController) Bind

func (this *TagController) Bind()

绑定标签 article string 所属文章 name string 标签名

func (*TagController) GetList

func (this *TagController) GetList()

获取列表

func (*TagController) Hot

func (this *TagController) Hot()

获得排名前30的标签

func (*TagController) Same

func (this *TagController) Same()

获取具有相同标签的文章

func (*TagController) SearchTag

func (this *TagController) SearchTag()

搜索标签

func (*TagController) UnBind

func (this *TagController) UnBind()

解绑标签 topic string 所属文章 name string 标签名

type UserController

type UserController struct {
	beego.Controller
}

func (*UserController) GetArticles

func (this *UserController) GetArticles()

获取用户文章

func (*UserController) GetGithub

func (this *UserController) GetGithub()

获取github信息

func (*UserController) GetHotCold

func (this *UserController) GetHotCold()

获取用户热评和被忽视的文章

func (*UserController) Oauth

func (this *UserController) Oauth()

第三方平台绑定

func (*UserController) OauthList

func (this *UserController) OauthList()

获取第三方平台绑定状况列表

func (*UserController) User

func (this *UserController) User()

获取某个用户信息

Jump to

Keyboard shortcuts

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