add extension_time
This commit is contained in:
@@ -88,4 +88,5 @@ Tianyuanapi:
|
|||||||
BaseURL: "https://api.tianyuanapi.com"
|
BaseURL: "https://api.tianyuanapi.com"
|
||||||
Timeout: 60
|
Timeout: 60
|
||||||
Authorization:
|
Authorization:
|
||||||
FileBaseURL: "https://www.tianyuandb.com/api/v1/auth-docs" # 授权书文件访问基础URL
|
FileBaseURL: "https://www.tianyuandb.com/api/v1/auth-docs" # 授权书文件访问基础URL
|
||||||
|
extension_time: 10 # 佣金解冻延迟时间,单位:小时
|
||||||
@@ -7,16 +7,16 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
rest.RestConf
|
rest.RestConf
|
||||||
DataSource string
|
DataSource string
|
||||||
CacheRedis cache.CacheConf
|
CacheRedis cache.CacheConf
|
||||||
JwtAuth JwtAuth // JWT 鉴权相关配置
|
JwtAuth JwtAuth // JWT 鉴权相关配置
|
||||||
VerifyCode VerifyCode
|
VerifyCode VerifyCode
|
||||||
Encrypt Encrypt
|
Encrypt Encrypt
|
||||||
Alipay AlipayConfig
|
Alipay AlipayConfig
|
||||||
Wxpay WxpayConfig
|
Wxpay WxpayConfig
|
||||||
Applepay ApplepayConfig
|
Applepay ApplepayConfig
|
||||||
Ali AliConfig
|
Ali AliConfig
|
||||||
Tianyuanapi TianyuanapiConfig
|
Tianyuanapi TianyuanapiConfig
|
||||||
SystemConfig SystemConfig
|
SystemConfig SystemConfig
|
||||||
WechatH5 WechatH5Config
|
WechatH5 WechatH5Config
|
||||||
Authorization AuthorizationConfig // 授权书配置
|
Authorization AuthorizationConfig // 授权书配置
|
||||||
@@ -25,6 +25,7 @@ type Config struct {
|
|||||||
AdminConfig AdminConfig
|
AdminConfig AdminConfig
|
||||||
AdminPromotion AdminPromotion
|
AdminPromotion AdminPromotion
|
||||||
TaxConfig TaxConfig
|
TaxConfig TaxConfig
|
||||||
|
ExtensionTime int64
|
||||||
}
|
}
|
||||||
|
|
||||||
// JwtAuth 用于 JWT 鉴权配置
|
// JwtAuth 用于 JWT 鉴权配置
|
||||||
@@ -98,8 +99,8 @@ type WechatH5Config struct {
|
|||||||
AppSecret string
|
AppSecret string
|
||||||
}
|
}
|
||||||
type WechatMiniConfig struct {
|
type WechatMiniConfig struct {
|
||||||
AppID string
|
AppID string
|
||||||
AppSecret string
|
AppSecret string
|
||||||
}
|
}
|
||||||
type QueryConfig struct {
|
type QueryConfig struct {
|
||||||
ShareLinkExpire int64
|
ShareLinkExpire int64
|
||||||
@@ -126,4 +127,4 @@ type TianyuanapiConfig struct {
|
|||||||
|
|
||||||
type AuthorizationConfig struct {
|
type AuthorizationConfig struct {
|
||||||
FileBaseURL string // 授权书文件访问基础URL
|
FileBaseURL string // 授权书文件访问基础URL
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ func (l *AdminUpdateAgentCommissionStatusLogic) AdminUpdateAgentCommissionStatus
|
|||||||
if req.Status != 0 && req.Status != 1 && req.Status != 2 {
|
if req.Status != 0 && req.Status != 1 && req.Status != 2 {
|
||||||
return nil, xerr.NewErrMsg("无效的状态值,状态必须为0(已结算)、1(冻结中)或2(已取消)")
|
return nil, xerr.NewErrMsg("无效的状态值,状态必须为0(已结算)、1(冻结中)或2(已取消)")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询佣金记录
|
|
||||||
commission, err := l.svcCtx.AgentCommissionModel.FindOne(l.ctx, req.Id)
|
commission, err := l.svcCtx.AgentCommissionModel.FindOne(l.ctx, req.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, model.ErrNotFound) {
|
if errors.Is(err, model.ErrNotFound) {
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ func (s *AsynqService) SendUnfreezeCommissionTask(commissionID int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
options := []asynq.Option{
|
options := []asynq.Option{
|
||||||
asynq.ProcessIn(10 * time.Hour), // 10小时后执行
|
asynq.ProcessIn(time.Duration(s.config.ExtensionTime) * time.Hour), // 10小时后执行
|
||||||
asynq.MaxRetry(5), // 设置最大重试次数
|
asynq.MaxRetry(5), // 设置最大重试次数
|
||||||
}
|
}
|
||||||
task := asynq.NewTask(types.MsgUnfreezeCommission, payloadBytes, options...)
|
task := asynq.NewTask(types.MsgUnfreezeCommission, payloadBytes, options...)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user