Documentation
¶
Index ¶
- func AuthJson(context martini.Context, session sessions.Session, r render.Render, ...)
- func Authorize(context martini.Context, session sessions.Session, r render.Render, ...)
- func CaptchaCheck(c Captcha, r render.Render)
- func CaptchaImage(params martini.Params, w http.ResponseWriter)
- func CaptchaReload(params martini.Params, w http.ResponseWriter)
- func CsPath(m *martini.ClassicMartini, p string)
- func LogList(p martini.Params, params base.Params, r render.Render)
- func LogNew(work string) martini.Handler
- func LogQuery(session Session, params base.Params, r render.Render)
- func ManagerJson(context martini.Context, session sessions.Session, r render.Render, ...)
- func Path(m *martini.ClassicMartini, p string)
- func PostNew(l Log, s Session, p Post, r render.Render)
- func PostQuery(params base.Params, r render.Render)
- func PostQuery2(session Session, params base.Params, r render.Render)
- func PostRead(l Log, params martini.Params, r render.Render)
- func PostRemove(l Log, params martini.Params, r render.Render)
- func PostUpdate(l Log, p Post, r render.Render)
- func SessionQuery(params base.Params, r render.Render)
- func SessionRemove(params martini.Params, r render.Render)
- func UserGet(s Session, r render.Render)
- func UserLogin(session sessions.Session, user Captcha, r render.Render, req *http.Request)
- func UserLogout(s Session, session sessions.Session, r render.Render)
- func UserPassword(p Password, s Session, r render.Render)
- func UserQuery(params base.Params, r render.Render)
- func UserRegister(session sessions.Session, user Captcha, r render.Render, req *http.Request)
- type Captcha
- type Log
- type Msg
- type Page
- type Password
- type Post
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthJson ¶
func AuthJson(context martini.Context, session sessions.Session, r render.Render, req *http.Request)
json身份认证
func Authorize ¶
func Authorize(context martini.Context, session sessions.Session, r render.Render, req *http.Request)
身份认证
func ManagerJson ¶
func ManagerJson(context martini.Context, session sessions.Session, r render.Render, req *http.Request)
管理员json身份认证
Types ¶
type Captcha ¶
type Captcha struct {
User
// ID
CaptchaId string
// 验证码
Solution string
Password string `form:"password" binding:"required"`
}
验证码
type Log ¶
type Log struct {
Id bson.ObjectId `bson:"_id,omitempty" json:"-" table:"log"`
// 对象ID
Oid bson.ObjectId `bson:"oid,omitempty" json:"-"`
// 姓名
Work string `bson:"work,omitempty" json:"work"`
// IP
Ip string `bson:"ip,omitempty" json:"ip"`
// 用户ID
Uid bson.ObjectId `bson:"uid,omitempty" json:"-"`
// 用户
User User `bson:",omitempty" json:"user"`
// 创建时间
Ca time.Time `bson:"ca,omitempty" json:"ca"`
}
日志
type Msg ¶
type Msg struct {
// 是否成功
Ok bool `json:"ok"`
// 错误信息
Err string `json:"err,omitempty"`
// 传输数据
Data interface{} `json:"data,omitempty"`
// 总数
Count int `json:"count,omitempty"`
// 验证码ID
Cid string `json:"cid,omitempty"`
}
消息
type Page ¶
type Page struct {
// 标题
Title string
// 验证码字符串
Cid string
// 是否是客服
Cs bool
// 数据
Data interface{}
}
页面
type Password ¶
type Password struct {
Password string `form:"password" binding:"required"`
Old string `form:"old" binding:"required"`
}
修改密码
type Post ¶
type Post struct {
Id bson.ObjectId `bson:"_id,omitempty" json:"id" table:"post"`
// 标题
Title string `bson:"title" json:"title"`
// 分类
Type string `bson:"type" json:"type"`
// 状态
Status int `bson:"status" json:"status"`
// 内容
Content string `bson:"content,omitempty" json:"content"`
// 回复
Rt string `bson:"rt,omitempty" json:"rt"`
// 网址
Url string `bson:"url,omitempty" json:"url"`
// 是否阅读
Read bool `bson:"read,omitempty" json:"read"`
// 用户ID
Uid bson.ObjectId `bson:"uid" json:"uid"`
// 用户
User User `bson:",omitempty" json:"user"`
// 创建时间
Ca time.Time `bson:"ca,omitempty" json:"ca"`
// 创建时间
Ua time.Time `bson:"ua,omitempty" json:"ua"`
}
帖子
type Session ¶
type Session struct {
Id bson.ObjectId `bson:"_id,omitempty" json:"id" table:"session"`
// IP
Ip string `bson:"ip,omitempty" json:"ip"`
// 当前用户
Uid bson.ObjectId `bson:"uid,omitempty" json:"uid"`
// 姓名
Name string `bson:"name" json:"name"`
// 手机
Phone string `bson:"phone,omitempty" json:"phone"`
// 是否是管理员
Cs bool `bson:"cs" json:"cs"`
// 用户信息
User User `bson:",omitempty" json:"user"`
// 创建时间
Ca time.Time `bson:"ca,omitempty" json:"ca"`
// 修改时间
Ua time.Time `bson:"ua,omitempty" json:"ua"`
}
会话
type User ¶
type User struct {
Id bson.ObjectId `bson:"_id,omitempty" json:"id" table:"user"`
// 手机
Phone string `bson:"phone" json:"phone"`
// 姓名
Name string `bson:"name" json:"name"`
// 密码
Password string `bson:"password" json:"-"`
// 是否是客服
Cs bool `bson:"cs" json:"cs"`
// 创建时间
Ca time.Time `bson:"ca,omitempty" json:"ca"`
// 修改时间
Ua time.Time `bson:"ua,omitempty" json:"ua"`
// 有效标记
En bool
}
用户
Click to show internal directories.
Click to hide internal directories.