Commit 36d5b8e3 by chenxianqi

message 未读默认 0

parent fce02260
......@@ -50,6 +50,10 @@ func (c *AuthController) Login() {
}
// else if queryAdmin.Token != "" {
// c.Data["json"] = utils.ResponseError(c.Ctx, "该用户已登录,请稍后再试哦!", nil)
// }
o := orm.NewOrm()
queryAdmin := models.Admin{UserName: admin.UserName}
err := o.Read(&queryAdmin, "UserName")
......
......@@ -164,6 +164,16 @@ func appTask() {
return nil
})
// 任务调度(30分钟会执行一次删除客户token)
// deleteAdminTokenTk := toolbox.NewTask("deleteAdminToken", "0 */30 * * * *", func() error {
// o := o.QueryTable(new(models.Admin))
// o.Filter("root", 0).Update(orm.Params{
// "token": "",
// })
// return nil
// })
// toolbox.AddTask("deleteAdminToken", deleteAdminTokenTk)
toolbox.AddTask("checkOnLine", checkOnLineTk)
}
......
......@@ -28,6 +28,6 @@ type Message struct {
TransferAccount int64 `orm:"type(bigint);column(transfer_account)" json:"transfer_account"` // 转接到客户的账号
Platform int64 `orm:"type(bigint);column(platform)" json:"platform"` // 此消息来自哪个平台(即渠道)
Payload string `orm:"null;type(text);column(payload)" json:"payload"` // 消息内容
Read int `orm:"default(1);column(read)" json:"read"` // 是否已读消息0已读1未读
Read int `orm:"default(0);column(read)" json:"read"` // 是否已读消息0已读1未读
Delete int `orm:"default(0);column(delete)" json:"delete"` // 是否已删除消息0 ro 1 1已删除
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment