fix: 修复域能管理操作无响应及公户账务错误
- 修复前端 energy.js api.post/get 回调调用为 Promise 链式调用,解决操作无响应 - 修复 AdminAdjust system_operation 模式错误扣减公户余额,现不碰公户 - 修复 AdminAdjust admin_transfer 模式公户按用户数量扣款(amount * len(userIDs)) - 修复 AdminAdjust 余额检查移入事务内并加行锁(SELECT FOR UPDATE),防 TOCTOU 竞态 - FundStore 接口及 FundRepo 新增 LockAndGetBalance 方法
This commit is contained in:
@ -114,6 +114,7 @@ type energyStore = EnergyStore
|
||||
// FundStore 公户仓储接口(ISP)
|
||||
type FundStore interface {
|
||||
GetBalance() (int, error)
|
||||
LockAndGetBalance() (int, error)
|
||||
IncrBalance(amount int) error
|
||||
CreateLog(log *model.FundLog) error
|
||||
ListLogs(logType string, offset, limit int) ([]model.FundLog, int64, error)
|
||||
|
||||
Reference in New Issue
Block a user