feat(file): unify file handling with a new FileSource abstraction for URL and base64 data

This commit is contained in:
CaIon
2026-02-04 17:15:24 +08:00
parent 89b2782675
commit 9ef7740fe7
28 changed files with 1119 additions and 357 deletions

View File

@@ -148,7 +148,8 @@ func Redeem(key string, userId int) (quota int, err error) {
return err
})
if err != nil {
return 0, errors.New("兑换失败," + err.Error())
common.SysError("redemption failed: " + err.Error())
return 0, errors.New("兑换失败,请稍后重试")
}
RecordLog(userId, LogTypeTopup, fmt.Sprintf("通过兑换码充值 %s兑换码ID %d", logger.LogQuota(redemption.Quota), redemption.Id))
return redemption.Quota, nil

View File

@@ -95,7 +95,8 @@ func Recharge(referenceId string, customerId string) (err error) {
})
if err != nil {
return errors.New("充值失败," + err.Error())
common.SysError("topup failed: " + err.Error())
return errors.New("充值失败,请稍后重试")
}
RecordLog(topUp.UserId, LogTypeTopup, fmt.Sprintf("使用在线充值成功,充值金额: %v支付金额%d", logger.FormatQuota(int(quota)), topUp.Amount))
@@ -367,7 +368,8 @@ func RechargeCreem(referenceId string, customerEmail string, customerName string
})
if err != nil {
return errors.New("充值失败," + err.Error())
common.SysError("creem topup failed: " + err.Error())
return errors.New("充值失败,请稍后重试")
}
RecordLog(topUp.UserId, LogTypeTopup, fmt.Sprintf("使用Creem充值成功充值额度: %v支付金额%.2f", quota, topUp.Money))