core

package
v0.0.0-...-783c0ba Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(h HandlerFunc) gin.HandlerFunc

Types

type Context

type Context struct {
	*gin.Context
}

func (*Context) BaseUrl

func (c *Context) BaseUrl() string

func (*Context) Download

func (c *Context) Download(file string, filename ...string)

func (*Context) ExecuteViewPathTemplate

func (c *Context) ExecuteViewPathTemplate(tplName string, data interface{}) (string, error)

ExecuteViewPathTemplate 执行指定的模板并返回执行结果.

func (*Context) ForbidGeneralRole

func (c *Context) ForbidGeneralRole() bool

func (*Context) GetPostFormString

func (c *Context) GetPostFormString(key string) string

func (*Context) GetSeoByPage

func (c *Context) GetSeoByPage(page string, defSeo map[string]string)

根据页面获取seo @param page 页面标识 @param defSeo 默认的seo的map,必须有title、keywords和description字段

func (*Context) GetSession

func (c *Context) GetSession(key string) interface{}

func (*Context) Html

func (c *Context) Html(path string)

func (*Context) Html404

func (c *Context) Html404()

func (*Context) JSONCode

func (c *Context) JSONCode(Code int, data ...interface{})

JSON 提供了系统标准JSON输出方法。

func (*Context) JSONErr

func (c *Context) JSONErr(Code int, err error)

JSON 提供了系统标准JSON输出方法。

func (*Context) JSONErrStr

func (c *Context) JSONErrStr(Code int, err string)

func (*Context) JSONOK

func (c *Context) JSONOK(result ...interface{})

func (*Context) Logout

func (c *Context) Logout() error

Logout will clear out the session and call the Logout() user function.

func (*Context) Member

func (c *Context) Member() *mysql.Member
func (c *Context) ReplaceLinks(bookIdentify string, docHtml string, isSummary ...bool) string

替换链接 如果是summary,则根据这个进行排序调整

func (*Context) SaveToFile

func (c *Context) SaveToFile(fromfile, tofile string) error

SaveToFile saves uploaded file to new path. it only operates the first one of mutil-upload form file field.

func (*Context) SetSession

func (c *Context) SetSession(key, value string) error

func (*Context) Tpl

func (c *Context) Tpl() *tplbeego.Tmpl

func (*Context) UpdateUser

func (c *Context) UpdateUser(a *mysql.Member) error

UpdateUser updates the User object stored in the session. This is useful incase a change is made to the user model that needs to persist across requests.

type HandlerFunc

type HandlerFunc func(c *Context)

type JSONResult

type JSONResult struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
}

JSONResult json

Jump to

Keyboard shortcuts

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