|
@@ -0,0 +1,58 @@
|
|
|
+package com.huimv.admin.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.huimv.admin.entity.ProdFarmName;
|
|
|
+import com.huimv.admin.service.IProdFarmNameService;
|
|
|
+import com.huimv.common.token.TokenSign;
|
|
|
+import com.huimv.common.utils.Result;
|
|
|
+import com.huimv.common.utils.ResultCode;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author astupidcoder
|
|
|
+ * @since 2021-11-20
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/prodFarmName")
|
|
|
+public class ProdFarmNameController {
|
|
|
+ @Autowired
|
|
|
+ IProdFarmNameService farmNameService;
|
|
|
+
|
|
|
+ @GetMapping("/updatName")
|
|
|
+ public Result updatName(){
|
|
|
+ farmNameService.updatName();
|
|
|
+ return new Result(10000,"同步成功",true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/add")
|
|
|
+ public Result add(@RequestBody ProdFarmName farm){
|
|
|
+ farmNameService.save(farm);
|
|
|
+ return new Result(10000,"添加成功",true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/edit")
|
|
|
+ public Result edit(@RequestBody ProdFarmName farm){
|
|
|
+
|
|
|
+ farmNameService.updateById(farm);
|
|
|
+ return new Result(10000,"修改成功",true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/remove")
|
|
|
+ public Result remove(@RequestParam(name = "ids") List<Integer> ids){
|
|
|
+ farmNameService.removeByIds(ids);
|
|
|
+ return new Result(10000,"删除成功",true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/listFarmName")
|
|
|
+ public Result listFarmName(){
|
|
|
+ return new Result(ResultCode.SUCCESS,farmNameService.list());
|
|
|
+ }
|
|
|
+}
|