12345678910111213141516171819202122232425 |
- /**
- * Created by Tony on 2016/12/28.
- */
- var cache = {};
- module.exports = {
- setCache: function(groupKey, cacheKey, cacheValue) {
- if (groupKey && cacheKey) {
- if (!(cache[groupKey])) {
- cache[groupKey] = {};
- }
- cache[groupKey][cacheKey] = cacheValue;
- return true;
- } else {
- return false;
- }
- },
- getCache: function(groupKey, cacheKey) {
- var rst = null;
- if (cache[groupKey]) {
- rst = cache[groupKey][cacheKey];
- }
- return rst;
- }
- }
|