public StandardJsonResult Update(string key, string value)
 {
     var result = new StandardJsonResult();
     result.Try(() =>
     {
         var service = Ioc.GetService<Services.Admin.ISettingService>();
         service.Update(key, value);
     });
     return result;
 }
 public StandardJsonResult Login(string username, string password)
 {
     var result = new StandardJsonResult();
     result.Try(() =>
     {
         var service = Ioc.GetService<IUserService>();
         if (!service.CanLogin(username, password))
         {
             throw new Exception("invalid username/password.");
         }
     });
     return result;
 }
 public StandardJsonResult Register(User user)
 {
     var result = new StandardJsonResult();
     result.Try(() => Ioc.GetService<Services.Public.IUserService>().Register(user));
     return result;
 }
 public StandardJsonResult Register(User model)
 {
     var result = new StandardJsonResult();
     result.Try(() => Ioc.GetService<IUserService>().Register(model));
     return result;
 }