From 2c74e3e18bc372f33fcc2f4ea4ab1d9d393c2753 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 05 三月 2025 11:35:34 +0800
Subject: [PATCH] 补充管理后台文件上传
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OperatorController.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OperatorController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OperatorController.java
index a23961c..58f2605 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OperatorController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OperatorController.java
@@ -4,12 +4,10 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.Operator;
import com.ruoyi.other.service.OperatorService;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import java.util.List;
/**
* @author zhibing.pu
@@ -23,6 +21,34 @@
private OperatorService operatorService;
+
+ /**
+ * 获取运营商数据
+ * @param id
+ * @return
+ */
+ @PostMapping("/getOperatorById")
+ public R<Operator> getOperatorById(@RequestParam("id") Integer id){
+ Operator operator = operatorService.getById(id);
+ return R.ok(operator);
+ }
+
+
+
+ /**
+ * 获取运营商数据
+ * @param name
+ * @return
+ */
+ @PostMapping("/getOperatorByName")
+ public R<Operator> getOperatorByName(@RequestParam("name") String name){
+ Operator operator = operatorService.getOne(new LambdaQueryWrapper<Operator>().eq(Operator::getName, name));
+ return R.ok(operator);
+ }
+
+
+
+
/**
* 获取运营商数据
* @param operatorId
@@ -33,4 +59,28 @@
Operator operator = operatorService.getOne(new LambdaQueryWrapper<Operator>().eq(Operator::getOperatorId, operatorId));
return R.ok(operator);
}
+
+
+
+ /**
+ * 获取所有运营商
+ * @return
+ */
+ @PostMapping("/getAllOperator")
+ public R<List<Operator>> getAllOperator(){
+ List<Operator> list = operatorService.list();
+ return R.ok(list);
+ }
+
+
+
+ /**
+ * 更新运营商数据
+ * @return
+ */
+ @PostMapping("/editOperator")
+ public R editOperator(@RequestBody Operator operator){
+ operatorService.updateById(operator);
+ return R.ok();
+ }
}
--
Gitblit v1.7.1