From 69a3c374ca3afb770e3b9ffcbdda07ce362cbf58 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期五, 09 一月 2026 19:59:29 +0800
Subject: [PATCH] #

---
 rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/platform/AppController.java |  100 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 100 insertions(+), 0 deletions(-)

diff --git a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/platform/AppController.java b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/platform/AppController.java
new file mode 100644
index 0000000..fe3fcab
--- /dev/null
+++ b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/platform/AppController.java
@@ -0,0 +1,100 @@
+package com.vincent.rsf.openApi.controller.platform;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.vincent.rsf.openApi.entity.app.App;
+import com.vincent.rsf.openApi.entity.dto.CommonResponse;
+import com.vincent.rsf.openApi.service.AppService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * App绠$悊Controller
+ * 
+ * @author vincent
+ * @since 2026-01-04
+ */
+@RestController
+@RequestMapping("/api/app")
+@Api(tags = "搴旂敤绠$悊")
+public class AppController {
+
+    @Autowired
+    private AppService appService;
+
+    @ApiOperation("鍒嗛〉鏌ヨ搴旂敤鍒楄〃")
+    @GetMapping("/page")
+    public CommonResponse page(@RequestParam(defaultValue = "1") Integer current,
+                                @RequestParam(defaultValue = "10") Integer size) {
+        Page<App> page = appService.page(new Page<>(current, size));
+        return CommonResponse.ok().setData(page);
+    }
+
+    @ApiOperation("鏌ヨ鎵�鏈夊簲鐢�")
+    @GetMapping("/list")
+    public CommonResponse list() {
+        List<App> list = appService.list();
+        return CommonResponse.ok().setData(list);
+    }
+
+    @ApiOperation("鏍规嵁ID鏌ヨ搴旂敤")
+    @GetMapping("/{id}")
+    public CommonResponse getById(@PathVariable String id) {
+        App app = appService.getById(id);
+        return CommonResponse.ok().setData(app);
+    }
+
+    @ApiOperation("鏂板搴旂敤")
+    @PostMapping
+    public CommonResponse save(@RequestBody App app) {
+        boolean result = appService.save(app);
+        if (result) {
+            appService.refreshCache();
+            return CommonResponse.ok().setMsg("鏂板鎴愬姛");
+        }
+        return CommonResponse.error("鏂板澶辫触");
+    }
+
+    @ApiOperation("鏇存柊搴旂敤")
+    @PutMapping
+    public CommonResponse update(@RequestBody App app) {
+        boolean result = appService.updateById(app);
+        if (result) {
+            appService.refreshCache();
+            return CommonResponse.ok().setMsg("鏇存柊鎴愬姛");
+        }
+        return CommonResponse.error("鏇存柊澶辫触");
+    }
+
+    @ApiOperation("鍒犻櫎搴旂敤")
+    @DeleteMapping("/{id}")
+    public CommonResponse delete(@PathVariable String id) {
+        boolean result = appService.removeById(id);
+        if (result) {
+            appService.refreshCache();
+            return CommonResponse.ok().setMsg("鍒犻櫎鎴愬姛");
+        }
+        return CommonResponse.error("鍒犻櫎澶辫触");
+    }
+
+    @ApiOperation("鎵归噺鍒犻櫎搴旂敤")
+    @DeleteMapping("/batch")
+    public CommonResponse deleteBatch(@RequestBody List<String> ids) {
+        boolean result = appService.removeByIds(ids);
+        if (result) {
+            appService.refreshCache();
+            return CommonResponse.ok().setMsg("鎵归噺鍒犻櫎鎴愬姛");
+        }
+        return CommonResponse.error("鎵归噺鍒犻櫎澶辫触");
+    }
+
+    @ApiOperation("鍒锋柊搴旂敤缂撳瓨")
+    @PostMapping("/refresh")
+    public CommonResponse refresh() {
+        appService.refreshCache();
+        return CommonResponse.ok().setMsg("缂撳瓨鍒锋柊鎴愬姛");
+    }
+}

--
Gitblit v1.9.1