forked from dufyun/learn-tech-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
913 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
learn-sitech-project/cache-to-file-db/src/main/java/org/dufy/cache/CacheConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.dufy.cache; | ||
|
||
/** | ||
* 缓存的常量 | ||
* | ||
* @author:dufyun | ||
* @version:1.0.0 | ||
* @date 2018/7/16 | ||
* @update:[日期YYYY-MM-DD] [更改人姓名][变更描述] | ||
*/ | ||
public interface CacheConstants { | ||
|
||
public static final int expire_day = 24 * 60 * 60; | ||
/** | ||
* 缓存key user:id | ||
*/ | ||
public static final String USER_KEY = "user:"; | ||
|
||
|
||
} |
41 changes: 41 additions & 0 deletions
41
learn-sitech-project/cache-to-file-db/src/main/java/org/dufy/cache/IUserCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.dufy.cache; | ||
|
||
import org.dufy.model.User; | ||
|
||
/** | ||
* 用户缓存接口类 | ||
* | ||
* @author:dufyun | ||
* @version:1.0.0 | ||
* @date 2018/7/16 | ||
* @update:[日期YYYY-MM-DD] [更改人姓名][变更描述] | ||
*/ | ||
public interface IUserCache { | ||
|
||
/** | ||
* string set user | ||
* @param user | ||
*/ | ||
public void setUser(User user); | ||
|
||
/** | ||
* string get user | ||
* @param id | ||
* @return | ||
*/ | ||
public User getUser(String id); | ||
|
||
/** | ||
* hset user | ||
* @param user | ||
*/ | ||
public void hsetUser(User user); | ||
|
||
/** | ||
* hget user | ||
* @param id | ||
* @return | ||
*/ | ||
public User hgetUser(String id); | ||
|
||
} |
Oops, something went wrong.