更新
This commit is contained in:
@@ -41,7 +41,6 @@ public class countNumServlet extends HttpServlet {
|
|||||||
|
|
||||||
PrintWriter writer = resp.getWriter();
|
PrintWriter writer = resp.getWriter();
|
||||||
String str= String.valueOf(projectService.countAll());
|
String str= String.valueOf(projectService.countAll());
|
||||||
str= "{\"num\":\""+str+"\"}" ;
|
|
||||||
String jsonString = JSONObject.toJSONString(str);
|
String jsonString = JSONObject.toJSONString(str);
|
||||||
writer.println(jsonString);
|
writer.println(jsonString);
|
||||||
writer.close();
|
writer.close();
|
||||||
|
@@ -41,16 +41,8 @@ public class userNumServlet extends HttpServlet {
|
|||||||
|
|
||||||
PrintWriter writer = resp.getWriter();
|
PrintWriter writer = resp.getWriter();
|
||||||
long num = userService.queryUserCount();
|
long num = userService.queryUserCount();
|
||||||
String str= "{\"num\":\""+num+"\"}" ;
|
String jsonString = JSONObject.toJSONString(num);
|
||||||
String jsonString = JSONObject.toJSONString(str);
|
|
||||||
writer.println(jsonString);
|
writer.println(jsonString);
|
||||||
if(num == 0)
|
|
||||||
{
|
|
||||||
setResultError("用户总数为空",writer);
|
|
||||||
}else{
|
|
||||||
setResultOK("success",writer);
|
|
||||||
}
|
|
||||||
|
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
public void setResult(Integer code, String msg, PrintWriter writer) {
|
public void setResult(Integer code, String msg, PrintWriter writer) {
|
||||||
|
Reference in New Issue
Block a user