Documentation ¶
Index ¶
- Constants
- func AdminContextUser(c *gin.Context) *mysql.User
- func AdminLoginRequired() gin.HandlerFunc
- func AdminSessionUser(c *gin.Context) (*mysql.User, bool)
- func BaseUrl(c *gin.Context) string
- func FrontContextUser(c *gin.Context) *mysql.Member
- func FrontLoginRequired() gin.HandlerFunc
- func FrontSessionUser(c *gin.Context) (*mysql.Member, bool)
- func FrontTplRequired() gin.HandlerFunc
- func Handle(h HandlerFunc) gin.HandlerFunc
- type Context
- func (c *Context) AdminAuthed() bool
- func (c *Context) AdminLogout() error
- func (c *Context) AdminUid() int
- func (c *Context) AdminUpdateUser(a *mysql.User) error
- func (c *Context) BaseUrl() string
- func (c *Context) Download(file string, filename ...string)
- func (c *Context) ExecuteViewPathTemplate(tplName string, data interface{}) (string, error)
- func (c *Context) ForbidGeneralRole() bool
- func (c *Context) GetPostFormString(key string) string
- func (c *Context) GetSeoByPage(page string, defSeo map[string]string)
- func (c *Context) GetSeoPage()
- func (c *Context) GetSession(key string) interface{}
- func (c *Context) Html(path string)
- func (c *Context) Html404()
- func (c *Context) JSONCode(Code int, data ...interface{})
- func (c *Context) JSONErr(Code int, err error)
- func (c *Context) JSONErrStr(Code int, err string)
- func (c *Context) JSONErrTips(msg string, err error)
- func (c *Context) JSONList(data interface{}, current, pageSize, total int)
- func (c *Context) JSONOK(result ...interface{})
- func (c *Context) LoginByMemberId(memberId int) (err error)
- func (c *Context) Logout() error
- func (c *Context) Member() *mysql.Member
- func (c *Context) ReplaceLinks(bookIdentify string, docHtml string, isSummary ...bool) string
- func (c *Context) SaveToFile(fromfile, tofile string) error
- func (c *Context) SaveToFileImg(fromfile string) (tofile string, name string, err error)
- func (c *Context) SetSecureCookie(Secret, name, value string, others ...interface{})
- func (c *Context) SetSession(key, value string) error
- func (c *Context) Tpl() *tplbeego.Tmpl
- func (c *Context) UpdateUser(a *mysql.Member) error
- type HandlerFunc
- type JSONResult
- type RespList
- type WechatRespList
Constants ¶
View Source
const AdminContextKey = "ecology/context/admin"
View Source
const AdminSessionKey = "ecology/session/admin"
View Source
const FrontContextKey = "ecology/context/front"
View Source
const FrontSessionKey = "ecology/session/front"
View Source
const Options = "MDW_OPTIONS"
View Source
const TPL = "MDW_TPL"
Variables ¶
This section is empty.
Functions ¶
func FrontTplRequired ¶
func FrontTplRequired() gin.HandlerFunc
func Handle ¶
func Handle(h HandlerFunc) gin.HandlerFunc
Types ¶
type Context ¶
func (*Context) AdminLogout ¶
Logout will clear out the session and call the Logout() user function.
func (*Context) AdminUpdateUser ¶
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.
func (*Context) ExecuteViewPathTemplate ¶
ExecuteViewPathTemplate 执行指定的模板并返回执行结果.
func (*Context) ForbidGeneralRole ¶
func (*Context) GetPostFormString ¶
func (*Context) GetSeoByPage ¶
根据页面获取seo @param page 页面标识 @param defSeo 默认的seo的map,必须有title、keywords和description字段
func (*Context) GetSeoPage ¶
func (c *Context) GetSeoPage()
func (*Context) GetSession ¶
func (*Context) JSONErrStr ¶
func (*Context) JSONErrTips ¶
func (*Context) LoginByMemberId ¶
func (*Context) ReplaceLinks ¶
替换链接 如果是summary,则根据这个进行排序调整
func (*Context) SaveToFile ¶
SaveToFile saves uploaded file to new path. it only operates the first one of mutil-upload form file field.
func (*Context) SaveToFileImg ¶
func (*Context) SetSecureCookie ¶
SetSecureCookie Set Secure cookie for response.
func (*Context) SetSession ¶
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
type WechatRespList ¶
type WechatRespList struct { List interface{} `json:"list"` Total int `json:"total"` }
Click to show internal directories.
Click to hide internal directories.