Selaa lähdekoodia

新增简单用户信息查询接口

沈静伟 4 vuotta sitten
vanhempi
commit
fda62b605a

+ 4 - 4
src/dsb/com/cnd3b/common/Controller.java

@@ -302,17 +302,17 @@ public class Controller extends BaseClass {
     }
 
 
-    public Row getUser(String userid) {
+    public Row getUser(long userid) {
         return dbConnect.runSqlQuery("select  * from tenterprise_users where siteid='" + siteid + "' and tenterprise_userid=" + userid).get(0);
     }
 
-    public Row getUser(String userid, String siteid) {
+    public Row getUser(long userid, String siteid) {
         return dbConnect.runSqlQuery("select  * from tenterprise_users where siteid='" + siteid + "' and tenterprise_userid=" + userid).get(0);
     }
 
-    public RowsMap getUser(String userids[]) {
+    public RowsMap getUser(long userids[]) {
         StringBuilder where = new StringBuilder("''");
-        for (String userid : userids) {
+        for (long userid : userids) {
             where.append(",'").append(userid).append("'");
         }
         return dbConnect.runSqlQuery("select  * from tenterprise_users where siteid='" + siteid + "' and tenterprise_userid in(" + where + ")").toRowsMap("tenterprise_userid");

+ 17 - 0
src/dsb/com/cnd3b/restcontroller/system/users/Users.java

@@ -1,5 +1,6 @@
 package com.cnd3b.restcontroller.system.users;
 
+import com.cnd3b.common.data.Row;
 import com.cnd3b.utility.Encryption;
 import com.alibaba.fastjson.JSONObject;
 import com.cnd3b.common.Controller;
@@ -121,4 +122,20 @@ public class Users extends Controller {
         Rows rows = getSubUserRows();
         return getSucReturnObject().setDataByPaging(rows).setFinalDo(DataPool.defaultdatalife, 1);
     }
+
+    /**
+     * »ñÈ¡¼òµ¥Óû§ÐÅÏ¢
+     *
+     * @return
+     */
+    public String getSimpleUserMsg() {
+        long userid = content.getLong("userid");
+        String headportraiturl = getHeadPic(userid);
+        Row row = getUser(userid);
+        JSONObject object = new JSONObject();
+        object.put("fname", row.getString("fname"));
+        object.put("headportraiturl", headportraiturl);
+        object.put("fsex", row.getString("fsex"));
+        return getSucReturnObject().setData(object).saveToDataPool(100).toString();
+    }
 }