From f6ba3e15355e22767e69f8fc14ae22523f8db8dc Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期三, 22 十一月 2023 19:33:58 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai

---
 cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java
index c3d307b..c34017c 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java
@@ -67,13 +67,56 @@
 
 
     @PostMapping("/base/city/add")
-    public void add(@RequestBody TCityManager manager){
+    public Integer add(@RequestBody TCityManager manager){
         try {
             cityService.save(manager);
+            return manager.getId();
+        }catch (Exception e){
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
+    @PostMapping("/base/city/getById")
+    public TCityManager getById(@RequestBody Integer id){
+        try {
+            return cityService.getById(id);
+        }catch (Exception e){
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
+    @PostMapping("/base/city/update")
+    public void update(@RequestBody TCityManager manager){
+        try {
+             cityService.updateById(manager);
         }catch (Exception e){
             e.printStackTrace();
         }
     }
 
 
+    @PostMapping("/base/city/freeze")
+    public void freeze(@RequestBody Integer id){
+        try {
+            TCityManager byId = cityService.getById(id);
+            byId.setState(2);
+            cityService.updateById(byId);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+    @PostMapping("/base/city/unfreeze")
+    public void unfreeze(@RequestBody Integer id){
+        try {
+            TCityManager byId = cityService.getById(id);
+            byId.setState(1);
+            cityService.updateById(byId);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
 }

--
Gitblit v1.7.1