e027498de76a9845f6175e794f63aba57345e3ed.svn-base 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.yihu.platform.api;
  2. import com.yihu.platform.utils.ApiUtil;
  3. import com.yihu.platform.utils.StringUtil;
  4. import com.yihu.wsgw.api.InterfaceMessage;
  5. import net.sf.json.JSONException;
  6. import net.sf.json.JSONObject;
  7. /**
  8. * 帐户类API
  9. *
  10. * @author wengsb----yihu.com 2017年8月17日下午3:00:15
  11. */
  12. public class AccountApi {
  13. /**
  14. * 通过手机号获取用户信息
  15. *
  16. * @param msg
  17. * @return
  18. */
  19. public String getAccLoginInfo(InterfaceMessage msg) {
  20. try {
  21. JSONObject json = JSONObject.fromObject(msg.getParam());
  22. Integer id = StringUtil.isEmpty(json.get("id")) ? null : json.getInt("id");
  23. String param = StringUtil.isEmpty(json.get("param")) ? "" : json.getString("param");
  24. if (StringUtil.isEmpty(id)) {
  25. return ApiUtil.getRespJSON(-10000, "id不能为空").toString();
  26. }
  27. JSONObject result = new JSONObject();
  28. result.put("UserName", "");
  29. result.put("PhotoUri", "");
  30. result.put("CName", "");
  31. result.put("Sex", "");
  32. result.put("BirthDate", "");
  33. result.put("IdNumber", "");
  34. result.put("IsBear", "");
  35. result.put("IsMarried", "");
  36. result.put("MainPhone", "");
  37. result.put("Phone", "");
  38. result.put("Email", "");
  39. result.put("ProvinceID", "");
  40. result.put("ProvinceName", "");
  41. result.put("CityID", "");
  42. result.put("CityName", "");
  43. result.put("AreaID", "");
  44. result.put("AreaName", "");
  45. result.put("UserID", "");
  46. result.put("LoginType", "");
  47. result.put("RoleType", "");
  48. JSONObject obj = ApiUtil.getRespJSON(10000, "成功");
  49. obj.put("Result", result);
  50. return obj.toString();
  51. } catch (JSONException e) {
  52. return ApiUtil.getRespJSON(-10000, "非标准json:[" + msg.getParam() + "]").toString();
  53. } catch (Exception e) {
  54. e.printStackTrace();
  55. return ApiUtil.getRespJSON(-14444, "加载异常!" + StringUtil.getException(e)).toString();
  56. }
  57. }
  58. }