配置文件迁移更新

dependabot/npm_and_yarn/fir_admin/url-parse-1.5.10
nineven 3 years ago
parent 06bace9f66
commit 9353abc8a9
  1. 30
      fir_ser/api/utils/sysconfig.py
  2. 7
      fir_ser/config.py

@ -11,7 +11,8 @@ from rest_framework import serializers
from api.models import SystemConfig
from common.cache.storage import SystemConfigCache
from config import BASECONF, API_DOMAIN, MOBILEPROVISION, WEB_DOMAIN, THIRDLOGINCONF, AUTHCONF, IPACONF, MSGCONF
from config import BASECONF, API_DOMAIN, MOBILEPROVISION, WEB_DOMAIN, THIRDLOGINCONF, AUTHCONF, IPACONF, MSGCONF, \
DOWNLOADTIMESCONF
logger = logging.getLogger(__name__)
@ -173,13 +174,11 @@ class GeeTestConfCache(ConfigCacheBase):
@property
def GEETEST_ID(self):
value = super().get_value('GEETEST_ID')
return value if value else BASECONF.GEETEST_ID
return super().get_value('GEETEST_ID', BASECONF.GEETEST_ID)
@property
def GEETEST_KEY(self):
value = super().get_value('GEETEST_KEY')
return value if value else BASECONF.GEETEST_KEY
return super().get_value('GEETEST_KEY', BASECONF.GEETEST_KEY)
@property
def GEETEST_CYCLE_TIME(self):
@ -187,18 +186,15 @@ class GeeTestConfCache(ConfigCacheBase):
定时任务初始化该数值无效需要在配置中定义
:return:
"""
value = super().get_value('GEETEST_CYCLE_TIME')
return value if value else BASECONF.GEETEST_CYCLE_TIME
return super().get_value('GEETEST_CYCLE_TIME', BASECONF.GEETEST_CYCLE_TIME)
@property
def GEETEST_BYPASS_STATUS_KEY(self):
value = super().get_value('GEETEST_BYPASS_STATUS_KEY')
return value if value else BASECONF.GEETEST_BYPASS_STATUS_KEY
return super().get_value('GEETEST_BYPASS_STATUS_KEY', BASECONF.GEETEST_BYPASS_STATUS_KEY)
@property
def GEETEST_BYPASS_URL(self):
value = super().get_value('GEETEST_BYPASS_URL')
return value if value else BASECONF.GEETEST_BYPASS_URL
return super().get_value('GEETEST_BYPASS_URL', BASECONF.GEETEST_BYPASS_URL)
class UserDownloadTimesCache(ConfigCacheBase):
@ -207,23 +203,19 @@ class UserDownloadTimesCache(ConfigCacheBase):
@property
def USER_FREE_DOWNLOAD_TIMES(self):
value = super().get_value('USER_FREE_DOWNLOAD_TIMES')
return value if value else 5
return super().get_value('USER_FREE_DOWNLOAD_TIMES', DOWNLOADTIMESCONF.USER_FREE_DOWNLOAD_TIMES)
@property
def AUTH_USER_FREE_DOWNLOAD_TIMES(self):
value = super().get_value('AUTH_USER_FREE_DOWNLOAD_TIMES')
return value if value else 10
return super().get_value('AUTH_USER_FREE_DOWNLOAD_TIMES', DOWNLOADTIMESCONF.AUTH_USER_FREE_DOWNLOAD_TIMES)
@property
def NEW_USER_GIVE_DOWNLOAD_TIMES(self):
value = super().get_value('NEW_USER_GIVE_DOWNLOAD_TIMES')
return value if value else 100
return super().get_value('NEW_USER_GIVE_DOWNLOAD_TIMES', DOWNLOADTIMESCONF.NEW_USER_GIVE_DOWNLOAD_TIMES)
@property
def AUTH_USER_GIVE_DOWNLOAD_TIMES(self):
value = super().get_value('AUTH_USER_GIVE_DOWNLOAD_TIMES')
return value if value else 200
return super().get_value('AUTH_USER_GIVE_DOWNLOAD_TIMES', DOWNLOADTIMESCONF.AUTH_USER_GIVE_DOWNLOAD_TIMES)
class EmailMsgCache(ConfigCacheBase):

@ -339,3 +339,10 @@ class MSGCONF(object):
MSG_NOT_EXIST_DEVELOPER = '用户 %s 你好,应用 %s 签名失败了,苹果开发者总设备量已经超限,请添加新的苹果开发者或者修改开发者设备数量。感谢有你!'
MSG_ERROR_DEVELOPER = '用户 %s 你好,应用 %s 签名失败了,苹果开发者 %s 信息异常,请重新检查苹果开发者状态是否正常。感谢有你!'
MSG_AUTO_CHECK_DEVELOPER = '用户 %s 你好,苹果开发者 %s 信息异常,请重新检查苹果开发者状态是否正常。感谢有你!'
class DOWNLOADTIMESCONF(object):
USER_FREE_DOWNLOAD_TIMES = 5
AUTH_USER_FREE_DOWNLOAD_TIMES = 10
NEW_USER_GIVE_DOWNLOAD_TIMES = 100
AUTH_USER_GIVE_DOWNLOAD_TIMES = 200

Loading…
Cancel
Save