|
|
@@ -10,13 +10,7 @@ import com.sqx.modules.lovers.service.LoversSetRuleService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
@@ -43,14 +37,14 @@ public class LoversSetRuleController {
|
|
|
|
|
|
@PostMapping("add")
|
|
|
@ApiOperation("新增情侣套餐规则")
|
|
|
- public Result add(@Valid LoversSetRuleDTO loversSetRule) {
|
|
|
+ public Result add(@Valid @RequestBody LoversSetRuleDTO loversSetRule) {
|
|
|
loversSetRuleService.add(loversSetRule);
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
@PutMapping("update")
|
|
|
@ApiOperation("修改情侣套餐规则")
|
|
|
- public Result update(@Valid LoversSetRuleDTO loversSetRule) {
|
|
|
+ public Result update(@Valid @RequestBody LoversSetRuleDTO loversSetRule) {
|
|
|
if (ObjectUtil.isNull(loversSetRule.getId())) {
|
|
|
throw new SqxException("规则ID不能为空");
|
|
|
}
|
|
|
@@ -59,7 +53,7 @@ public class LoversSetRuleController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- @DeleteMapping("{id}")
|
|
|
+ @DeleteMapping("delete/{id}")
|
|
|
@ApiOperation("删除情侣套餐规则")
|
|
|
public Result delete(@PathVariable String id) {
|
|
|
loversSetRuleService.removeById(id);
|