Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
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
hujiebin
hilo-common
Commits
783a1518
Commit
783a1518
authored
Apr 19, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发奖
parent
4123e7ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
user_award.go
txop/award_tx/user_award.go
+66
-0
No files found.
txop/award_tx/user_award.go
0 → 100644
View file @
783a1518
package
award_tx
import
(
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/internal/enum/diamond_e"
"git.hilo.cn/hilo-common/internal/enum/msg_e"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/txop/diamond_tx"
"git.hilo.cn/hilo-common/txop/headwear_tx"
"git.hilo.cn/hilo-common/txop/medal_tx"
"git.hilo.cn/hilo-common/txop/noble_tx"
"git.hilo.cn/hilo-common/txop/ride_tx"
)
type
UserAward
struct
{
UserId
uint64
ActivityId
uint64
NobleLevel
mysql
.
Num
NobleDuration
mysql
.
Num
//单位(天)
Diamond
mysql
.
Num
PropertyId
mysql
.
ID
PropertyDuration
mysql
.
NumAll
//单位(天)
HeaddressId
mysql
.
ID
HeaddressDuration
mysql
.
NumAll
//单位(天)
MedalId
mysql
.
ID
MedalDuration
mysql
.
Num
//单位(天)
NameplateId
mysql
.
ID
NameplateDuration
mysql
.
Num
//单位(天)
}
func
SendUserAward
(
txModel
*
domain
.
Model
,
award
*
UserAward
,
opt
diamond_e
.
OperateType
,
msgType
...
msg_e
.
MsgUserRecordType
)
(
err
error
)
{
if
award
.
UserId
<=
0
{
return
}
if
award
.
Diamond
>
0
{
err
=
diamond_tx
.
SendDiamond
(
txModel
,
award
.
UserId
,
opt
,
award
.
ActivityId
,
award
.
Diamond
,
msgType
...
)
if
err
!=
nil
{
return
}
}
if
award
.
NobleDuration
>
0
&&
award
.
NobleLevel
>
0
{
err
=
noble_tx
.
SendNoble
(
txModel
,
award
.
UserId
,
uint16
(
award
.
NobleLevel
),
int
(
award
.
NobleDuration
))
if
err
!=
nil
{
return
}
}
if
award
.
PropertyId
>
0
&&
award
.
PropertyDuration
>
0
{
err
=
ride_tx
.
SendRide
(
txModel
,
award
.
UserId
,
award
.
PropertyId
,
award
.
PropertyDuration
)
if
err
!=
nil
{
return
}
}
if
award
.
HeaddressId
>
0
&&
award
.
HeaddressDuration
>
0
{
err
=
headwear_tx
.
SendHeadwear
(
txModel
,
award
.
UserId
,
award
.
HeaddressId
,
award
.
HeaddressDuration
)
if
err
!=
nil
{
return
}
}
if
award
.
MedalId
>
0
&&
award
.
MedalDuration
>
0
{
err
=
medal_tx
.
SendMedal
(
txModel
,
award
.
UserId
,
award
.
MedalId
,
int
(
award
.
MedalDuration
))
if
err
!=
nil
{
return
}
}
return
}
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