예제 #1
0
 public SetDetail getSetDetail(string setId, string clientId)
 {
     if (CachesMgr.cacheSetExist(setId))
     {
         return(CachesMgr.getCacheSet(setId));
     }
     else
     {
         string    url         = BASE_URL + "sets/" + setId + "?client_id=" + clientId + "&whitespace=0";
         string    strResponse = HTTPRequest.get(url);
         SetDetail setDetail   = Newtonsoft.Json.JsonConvert.DeserializeObject <SetDetail>(strResponse);
         CachesMgr.writeCacheSet(setId, setDetail);
         return(setDetail);
     }
 }
예제 #2
0
 public UserDetail getUserSets(string username, string clientId)
 {
     if (CachesMgr.cacheUserInfoExist(username))
     {
         return(CachesMgr.getCacheUserInfo(username));
     }
     else
     {
         string url         = BASE_URL + "users/" + username + "?client_id=" + clientId + "&whitespace=0";
         string strResponse = HTTPRequest.get(url);
         //List<SetDetail> listSets = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SetDetail>>(strResponse);
         UserDetail listSets = Newtonsoft.Json.JsonConvert.DeserializeObject <UserDetail>(strResponse);
         CachesMgr.writeCacheUserInfo(username, listSets);
         return(listSets);
     }
 }
예제 #3
0
 public static bool cacheUserInfoExist(string userName)
 {
     return(CachesMgr.cacheExist("ui_" + userName));
 }
예제 #4
0
 public static bool cacheSetExist(string setId)
 {
     return(CachesMgr.cacheExist("s_" + setId));
 }
예제 #5
0
 public static bool cacheUserSetsExist(string userName)
 {
     return(CachesMgr.cacheExist("us_" + userName));
 }