From 631a5aa09e0147ca81fffcb1434e57b1cd1ba6f6 Mon Sep 17 00:00:00 2001
From: lisy <linlangsur163@163.com>
Date: 星期三, 09 八月 2023 09:34:53 +0800
Subject: [PATCH] app端口:积分变动记录增加变动类型字段,代码同步更新;积分兑换操作的数量校验功能完善

---
 cloud-server-account/src/main/java/com/dsh/account/controller/CityController.java |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 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 0208ed9..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
@@ -66,5 +66,57 @@
     }
 
 
+    @PostMapping("/base/city/add")
+    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