配置文件迁移更新

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

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