reward_rule.go
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package domain
import "time"
// RewardStandard 奖惩规则
type RewardRule struct {
Id int `json:"id"` //奖惩规则id
CompanyId int `json:"companyId"` //企业id
OrgId int `json:"orgId"` //组织ID
RewardTag string `json:"rewardTag"`
RewardNum int `json:"rewardNum"`
RewardAmount string `json:"rewardAmount"`
FaultTag string `json:"faultTag"`
FaultNum int `json:"faultNum"`
FaultAmount string `json:"faultAmount"`
Remark string `json:"remark"`
CreatedAt time.Time
UpdatedAt time.Time
}
type RewardRuleRepository interface {
Save(param *RewardRule) (*RewardRule, error)
FindOne(queryOptions map[string]interface{}) (*RewardRule, error)
Find(queryOptions map[string]interface{}) (int64, []*RewardRule, error)
}
func (m *RewardRule) ValidRewardTag() bool {
switch m.FaultTag {
case ">":
default:
return false
}
return true
}
func (m *RewardRule) ValidFaultTag() bool {
switch m.FaultTag {
case ">":
default:
return false
}
return true
}