From 061446e38be37de38139aa135529121390b6cc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=B4=E4=BB=81=E8=BE=89?= Date: Sun, 27 Nov 2022 16:17:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 - .../example/EmergencyDecisionServlet.java | 55 ------------------- 2 files changed, 57 deletions(-) delete mode 100644 README.md delete mode 100644 src/src_houduan/web/sevlet/example/EmergencyDecisionServlet.java diff --git a/README.md b/README.md deleted file mode 100644 index e73d2fd..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# yinrenhui_Git - diff --git a/src/src_houduan/web/sevlet/example/EmergencyDecisionServlet.java b/src/src_houduan/web/sevlet/example/EmergencyDecisionServlet.java deleted file mode 100644 index d0b7684..0000000 --- a/src/src_houduan/web/sevlet/example/EmergencyDecisionServlet.java +++ /dev/null @@ -1,55 +0,0 @@ -package web.servlet.example; - -import com.fasterxml.jackson.databind.ObjectMapper; -import domain.Example; -import service.ExampleService; -import service.impl.ExampleServiceImpl; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @author laoyingyong - * @date: 2020-02-05 15:52 - */ -@WebServlet("/EmergencyDecisionServlet") -public class EmergencyDecisionServlet extends HttpServlet -{ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - request.setCharacterEncoding("utf-8"); - String type = request.getParameter("type"); - String source = request.getParameter("source"); - String multiple = request.getParameter("multiple"); - String distance = request.getParameter("distance"); - String toxicity = request.getParameter("toxicity"); - String danger = request.getParameter("danger"); - String stability = request.getParameter("stability"); - String solubility = request.getParameter("solubility"); - String volatility = request.getParameter("volatility"); - double v=0; - if(multiple!=null&&!multiple.equals("")) - {v = Double.parseDouble(multiple);} - int i=0; - if(distance!=null&&!distance.equals("")) - {i = Integer.parseInt(distance);} - ExampleService service=new ExampleServiceImpl(); - List resembleExamples = service.findResembleExamples(type, source, v, i, toxicity, danger, stability, solubility, volatility); - response.setContentType("application/json;chartset=utf-8"); - ObjectMapper mapper=new ObjectMapper(); - mapper.writeValue(response.getOutputStream(),resembleExamples); - - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - - this.doPost(request, response); - - } -}