Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
kefu_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
36d5b8e3
authored
Dec 29, 2019
by
chenxianqi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
message 未读默认 0
parent
fce02260
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletions
controllers/auth.go
main.go
models/message.go
controllers/auth.go
View file @
36d5b8e3
...
...
@@ -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"
)
...
...
main.go
View file @
36d5b8e3
...
...
@@ -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
)
}
...
...
models/message.go
View file @
36d5b8e3
...
...
@@ -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已删除
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment