wks 2 ani în urmă
părinte
comite
2dc7e20ee2

+ 1 - 1
src/main/java/com/ydtech/modules/admin/controller/SysSwitchConfigController.java

@@ -28,7 +28,7 @@ public class SysSwitchConfigController {
         return HttpResult.ok(pageResult);
     }
 
-    @GetMapping
+    @PostMapping
     @ApiOperation(value = "增加")
     public HttpResult<Object> add(@RequestBody SysSwitchConfigVo sysSwitchConfigVo) {
         sysSwitchConfigService.add(sysSwitchConfigVo);

+ 4 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysSwitchConfigServiceImpl.java

@@ -22,6 +22,7 @@ import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -83,6 +84,7 @@ public class SysSwitchConfigServiceImpl extends ServiceImpl<SysSwitchConfigMappe
     }
 
     @Override
+    @Transactional
     public void revise(String id, SysSwitchConfigVo sysSwitchConfigVo) {
         SysSwitchConfig sysSwitchConfig = getByIdExists(id);
         BeanUtils.copyProperties(sysSwitchConfigVo, sysSwitchConfig);
@@ -104,7 +106,8 @@ public class SysSwitchConfigServiceImpl extends ServiceImpl<SysSwitchConfigMappe
                 .like(StringUtil.isNotEmpty(sysSwitchConfigQueryVo.getFunctionName()), SysSwitchConfig::getFunctionName, sysSwitchConfigQueryVo.getFunctionName())
                 .page(page);
 
-        return new BasePageResult<>(sysSwitchConfigQueryVo.getPageNum(), sysSwitchConfigQueryVo.getPageSize(), sysSwitchConfigPage.getTotal(), sysSwitchConfigPage.getPages(), sysSwitchConfigPage.getRecords());
+        return new BasePageResult<>(sysSwitchConfigQueryVo.getPageNum(), sysSwitchConfigQueryVo.getPageSize(),
+                sysSwitchConfigPage.getTotal(), sysSwitchConfigPage.getPages(), sysSwitchConfigPage.getRecords());
     }
 
 }