Kaynağa Gözat

Merge branch 'master' of http://39.98.38.2:13000/dumingliang/sh-model-platform

nanjingliujinyu 6 ay önce
ebeveyn
işleme
6dbcc33944

+ 7 - 2
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceController.java

@@ -65,8 +65,8 @@ public class PtServiceController extends BaseController {
     }
 
     @ApiOperation("根据主键删除数据")
-    @RequestMapping(value = "/delete", method = RequestMethod.GET)
-    public AjaxResult delete(@RequestParam String srvId) {
+    @DeleteMapping("/{srvId}")
+    public AjaxResult delete(@PathVariable String srvId) {
         int ret = 0;
         if (StringUtils.isNotBlank(srvId)) {
             String[] code = srvId.split(",");
@@ -175,4 +175,9 @@ public class PtServiceController extends BaseController {
         return AjaxResult.success(ptServiceService.list(queryWrapper));
     }
 
+    @PutMapping()
+    public AjaxResult put(@RequestBody PtService ptService){
+        return AjaxResult.success(ptServiceService.put(ptService));
+    }
+
 }

+ 4 - 8
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceParamController.java

@@ -31,10 +31,8 @@ public class PtServiceParamController extends BaseController {
 
     @ApiOperation("添加数据")
     @RequestMapping(value = "/add", method = RequestMethod.POST)
-    public AjaxResult insert(PtServiceParam ptServiceParam) {
-        System.out.println(ptServiceParam);
-        int ret = ptServiceParamMapper.insert(ptServiceParam);
-        return AjaxResult.success();
+    public AjaxResult insert(@RequestBody PtServiceParam ptServiceParam) {
+        return AjaxResult.success(ptServiceParamMapper.insert(ptServiceParam));
     }
 
     @ApiOperation("添加数据")
@@ -93,11 +91,9 @@ public class PtServiceParamController extends BaseController {
 
     @ApiOperation("根据主键更新数据")
     @RequestMapping(value = "/update", method = RequestMethod.POST)
-    public AjaxResult update(PtServiceParam ptServiceParam) {
-
-        int ret = ptServiceParamMapper.updateByPrimaryKeySelective(ptServiceParam);
+    public AjaxResult update(@RequestBody PtServiceParam ptServiceParam) {
 
-        return AjaxResult.success();
+        return AjaxResult.success(ptServiceParamMapper.updateByPrimaryKeySelective(ptServiceParam));
     }
 
     @ApiOperation("根据主键删除数据")

+ 2 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/PtServiceService.java

@@ -50,4 +50,6 @@ public interface PtServiceService extends IService<PtService> {
     List<MdModelInfoVo> modelService(MdModelInfoVo par);
 
     List<PtService> selectAllColumns(PtService ptService);
+
+    int put(PtService ptService);
 }

+ 5 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/PtServiceServiceImpl.java

@@ -130,4 +130,9 @@ public class PtServiceServiceImpl extends ServiceImpl<PtServiceMapper, PtService
         return ptServiceMapper.selectAllColumns(ptService);
     }
 
+    @Override
+    public int put(PtService ptService) {
+        return ptServiceMapper.updateByPrimaryKeySelective(ptService);
+    }
+
 }