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
4fb4b928
Commit
4fb4b928
authored
Jun 16, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
翻译o了
parent
ed24d79a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
anniversary.go
cron/cp_cron/anniversary.go
+14
-4
level.go
domain/model/cp_m/level.go
+9
-1
No files found.
cron/cp_cron/anniversary.go
View file @
4fb4b928
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
"github.com/robfig/cron"
"github.com/robfig/cron"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/msg_m"
"hilo-user/domain/model/msg_m"
"hilo-user/domain/model/user_m"
)
)
// 纪念日
// 纪念日
...
@@ -27,11 +28,20 @@ func CpAnniversaryNotice() {
...
@@ -27,11 +28,20 @@ func CpAnniversaryNotice() {
_
=
c
.
AddFunc
(
spec
,
func
()
{
_
=
c
.
AddFunc
(
spec
,
func
()
{
var
model
=
domain
.
CreateModelNil
()
var
model
=
domain
.
CreateModelNil
()
anniversary
:=
cp_m
.
GetNeedRemindCpAnniversary
(
model
)
anniversary
:=
cp_m
.
GetNeedRemindCpAnniversary
(
model
)
for
_
,
v
:=
range
anniversary
{
var
userIds
[]
uint64
var
userIds
[]
uint64
userIds
=
append
(
userIds
,
v
.
UserId1
,
v
.
UserId2
)
for
_
,
v
:=
range
anniversary
{
record1
:=
msg_m
.
NewUserRecord
(
model
,
v
.
UserId1
,
msg_e
.
CpAnniversaryNotice
,
v
.
Content
,
0
,
""
,
""
,
""
,
""
,
""
)
userIds
=
append
(
userIds
,
v
.
UserId1
)
record2
:=
msg_m
.
NewUserRecord
(
model
,
v
.
UserId2
,
msg_e
.
CpAnniversaryNotice
,
v
.
Content
,
0
,
""
,
""
,
""
,
""
,
""
)
userIds
=
append
(
userIds
,
v
.
UserId2
)
}
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"GetUserMapByIds fail:%v"
,
err
)
}
for
_
,
v
:=
range
anniversary
{
content1
:=
cp_m
.
GetTranslate
(
285
,
users
[
v
.
UserId1
]
.
Language
)
content2
:=
cp_m
.
GetTranslate
(
285
,
users
[
v
.
UserId2
]
.
Language
)
record1
:=
msg_m
.
NewUserRecord
(
model
,
v
.
UserId1
,
msg_e
.
CpAnniversaryNotice
,
content1
,
0
,
""
,
""
,
""
,
""
,
""
)
record2
:=
msg_m
.
NewUserRecord
(
model
,
v
.
UserId2
,
msg_e
.
CpAnniversaryNotice
,
content2
,
0
,
""
,
""
,
""
,
""
,
""
)
err1
,
err2
:=
record1
.
Persistent
(),
record2
.
Persistent
()
err1
,
err2
:=
record1
.
Persistent
(),
record2
.
Persistent
()
if
err1
!=
nil
||
err2
!=
nil
{
if
err1
!=
nil
||
err2
!=
nil
{
model
.
Log
.
Errorf
(
"NewUserRecord fail:%v-%v"
,
err1
,
err2
)
model
.
Log
.
Errorf
(
"NewUserRecord fail:%v-%v"
,
err1
,
err2
)
...
...
domain/model/cp_m/level.go
View file @
4fb4b928
...
@@ -294,7 +294,15 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N
...
@@ -294,7 +294,15 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N
model
.
Log
.
Errorf
(
""
)
model
.
Log
.
Errorf
(
""
)
return
return
}
}
if
err
:=
rpc
.
SendCpUpgrade
(
users
[
userId1
]
.
Nick
,
users
[
userId2
]
.
Nick
,
users
[
userId1
]
.
Avatar
,
users
[
userId2
]
.
Avatar
,
uint32
(
cpLevel
.
Level
),
"成为 todo"
);
err
!=
nil
{
levelMsgIdMap
:=
map
[
cp_e
.
CpLevel
]
uint
{
cp_e
.
CpLevel1
:
252
,
cp_e
.
CpLevel2
:
253
,
cp_e
.
CpLevel3
:
254
,
cp_e
.
CpLevel4
:
255
,
cp_e
.
CpLevel5
:
256
,
}
content
:=
fmt
.
Sprintf
(
GetTranslate
(
286
,
users
[
userId1
]
.
Language
),
GetTranslate
(
levelMsgIdMap
[
cpLevel
.
Level
],
users
[
userId1
]
.
Language
))
if
err
:=
rpc
.
SendCpUpgrade
(
users
[
userId1
]
.
Nick
,
users
[
userId2
]
.
Nick
,
users
[
userId1
]
.
Avatar
,
users
[
userId2
]
.
Avatar
,
uint32
(
cpLevel
.
Level
),
content
);
err
!=
nil
{
model
.
Log
.
Errorf
(
"SendCpUpgrade fail:%v"
,
err
)
model
.
Log
.
Errorf
(
"SendCpUpgrade 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