| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.projectManagement.dto.UpdateStateInfo; |
| | | import com.ruoyi.projectManagement.service.InfoService; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | |
| | | private final InfoService infoService; |
| | | |
| | | @PostMapping("/save") |
| | | @ApiOperation("保存") |
| | | public AjaxResult save(@RequestBody @Valid SaveInfoVo saveInfoVo) { |
| | | infoService.save(saveInfoVo); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/updateStatus") |
| | | @ApiOperation("修改状态") |
| | | public AjaxResult updateStatus(@RequestBody @Valid UpdateStateInfo updateStateInfo){ |
| | | infoService.updateStatus(updateStateInfo); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | @ApiOperation("删除") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | infoService.deleteInfo(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/listPage") |
| | | @ApiOperation("分页列表") |
| | | public AjaxResult listPage(@RequestBody @Valid SearchInfoVo vo) { |
| | | return AjaxResult.success(infoService.searchListInfo(vo)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/{id}") |
| | | @ApiOperation("详情") |
| | | public AjaxResult getInfoById(@PathVariable Long id) { |
| | | return AjaxResult.success(infoService.getInfoById(id)); |
| | | } |
| | | |
| | | |
| | | } |