123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package com.yihu.platform.api;
- import com.yihu.platform.utils.ApiUtil;
- import com.yihu.platform.utils.StringUtil;
- import com.yihu.wsgw.api.InterfaceMessage;
- import net.sf.json.JSONException;
- import net.sf.json.JSONObject;
- /**
- * 帐户类API
- *
- * @author wengsb----yihu.com 2017年8月17日下午3:00:15
- */
- public class AccountApi {
- /**
- * 通过手机号获取用户信息
- *
- * @param msg
- * @return
- */
- public String getAccLoginInfo(InterfaceMessage msg) {
- try {
- JSONObject json = JSONObject.fromObject(msg.getParam());
- Integer id = StringUtil.isEmpty(json.get("id")) ? null : json.getInt("id");
- String param = StringUtil.isEmpty(json.get("param")) ? "" : json.getString("param");
- if (StringUtil.isEmpty(id)) {
- return ApiUtil.getRespJSON(-10000, "id不能为空").toString();
- }
- JSONObject result = new JSONObject();
- result.put("UserName", "");
- result.put("PhotoUri", "");
- result.put("CName", "");
- result.put("Sex", "");
- result.put("BirthDate", "");
- result.put("IdNumber", "");
- result.put("IsBear", "");
- result.put("IsMarried", "");
- result.put("MainPhone", "");
- result.put("Phone", "");
- result.put("Email", "");
- result.put("ProvinceID", "");
- result.put("ProvinceName", "");
- result.put("CityID", "");
- result.put("CityName", "");
- result.put("AreaID", "");
- result.put("AreaName", "");
- result.put("UserID", "");
- result.put("LoginType", "");
- result.put("RoleType", "");
-
- JSONObject obj = ApiUtil.getRespJSON(10000, "成功");
- obj.put("Result", result);
- return obj.toString();
- } catch (JSONException e) {
- return ApiUtil.getRespJSON(-10000, "非标准json:[" + msg.getParam() + "]").toString();
- } catch (Exception e) {
- e.printStackTrace();
- return ApiUtil.getRespJSON(-14444, "加载异常!" + StringUtil.getException(e)).toString();
- }
- }
- }
|