From 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4 Mon Sep 17 00:00:00 2001
From: whycrzg <ruanzhigang@whycst.com>
Date: 星期二, 23 二月 2021 17:19:23 +0800
Subject: [PATCH] update

---
 src/main/java/com/fgkj/controller/CustompageController.java |   66 ++++++++++++++++++++------------
 1 files changed, 41 insertions(+), 25 deletions(-)

diff --git a/src/main/java/com/fgkj/controller/CustompageController.java b/src/main/java/com/fgkj/controller/CustompageController.java
index 8293e78..3e880b4 100644
--- a/src/main/java/com/fgkj/controller/CustompageController.java
+++ b/src/main/java/com/fgkj/controller/CustompageController.java
@@ -6,6 +6,7 @@
 import com.fgkj.dto.ServiceModel;
 import com.fgkj.services.CustompageService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -15,7 +16,7 @@
 
 @RequestMapping("customPage")
 @RestController
-@Api
+@Api(tags = "customPage鎺ュ彛")
 public class CustompageController{
 	
 	@Resource
@@ -25,23 +26,27 @@
 
 	//椤甸潰瀹氬埗涓嬫坊鍔犲鑸垨鑰呭瓙椤甸潰
 	@PostMapping("/")
+	@ApiOperation(notes = "",value="椤甸潰瀹氬埗涓嬫坊鍔犲鑸垨鑰呭瓙椤甸潰")
 	public ServiceModel add(@RequestBody Custompage cust) {
 	    // cust=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,Custompage.class);
 		ServiceModel model=service.add(cust);
 		
 		return model;
 	}
-	
+
 	//椤甸潰瀹氬埗鍙互鐪嬪埌鐨勫瓙鑿滃崟鍜屽瓙妯″潡
 	@PutMapping("/")
+	@ApiOperation(notes = "[{ \"num\": 78, \"subflag\": 0, \"subenable\": 0 }]",value="椤甸潰瀹氬埗鍙互鐪嬪埌鐨勫瓙鑿滃崟鍜屽瓙妯″潡")
 	public ServiceModel update(@RequestBody List<Custompage> list) {
-		// List<Custompage> list = ActionUtil.getGson().fromJson(result, new TypeToken<ArrayList<Custompage>>(){}.getType() );
-		ServiceModel model=service.update(list);		
-		
+
+		ServiceModel model = service.update(list);
 		return model;
 	}
+
+
 	//椤甸潰瀹氬埗淇敼涓诲鑸笅瀛愰〉闈㈢殑椤哄簭
 	@PutMapping("order")
+	@ApiOperation(notes = "[{ \"num\": 78, \"page_order\": 0 }]",value="椤甸潰瀹氬埗淇敼涓诲鑸笅瀛愰〉闈㈢殑椤哄簭")
 	public ServiceModel updateOrder(@RequestBody List<Custompage> list) {
 		// List<Custompage> list = ActionUtil.getGson().fromJson(result, new TypeToken<ArrayList<Custompage>>(){}.getType() );
 		ServiceModel model=service.updateOrder(list);		
@@ -51,23 +56,28 @@
 	}
 
 	@DeleteMapping("/")
-	public ServiceModel delete(@RequestBody Custompage cust) {
-		ServiceModel model=service.delete(cust);
-		
-		return model;
+	@ApiOperation(notes = "鏈畬鎴愬姛鑳�",value="鍒犻櫎")
+	public ServiceModel delete() {
+//		Custompage cust = new Custompage();
+//		ServiceModel model = service.delete(cust);
+
+		return  new ServiceModel();
 	}
 
-	@GetMapping("byCondition")
-	public ServiceModel serchByCondition(@RequestBody Custompage cust){
-		// cust=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,Custompage.class);
-		ServiceModel model=service.serchByCondition(cust);
-		
-		//System.out.println(result);
+	@PostMapping("byCondition")
+	@ApiOperation(notes = "",value="椤甸潰鏌ヨ瀛愭ā鍧�/瀛愯彍鍗�")
+	public ServiceModel serchByCondition(@RequestParam String navigate,@RequestParam Integer subjudge) {
+		Custompage cust = new Custompage();
+		cust.setNavigate(navigate);
+		cust.setSubjudge(subjudge);
+		ServiceModel model = service.serchByCondition(cust);
+
 		return model;
 	}
 
     //鏌ヨ鎵�鏈夌殑鑿滃崟(椤甸潰瀹氬埗鍙互鐪嬪埌鐨勫瓙鑿滃崟鍜屽瓙妯″潡)
 	@GetMapping("all")
+	@ApiOperation(notes = "",value="鏌ヨ鎵�鏈夌殑鑿滃崟(椤甸潰瀹氬埗鍙互鐪嬪埌鐨勫瓙鑿滃崟鍜屽瓙妯″潡)")
     public ServiceModel searchAll(){
 		ServiceModel model=service.searchAll();
 		setCust(model);
@@ -76,21 +86,27 @@
 	}
 
     //鏍规嵁涓诲鑸殑鍚嶅瓧鏌ヨ鎵�鏈夌殑瀛愰〉闈�
-	@GetMapping("byInfo")
-    public ServiceModel serchByInfo(@RequestBody Custompage cust){
-    	// cust=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,Custompage.class);
+	@PostMapping("byInfo")
+	@ApiOperation(notes = "",value="涓诲鑸殑鍚嶅瓧鏌ヨ鎵�鏈夌殑瀛愰〉")
+    public ServiceModel serchByInfo(@RequestParam String navigate){
+    	// "navigate": "Monitor_data"
+		Custompage cust = new Custompage();
+		cust.setNavigate(navigate);
 		ServiceModel model=service.serchByInfo(cust);
 		
 		return model;
 	}
+
+
     //灏嗗鑸璞℃暟缁勫瓨鍏ession
 	@PostMapping("custom2Session")
-    public static void setCust(ServiceModel obj){
-				if(obj!=null){
-					ServiceModel model=(ServiceModel) obj;
-					ActionUtil.getSession().setAttribute("custompages", model.getData());
-    		ActionUtil.getSession().setAttribute("custompages_json", ActionUtil.tojson(model.getData()));
-    	}
-    }
+	@ApiOperation(notes = "鍙傛暟:{ \"code\": 0, \"msg\": \"\", \"data\": {} } 杩斿洖鍊肩被鍨媣oid",value="灏嗗鑸璞℃暟缁勫瓨鍏ession")
+    public static void setCust(ServiceModel obj) {
+		if (obj != null) {
+			ServiceModel model = (ServiceModel) obj;
+			ActionUtil.getSession().setAttribute("custompages", model.getData());
+			ActionUtil.getSession().setAttribute("custompages_json", ActionUtil.tojson(model.getData()));
+		}
+	}
     
 }

--
Gitblit v1.9.1