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