コード例 #1
0
        public ActionResult Index()
        {
            AccountService ac = new AccountService();
            ac.testMethod();
            //ac.RegistNewAccount("CAAFfZA12v9xkBAJywVEEkDh5mFChKpEkYT54ZC5b6aN6RDSlHYMNQjcCNWPiabxrq9XPw4VxExfZBjxfS0LAJhw1Y1BO0LSy1IWxtZCdO50k6Tv21XHj7HKShFiQ3J68FIieenUIx2uFngBOBcboJZCqH2epzOm0ZCrHEgvrQYuGsjCxKI9dCOKW2ZCuJItZCXIZD");
            //double sss = (DateTime.UtcNow - new DateTime(1970, 1, 1).ToLocalTime()).TotalSeconds;

            return View();
        }
コード例 #2
0
        public HttpResponseMessage Regist(dynamic req)
        {
            string accessToken = "";
            Dictionary<string, object> retval = new Dictionary<string, object>();
            AccountService ac = new AccountService();
            try
            {
                accessToken = req.accessToken;
                retval = ac.RegistNewAccount(accessToken);
            }
            catch (Exception ext)
            {
                retval.Add("state", false);
                retval.Add("message", ext.Message);
            }

            string yourJson = JsonConvert.SerializeObject(retval);
            var response = this.Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json");
            return response;
        }