|
|
@ -1,15 +1,24 @@ |
|
|
|
package com.ccsens.health.util; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
|
|
/** |
|
|
|
* 健康码项目常量类 |
|
|
|
* @author whj |
|
|
|
*/ |
|
|
|
public class HealthConstant { |
|
|
|
|
|
|
|
public static String school; |
|
|
|
@Value("${health.school:}") |
|
|
|
public void setSchool(String school) { |
|
|
|
HealthConstant.school = school; |
|
|
|
} |
|
|
|
|
|
|
|
/*** redis key: 总人数*/ |
|
|
|
public static final String MEMBER_TOTAL_REDIS = "health_member_total_redis"; |
|
|
|
public static final String MEMBER_TOTAL_REDIS = school + "health_member_total_redis"; |
|
|
|
/** redis key: 返校行程总人数*/ |
|
|
|
public static final String BACK_SCHOOL_TOTAL_REDIS = "health_back_school_total_redis"; |
|
|
|
public static final String BACK_SCHOOL_TOTAL_REDIS = school + "health_back_school_total_redis"; |
|
|
|
/** redis有效时长:30天 */ |
|
|
|
public static final long REDIS_TIME = 30 * 24 * 60 * 60; |
|
|
|
|
|
|
@ -41,4 +50,13 @@ public class HealthConstant { |
|
|
|
public static String getHealthTypeKey(long healthTypeId) { |
|
|
|
return "health_type_" + healthTypeId; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询学校今天健康记录key |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static String getHealthRecordNow() { |
|
|
|
return school + "health_record_" + DateUtil.today(); |
|
|
|
} |
|
|
|
} |
|
|
|