Browse Source

first commit

wangweiqun 6 years ago
parent
commit
8d86bc3be5

+ 1 - 1
commons/commons-data-redis/pom.xml

@ -5,7 +5,7 @@
        <groupId>com.yihu.ehr</groupId>
        <artifactId>ehr-lib-parent-pom</artifactId>
        <version>1.2.0</version>
        <relativePath>../../pom.xml</relativePath>
        <relativePath>../../ehr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <artifactId>commons-data-redis</artifactId>

+ 37 - 0
commons/commons-data-redis/src/main/java/com/yihu/ehr/redis/schema/AddressDictSchema.java

@ -0,0 +1,37 @@
package com.yihu.ehr.redis.schema;
import org.springframework.stereotype.Component;
/**
 *  行政区划
 * @author HZY
 * @created 2018/8/21 16:58
 */
@Component
public class AddressDictSchema extends KeySchema {
    public AddressDictSchema() {
        super.table = "area";
        super.column = "name";
    }
    /**
     * 清空当前表的所有缓存
     */
    public void delete(){
        redisClient.delete(makeKey(this.table , "*",column));
    }
    public String getAreaName( String code) {
        return redisClient.get(makeKey(table, code, column));
    }
    public void setAreaName( String code, String value) {
        redisClient.set(makeKey(table, code, column), value);
    }
}