1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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;
- /**
- * 用户接口
- * @author wengsb----yihu.com
- * 2017年8月17日下午3:00:15
- */
- public class UserApi {
- /**
- * 通过用户id获取用户信息
- * @param msg
- * @return
- */
- public String queryUserInfoByID(InterfaceMessage msg) {
- try {
- JSONObject json = JSONObject.fromObject(msg.getParam());
- Integer userId = StringUtil.isEmpty(json.get("userId")) ? null : json.getInt("userId");
- if (StringUtil.isEmpty(userId)) {
- 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("MainPhone", "");
- result.put("Phone", "");
- result.put("ProvinceID", "");
- result.put("ProvinceName", "");
- result.put("CityID", "");
- result.put("CityName", "");
- result.put("AreaID", "");
- result.put("AreaName", "");
- result.put("UserID", "");
- 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();
- }
- }
-
- /**
- * 通过用户id获取用户信息
- *
- * @param msg
- * @return
- */
- public String getAccLoginInfo(InterfaceMessage msg) {
- return this.queryUserInfoByID(msg);
- }
-
- /**
- * 通过用户id获取用户信息
- *
- * @param msg
- * @return
- */
- public String queryLoginInfoByUserID(InterfaceMessage msg) {
- return this.queryUserInfoByID(msg);
- }
-
-
- }
|