Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenweijian
hilo-user
Commits
124d8383
Commit
124d8383
authored
Jun 08, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cp-new' into feature/3.9.0
parents
9a2d6769
174ccbdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
anniversary.go
cron/cp_cron/anniversary.go
+8
-12
No files found.
cron/cp_cron/anniversary.go
View file @
124d8383
package
cp_cron
package
cp_cron
import
(
import
(
"
encoding/json
"
"
git.hilo.cn/hilo-common/_const/enum/msg_e
"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/config"
"git.hilo.cn/hilo-common/resource/config"
"github.com/robfig/cron"
"github.com/robfig/cron"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/
user
_m"
"hilo-user/domain/model/
msg
_m"
)
)
// 纪念日
// 纪念日
...
@@ -30,17 +30,13 @@ func CpAnniversaryNotice() {
...
@@ -30,17 +30,13 @@ func CpAnniversaryNotice() {
for
_
,
v
:=
range
anniversary
{
for
_
,
v
:=
range
anniversary
{
var
userIds
[]
uint64
var
userIds
[]
uint64
userIds
=
append
(
userIds
,
v
.
UserId1
,
v
.
UserId2
)
userIds
=
append
(
userIds
,
v
.
UserId1
,
v
.
UserId2
)
users
,
err
:=
user_m
.
GetUsersByIds
(
model
,
userIds
)
record1
:=
msg_m
.
NewUserRecord
(
model
,
v
.
UserId1
,
msg_e
.
CpAnniversaryNotice
,
v
.
Content
,
0
,
""
,
""
,
""
,
""
,
""
)
if
err
!=
nil
||
len
(
users
)
<
2
{
record2
:=
msg_m
.
NewUserRecord
(
model
,
v
.
UserId2
,
msg_e
.
CpAnniversaryNotice
,
v
.
Content
,
0
,
""
,
""
,
""
,
""
,
""
)
model
.
Log
.
Errorf
(
"GetUserMapByIds fail:%v"
,
err
)
err1
,
err2
:=
record1
.
Persistent
(),
record2
.
Persistent
()
continue
if
err1
!=
nil
||
err2
!=
nil
{
model
.
Log
.
Errorf
(
"NewUserRecord fail:%v-%v"
,
err1
,
err2
)
return
}
}
data
,
_
:=
json
.
Marshal
(
CpAnniversaryNoticeMsg
{
Identifier
:
"CpAnniversaryNotice"
,
Content
:
v
.
Content
,
Timestamp
:
v
.
Timestamp
,
})
println
(
data
)
// todo 小助手
//if err := tencentyun.BatchSendCustomMsg(model, 1, users[0].ExternalId, []string{users[1].ExternalId}, string(data), "cp纪念日"); err != nil {
//if err := tencentyun.BatchSendCustomMsg(model, 1, users[0].ExternalId, []string{users[1].ExternalId}, string(data), "cp纪念日"); err != nil {
// model.Log.Errorf("BatchSendCustomMsg fail:%v", err)
// model.Log.Errorf("BatchSendCustomMsg fail:%v", err)
//}
//}
...
...
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