Example #1
0
 @RequestMapping("saveAdvice")
 public void saveAdvice(
     Advice advice, Long userid, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   try {
     User user = mpts.getuserid(userid);
     advice.setUser(user);
     mpts.saveadvice(advice);
     out.write("1");
   } catch (Exception e) {
     out.write("-1");
     e.printStackTrace();
   } finally {
     out.close();
   }
 }
Example #2
0
 @RequestMapping("queryc")
 public void queryCosmetics(Long id, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   Cosmetics cos = mpts.getCos(id);
   String json = mapper.toJson(cos);
   out.write(json);
   out.close();
 }
Example #3
0
 @RequestMapping("queryct")
 public void queryCosmeticsbytype(
     Long typeid, HttpServletResponse request, HttpServletResponse response) throws IOException {
   PrintWriter out = response.getWriter();
   List<Map<String, String>> list = mpts.queryCosmeticsbytype(typeid);
   String json = mapper.toJson(list);
   out.write(json);
   out.close();
 }
Example #4
0
 @RequestMapping("querytype")
 public void querytype(HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   List<CosmeticType> list = mpts.getAll();
   String json = mapper.toJson(list);
   out.write(json);
   out.close();
 }
Example #5
0
 @RequestMapping("querydtall")
 public void querydtall(int user_id, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   List<Map<String, String>> map = mpts.querydtall(user_id);
   String json = mapper.toJson(map);
   out.write(json);
   out.close();
 }
Example #6
0
 @RequestMapping("queryzixun")
 public void queryzixun(Long type, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   List<Map<String, String>> map = mpts.queryzixun(type);
   String json = mapper.toJson(map);
   out.write(json);
   out.close();
 }
Example #7
0
 @RequestMapping("querycpp")
 public void querycospp(String name, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   System.out.println("121111111111111111111111111" + name);
   List<Map<String, String>> list = mpts.querycospp(name);
   String json = mapper.toJson(list);
   out.write(json);
   out.close();
 }
Example #8
0
  @RequestMapping("zc")
  public void zc(User user, HttpServletResponse request, HttpServletResponse response)
      throws IOException {
    PrintWriter out = response.getWriter();
    try {
      User user1 = new User();
      user1 = mpts.getuser(user);

      if (user1 != null) {
        out.write("-3");
      } else {
        mpts.saveuser(user);
        out.write("1");
      }

    } catch (Exception e) {
      out.write("-1");
      e.printStackTrace();
    } finally {
      out.close();
    }
  }
Example #9
0
 @RequestMapping("savedt")
 public void savedt(MyorderBen myorder, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   try {
     mpts.savedt(myorder);
     out.write("1");
   } catch (Exception e) {
     out.write("-1");
     e.printStackTrace();
   } finally {
     out.close();
   }
 }
Example #10
0
 @RequestMapping("deletecar")
 public void deletecar(String shoppid, HttpServletResponse request, HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   try {
     mpts.deletecar(shoppid);
     out.write("1");
   } catch (Exception e) {
     out.write("-1");
     e.printStackTrace();
   } finally {
     out.close();
   }
 }
Example #11
0
  @RequestMapping("updatemm")
  public void updatemm(
      Long userid, String password, HttpServletResponse request, HttpServletResponse response)
      throws IOException {
    PrintWriter out = response.getWriter();
    try {
      mpts.updatemm(userid, password);
      out.write("1");
    } catch (Exception e) {
      out.write("-1");
      e.printStackTrace();

    } finally {
      out.close();
    }
  }
Example #12
0
  @RequestMapping("login")
  public void login(User user, HttpServletResponse request, HttpServletResponse response)
      throws IOException {
    PrintWriter out = response.getWriter();
    User user1 = new User();
    user1 = mpts.getuser(user);
    if (user1 == null || user1.getUsername() == null) {

      out.write("-1");
    } else if (user1.getPassword().equals(user.getPassword())) {
      String json = mapper.toJson(user1);
      out.write(json);
    } else {
      out.write("-2");
    }
    out.close();
  }
Example #13
0
 @RequestMapping("savecar")
 public void savecar(
     Long cosmetics_id,
     Integer buy_count,
     Integer comstics_count,
     Long user_id,
     HttpServletResponse request,
     HttpServletResponse response)
     throws IOException {
   PrintWriter out = response.getWriter();
   try {
     mpts.savecar(cosmetics_id, buy_count, comstics_count, user_id);
     out.write("1");
   } catch (Exception e) {
     out.write("-1");
     e.printStackTrace();
   } finally {
     out.close();
   }
 }