su_money_transaction_record.go
1.6 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
44
45
46
package domain
import "time"
const (
SU_MONEY_TRANSACTION_RECORD_TYPE_EXCHANGE = iota + 1 //兑换
SU_MONEY_TRANSACTION_RECORD_TYPE_AWARD //任务奖励
SU_MONEY_TRANSACTION_RECORD_TYPE_INCREASE //增加
SU_MONEY_TRANSACTION_RECORD_TYPE_DEDUCT //扣除
)
// 素币事务记录
type SuMoneyTransactionRecord struct {
// 素币事务记录ID
SuMoneyTransactionRecordId int64 `json:"suMoneyTransactionRecordId"`
// 记录类型
RecordType int `json:"recordType"`
// 记录关联员工
Employee *EmployeeInfo `json:"employee"`
// 事务处理前素币值
SuMoneyBeforeTransaction float64 `json:"suMoneyBeforeTransaction"`
// 当前素币值
CurrentSuMoney float64 `json:"currentSuMoney"`
// 事务素币值
SuMoney float64 `json:"suMoney"`
// 操作人
Operator *EmployeeInfo `json:"operator"`
// 素币事务记录描述
RecordDescription string `json:"recordDescription"`
// 创建时间
CreateTime time.Time `json:"createTime"`
}
type SuMoneyTransactionRecordRepository interface {
Save(suMoneyTransactionRecord *SuMoneyTransactionRecord) (*SuMoneyTransactionRecord, error)
Remove(suMoneyTransactionRecord *SuMoneyTransactionRecord) (*SuMoneyTransactionRecord, error)
FindOne(queryOptions map[string]interface{}) (*SuMoneyTransactionRecord, error)
Find(queryOptions map[string]interface{}) (int64, []*SuMoneyTransactionRecord, error)
}
func (suMoneyTransactionRecord *SuMoneyTransactionRecord) Identify() interface{} {
if suMoneyTransactionRecord.SuMoneyTransactionRecordId == 0 {
return nil
}
return suMoneyTransactionRecord.SuMoneyTransactionRecordId
}