Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 3
0
 public static bool cacheUserInfoExist(string userName)
 {
     return(CachesMgr.cacheExist("ui_" + userName));
 }
Exemplo n.º 4
0
 public static bool cacheSetExist(string setId)
 {
     return(CachesMgr.cacheExist("s_" + setId));
 }
Exemplo n.º 5
0
 public static bool cacheUserSetsExist(string userName)
 {
     return(CachesMgr.cacheExist("us_" + userName));
 }