예제 #1
0
 /**
  * 钻石兑换
  */
 public static void exchargeDiamond(string goodID, Action <Error> action)
 {
     HttpUtil.Http.Get(URLManager.diamondExchangeUrl(goodID)).OnSuccess(result =>
     {
         Dictionary <string, object> resultDict = JsonMapper.ToObject <Dictionary <string, object> >(result);
         string ret = resultDict["ret"].ToString();
         if (ret == "1")
         {
             action(null);
         }
         else
         {
             action(new Error(500, null));
         }
     }).OnFail(result =>
     {
         action(new Error(500, null));
     }).Go();
 }