-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor redis plugins
- Loading branch information
Showing
5 changed files
with
74 additions
and
25 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
webBee-core/src/main/java/org/bee/webBee/DataStoreBase.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,15 @@ | ||
package org.bee.webBee; | ||
|
||
/** | ||
* data 2017-04-22 23:42 | ||
* E-mail [email protected] | ||
* @author sis.nonacosa | ||
*/ | ||
public interface DataStoreBase<T> { | ||
|
||
T insert(T value); | ||
|
||
T select(); | ||
|
||
|
||
} |
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,12 @@ | ||
package org.bee.webBee; | ||
|
||
/** | ||
* data 2017-04-22 23:42 | ||
* E-mail [email protected] | ||
* @author sis.nonacosa | ||
*/ | ||
public interface DataStoreKV<T> extends DataStoreBase { | ||
|
||
T insert(String key,T value); | ||
|
||
} |
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,42 @@ | ||
package webbee.redis; | ||
|
||
import org.bee.webBee.DataStoreBase; | ||
import org.bee.webBee.DataStoreKV; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* data 2017-04-22 00:19 | ||
* E-mail [email protected] | ||
* @author sis.nonacosa | ||
*/ | ||
public class RedisHash implements DataStoreBase { | ||
|
||
public static String set(String key, Map<String,String> hash){ | ||
return Redis.create().hmset(key,hash); | ||
|
||
} | ||
|
||
|
||
public boolean insert(String key, Map<String,String> value) { | ||
return Redis.create().hmset(key, value).equals("OK"); | ||
} | ||
|
||
@Override | ||
public Object insert(Object value) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object select() { | ||
return null; | ||
} | ||
|
||
|
||
public static RedisHash create(){ | ||
return new RedisHash(); | ||
} | ||
|
||
|
||
|
||
} |
16 changes: 0 additions & 16 deletions
16
webBee-redis/src/main/java/webbee/redis/RedisHashUtil.java
This file was deleted.
Oops, something went wrong.
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