| | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.dto.request.configParam.CreateConfigParamGroupDTO; |
| | | import com.mzl.flower.dto.request.configParam.ParamGroupDTO; |
| | | import com.mzl.flower.dto.request.configParam.QueryConfigParamDTO; |
| | | import com.mzl.flower.dto.request.configParam.QueryConfigParamGroupDTO; |
| | | import com.mzl.flower.dto.response.configParam.ConfigParamGroupVO; |
| | | import com.mzl.flower.dto.response.configParam.ConfigParamVO; |
| | | import com.mzl.flower.service.ConfigParamGroupService; |
| | | import com.mzl.flower.service.ConfigParamService; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Positive; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private ConfigParamGroupService configParamGroupService; |
| | | |
| | | @PostMapping("") |
| | | |
| | | @PostMapping("/new") |
| | | @ApiOperation(value = "新增", notes = "新增") |
| | | public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody CreateConfigParamGroupDTO dto) { |
| | | public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody ParamGroupDTO dto) { |
| | | configParamGroupService.saveConfigParamGroup(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PutMapping("/{id}") |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public ResponseEntity<ReturnDataDTO> update(@PathVariable Integer id,@Validated @RequestBody CreateConfigParamGroupDTO dto) { |
| | | public ResponseEntity<ReturnDataDTO> update(@Validated @RequestBody ParamGroupDTO dto) { |
| | | configParamGroupService.updateConfigParamGroup(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "删除", notes = "删除") |
| | | public ResponseEntity<ReturnDataDTO> delete(Integer id) { |
| | | @GetMapping(value = "/delete") |
| | | @ApiOperation(value = "删除", httpMethod = "GET", notes = "ID") |
| | | public ResponseEntity<ReturnDataDTO> delete(@NotNull(message = "id不能为空") Long id) { |
| | | configParamGroupService.deleteConfigParamGroup(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @GetMapping("/group/list") |
| | | @ApiOperation(value = "配置查询-列表", notes = "配置查询-列表") |
| | | public ResponseEntity<ReturnDataDTO<Page<ConfigParamGroupVO>>> grouplist(Page page, QueryConfigParamGroupDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), configParamGroupService.queryPage(dto, page)); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public ResponseEntity<ReturnDataDTO> get(@PathVariable(value = "id") @Positive(message = "{id.positive}") Integer id) { |