Documentation ¶
Index ¶
- Constants
- func MarkdownToHTML(d string) template.HTML
- func StringListJoin(strList model.StringList) string
- func TimeDay(t time.Time) int
- func TimeMonth(t time.Time) string
- func TimeYear(t time.Time) int
- type Controller
- func (ctr *Controller) Error(c *gin.Context, msg string)
- func (*Controller) GetParamInt(c *gin.Context, key string, defVal ...int) (int, bool)
- func (*Controller) GetQueryInt(c *gin.Context, key string, defVal ...int) (int, bool)
- func (*Controller) JsonFail(c *gin.Context, errMsg string, errCode int)
- func (*Controller) JsonSuccess(c *gin.Context, data interface{})
- func (ctr Controller) NewTemplate(path string) *Template
- func (ctr Controller) Response(c *gin.Context, tpl *Template)
- func (ctr *Controller) Success(c *gin.Context, msg string)
- type Pagination
- type Post
- type SiteParameter
- type Template
- type User
Constants ¶
View Source
const UserCookieNamePrefix = "user."
Variables ¶
This section is empty.
Functions ¶
func MarkdownToHTML ¶
func StringListJoin ¶
func StringListJoin(strList model.StringList) string
Types ¶
type Controller ¶
type Controller struct { }
func (*Controller) GetParamInt ¶
GetParamInt 从路由参数中返回 key 对应的值 规则与 GetQueryInt() 函数相同
func (*Controller) GetQueryInt ¶
GetQueryInt 返回查询参数中 key 对应的值 如果找不到 key 或者 key 的值不是有效数值,则返回的第2个参数返回 false 可以指定 defVal 参数作为默认值返回
func (*Controller) JsonFail ¶
func (*Controller) JsonFail(c *gin.Context, errMsg string, errCode int)
func (*Controller) JsonSuccess ¶
func (*Controller) JsonSuccess(c *gin.Context, data interface{})
func (Controller) NewTemplate ¶
func (ctr Controller) NewTemplate(path string) *Template
NewTemplate 返回一个 Template `path` 不需要包含 模板主题名
type Pagination ¶
Pagination 分页器
func NewPagination ¶
func NewPagination(req *http.Request, total int, pernum int) *Pagination
NewPagination 新建分页器
type SiteParameter ¶
type SiteParameter struct {
Controller
}
func (SiteParameter) Form ¶
func (ctr SiteParameter) Form(c *gin.Context)
func (SiteParameter) Save ¶
func (ctr SiteParameter) Save(c *gin.Context)
type User ¶
type User struct {
Controller
}
func (User) ResetPassword ¶
func (User) ResetPasswordForm ¶
Click to show internal directories.
Click to hide internal directories.