You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
301 lines
11 KiB
PHP
301 lines
11 KiB
PHP
<?php
|
|
|
|
class RedisKeyConst {
|
|
const redisTypeBizCache = 'bizCache';
|
|
const redisTypeStatCache = 'statCache';
|
|
const redisTypeSolidCache = 'solidCache';
|
|
const redisTypeTimerCache = 'timerCache';
|
|
|
|
const moveProductPublishQueueSelf = 'dd_move_item_publish_queue_self';
|
|
const moveProductPublishQueue = 'dd_move_item_publish_queue';
|
|
|
|
const shopDenyRequestShopIds = 'dd_shop_deny_request_shop_ids';
|
|
const shopRequestTsMap = 'dd_shop_request_ts_map';
|
|
const shopRequestAbnormalSet = 'dd_shop_request_abnormal_set';
|
|
const shopMovePublishCount = 'dd_shop_move_publish_count';
|
|
const shopMovePublishCostTimeCount = 'dd_shop_move_publish_cost_time_count';
|
|
|
|
const adminSelfShopInfo = 'dd_admin_self_shop_info';
|
|
|
|
const moveSettingSearchJsonTs = 'dd_move_setting_search_json_ts';
|
|
|
|
const moveRewriteCidRules = 'dd_move_rewrite_cid_rules';
|
|
|
|
const leafCateList = 'dd_leaf_cate_list_v2';
|
|
|
|
const opOrderPurchaseOutstorageBuffer = 'op_order_purchase_outstorage_buffer';
|
|
|
|
const moveImportTaskQueueSelf = 'move_import_task_queue_self';
|
|
const moveImportTaskQueue = 'move_import_task_queue';
|
|
const moveImportTaskParseDetailSecondsMapKey = 'move_import_task_parse_detail_seconds_map';
|
|
const moveImportTaskParseCountMapKey = 'move_import_task_parse_count_map';
|
|
|
|
const areaTbProvinceListKey = 'area_tb_province_list';
|
|
const areaTbCityIdAndCityNameMapKey = 'area_tb_city_id_and_city_name_map';
|
|
const areaTbCityListKey = 'area_tb_city_list';
|
|
|
|
const searchMoveSettingFieldArr = 'honor_search_move_setting_filed_arr';
|
|
|
|
const moveGroupMoveCountMap = 'honor_dd_move_group_move_count_map';
|
|
const moveGroupMoveStatusCount = 'honor_dd_move_group_move_status_count';
|
|
|
|
const ddLogisticsCompanyCodeAndCompanyIdMap = 'dd_logistics_company_code_and_company_id_map';
|
|
|
|
const orderStatBizKey = 'shop_order_stat';
|
|
const purchaseOrderStatBizKey = 'purchase_order_stat';
|
|
|
|
const afterSaleRejectReasonCodeList = 'after_sale_reject_reason_code_list';
|
|
|
|
const rsyncOpOrderQueueCompletedMap = 'rsync_op_order_queue_completed_map';
|
|
|
|
const orderStatChangeShopIdAndChangeTimeMap = 'order_stat_change_shop_id_and_change_time_map';
|
|
|
|
const ddAreaProvinceList = 'dd_area_province_list';
|
|
const ddAreaCityList = 'dd_area_city_list';
|
|
const dsAutoPurchaseWhitelist = 'ds_auto_purchase_whitelist';
|
|
|
|
const waybillPrintDetailGetHashMap = 'waybill_print_detail_get_hash_map';
|
|
|
|
const userRequestLogInfo = 'user_request_log_info';
|
|
|
|
const jmonitorLog = 'jmonitor_log';
|
|
const dbErrorLog = 'db_error_log';
|
|
|
|
const shopAllRouteReqStatListHeapUpWarningFlag = 'shop_all_route_req_stat_list_heap_up_warning_flag';
|
|
|
|
const stopPullDyCloudData = 'stop_pull_dy_cloud_data';
|
|
|
|
const timerMonitorTimerCodeLockKey = 'timer:monitor_timer_code';
|
|
|
|
const keyTypeNotFound = 0;
|
|
const keyTypeString = 1;
|
|
const keyTypeSet = 2;
|
|
const keyTypeList = 3;
|
|
const keyTypeZset = 4;
|
|
const keyTypeHash = 5;
|
|
|
|
public static function getKeyTypeMap() {
|
|
$keyTypeMap = [
|
|
self::keyTypeNotFound => 'notFound',
|
|
self::keyTypeString => 'string',
|
|
self::keyTypeSet => 'set',
|
|
self::keyTypeList => 'list',
|
|
self::keyTypeZset => 'zset',
|
|
self::keyTypeHash => 'hash',
|
|
];
|
|
|
|
return $keyTypeMap;
|
|
}
|
|
|
|
public static function buildShopRequestRouteMapKey($shopId, $dt, $hour) {
|
|
return sprintf('dd_shop_request_route_map_%s_%s_%s', $dt, $hour, $shopId);
|
|
}
|
|
|
|
public static function buildShopRequestJsSignAbnormalKey($shopId) {
|
|
return sprintf('dd_shop_request_js_sign_abnormal_%s', $shopId);
|
|
}
|
|
|
|
public static function getQueueRedisKey($queueName, $isAdminSelf) {
|
|
if ($isAdminSelf) {
|
|
return ($queueName . '_self');
|
|
} else {
|
|
return $queueName;
|
|
}
|
|
}
|
|
|
|
public static function getInusePurchasePlatformsKey($shopId) {
|
|
return 'inusePurchasePlatforms_' . $shopId;
|
|
}
|
|
|
|
public static function buildGetNeedCheckPurchaseOrdersLockKey($shopId) {
|
|
return 'getNeedCheckPurchaseOrdersBizKey_' . $shopId;
|
|
}
|
|
|
|
public static function buildGetOpOrderPurchaseOutstorageQueueLockKey($shopId) {
|
|
return 'getOpOrderPurchaseOutstorageQueueBizKey_' . $shopId;
|
|
}
|
|
|
|
public static function getShopProductTotalKey($shopId) {
|
|
return sprintf('product_total_%s', $shopId);
|
|
}
|
|
|
|
public static function getSourceCategoryMapKey($shopId) {
|
|
return sprintf('source_category_map_%s', $shopId);
|
|
}
|
|
|
|
public static function shopCatKey($shopId) {
|
|
return sprintf('shop_category_%s', $shopId);
|
|
}
|
|
|
|
public static function getOrderMsgTipLockKey($shopId) {
|
|
return "rsync_order_msg_tip_lock_{$shopId}";
|
|
}
|
|
|
|
public static function getOrderReceiveMobileMapKey($minute = '') {
|
|
$minute = is_numeric($minute) ? str_pad($minute, 2, '0', STR_PAD_LEFT) : date('i');
|
|
return sprintf('order_receiver_mobile_map_%s', $minute);
|
|
}
|
|
|
|
public static function getWaybillWarningWaybillCodeKey($waybillCode) {
|
|
return "waybill_warning_waybill_code_{$waybillCode}";
|
|
}
|
|
|
|
public static function getCheckOrderTipMsgKey($shopId, $filter) {
|
|
ksort($filter);
|
|
$condition = md5(serialize($filter));
|
|
return "rsync_after_sales_msg_{$shopId}_{$condition}";
|
|
}
|
|
|
|
public static function buildDeletedSystemBanWordsKey($shopId) {
|
|
return 'deleted_system_ban_words_' . $shopId;
|
|
}
|
|
|
|
public static function buildWhiteBgImgKey($shopId, $taskId) {
|
|
return sprintf('build_white_bg_img_key_%s_%s', $shopId, $taskId);
|
|
}
|
|
|
|
public static function getShopBizWhitelistBizKey($bizCode) {
|
|
return sprintf('shop_biz_whitelist_%s_map', $bizCode);
|
|
}
|
|
|
|
public static function getMergeSimilarOrderLockKey($venderId, $postReceiverIndex) {
|
|
return sprintf('merge_similar_order_lock_%s_%s', $venderId, $postReceiverIndex);
|
|
}
|
|
|
|
public static function buildShopAuthTokenKey($shopId, $groupId) {
|
|
return sprintf("shop_auth_join_group_token_%s_%s", $shopId, $groupId);
|
|
}
|
|
|
|
public static function buildShopAuthTokenGroupIdKey($token) {
|
|
return sprintf("shop_auth_join_group_token_%s", $token);
|
|
}
|
|
|
|
public static function getIsvLogRedisBizKey($isAdminSelf) {
|
|
$key = Zc::C('appName') . '_isvLogToDdList';
|
|
if ($isAdminSelf) {
|
|
$key .= '_self';
|
|
}
|
|
return $key;
|
|
}
|
|
|
|
public static function buildRsyncOpOrderQueueCompletedMapLockKey($queueId) {
|
|
return sprintf('rsync_op_order_queue_completed_map_lock_%s', $queueId);
|
|
}
|
|
|
|
public static function getBizIdUuidKey($date) {
|
|
return sprintf('bizIdUuidKey_%s', $date);
|
|
}
|
|
|
|
public static function buildStopAllKafkaConsumerKey($bizKey) {
|
|
return sprintf('stop_kafka_consumer_%s', $bizKey);
|
|
}
|
|
|
|
public static function buildStopKafkaConsumerKey($timerLockId) {
|
|
return sprintf('stop_kafka_consumer_%s', $timerLockId);
|
|
}
|
|
|
|
public static function buildAddMarkNewOrderTipMsgReadQueueKey($shopId) {
|
|
return sprintf('add_mark_new_order_tip_msg_read_%s', $shopId);
|
|
}
|
|
|
|
public static function buildPayingNewOrderStatBizKey($date = '') {
|
|
$dt = date('Ymd', $date ? strtotime($date) : time());
|
|
return sprintf('paying_new_order_stat_%s', $dt);
|
|
}
|
|
|
|
public static function buildIsForceUseDbSearch($biz) {
|
|
$isPre = AppConst::isPre();
|
|
return sprintf('is_force_use_db_search_%s%s', $biz, $isPre ? '_pre' : '');
|
|
}
|
|
|
|
public static function buildIsForceUseEsSearchShopIdsKey($biz) {
|
|
$isPre = AppConst::isPre();
|
|
return sprintf('is_force_use_es_search_shop_ids_%s%s', $biz, $isPre ? '_pre' : '');
|
|
}
|
|
|
|
public static function buildOrderStatBizKey($isSelf) {
|
|
return self::orderStatBizKey . ($isSelf ? '_self' : '');
|
|
}
|
|
|
|
public static function buildPurchaseOrderStatBizKey($isSelf) {
|
|
return self::purchaseOrderStatBizKey . ($isSelf ? '_self' : '');
|
|
}
|
|
|
|
public static function buildPreview1688CgSaleproxyFailItemCountKey($ymd, $isSelf) {
|
|
return 'preview_1688cg_saleproxy_fail_item_count_' . $ymd . ($isSelf ? '_self' : '');;
|
|
}
|
|
|
|
public static function buildJmonitorLogWarningKey($errorMsgMd5) {
|
|
return sprintf('jmonitor_log_warning_%s', $errorMsgMd5);
|
|
}
|
|
|
|
public static function buildDbErrorLogWarningKey($errorMsgMd5) {
|
|
return sprintf('db_error_log_warning_%s', $errorMsgMd5);
|
|
}
|
|
|
|
public static function getOuterPlatformAuthFromServiceKey($authId) {
|
|
return sprintf('outer_platform_auth_from_service:%s', $authId);
|
|
}
|
|
|
|
public static function getOuterPlatformAuthCodeKey($authId) {
|
|
return sprintf('outer_platform_auth_code:%s', $authId);
|
|
}
|
|
|
|
public static function buildLtaoUserInfoCacheKey($shopId) {
|
|
return sprintf('ltao_user_info_cache_' . $shopId);
|
|
}
|
|
|
|
public static function buildShopAccessBlacklistKey() {
|
|
return sprintf('shop_access_blacklist');
|
|
}
|
|
|
|
public static function buildShopRouteReqMapKey($shopId, $route, $isV2 = false) {
|
|
return sprintf('shop_route_req_map'. ($isV2 ? '_v2' : '') . ':%s:%s', $shopId, $route);
|
|
}
|
|
|
|
public static function buildShopAllRouteReqStatList() {
|
|
return 'shop_all_route_req_stat_list';
|
|
}
|
|
|
|
public static function buildMinuteShopReqNoticeKey($shopId, $route) {
|
|
return sprintf('minute_shop_req_notice:%s:%s', $shopId, $route);
|
|
}
|
|
|
|
public static function buildMinuteShopSearchFieldLimitKey($shopId, $fieldType = 'common') {
|
|
return sprintf('minute_shop_search_field_limit:%s:%s', $fieldType, $shopId);
|
|
}
|
|
|
|
public static function buildDayShopSearchFieldLimitKey($shopId, $fieldType = 'common') {
|
|
return sprintf('day_shop_search_field_limit:%s:%s', $fieldType, $shopId);
|
|
}
|
|
|
|
public static function buildOrderRsyncCountStatMapKey() {
|
|
return sprintf('order_rsync_count_stat_map_%s', date('Ymd'));
|
|
}
|
|
|
|
public static function getMCTokenKey($shopId) {
|
|
return sprintf('get_mc_token_%s', $shopId);
|
|
}
|
|
|
|
public static function getDyLogRedisBizKey($isAdminSelf) {
|
|
$key = Zc::C('appName') . '_dyLogToKafkaList';
|
|
if ($isAdminSelf) {
|
|
$key .= '_self';
|
|
}
|
|
return $key;
|
|
}
|
|
|
|
public static function buildUserAgreementKey($userId)
|
|
{
|
|
return sprintf('user_agreement:%s', $userId);
|
|
}
|
|
|
|
public static function buildShop1688ReAuthorizedKey($shopId)
|
|
{
|
|
return sprintf('shop_1688_reauthorized:%d', $shopId);
|
|
}
|
|
|
|
public static function buildAddShopAuthGroupByTmpAuthCodeMapKey($shopId) {
|
|
return sprintf('add_shop_auth_group_by_tmp_auth_code_map_%s', $shopId);
|
|
}
|
|
} |