| @@ -5,10 +5,10 @@ import com.ruoyi.common.core.web.domain.GenericsAjaxResult; | |||
| import com.ruoyi.platform.domain.CodeConfig; | |||
| import com.ruoyi.platform.service.CodeConfigService; | |||
| import io.swagger.annotations.Api; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.data.domain.Page; | |||
| import org.springframework.data.domain.PageRequest; | |||
| import org.springframework.http.ResponseEntity; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.annotation.Resource; | |||
| @@ -22,16 +22,17 @@ public class CodeConfigController extends BaseController { | |||
| /** | |||
| * 分页查询 | |||
| * | |||
| * @param codeConfig 筛选条件 | |||
| * @param page 页数 | |||
| * @param size 每页大小 | |||
| * @param page 页数 | |||
| * @param size 每页大小 | |||
| * @return 查询结果 | |||
| */ | |||
| @GetMapping | |||
| public GenericsAjaxResult<Page<CodeConfig>> queryByPage( @RequestParam("page")int page, | |||
| @RequestParam("size") int size, | |||
| @RequestParam(value = "code_repo_name") String codeRepoName) { | |||
| PageRequest pageRequest = PageRequest.of(page,size); | |||
| public GenericsAjaxResult<Page<CodeConfig>> queryByPage(@RequestParam("page") int page, | |||
| @RequestParam("size") int size, | |||
| @RequestParam(value = "code_repo_name", required = false) String codeRepoName) { | |||
| PageRequest pageRequest = PageRequest.of(page, size); | |||
| CodeConfig codeConfig = new CodeConfig(); | |||
| codeConfig.setCodeRepoName(codeRepoName); | |||
| return genericsSuccess(this.codeConfigService.queryByPage(codeConfig, pageRequest)); | |||
| @@ -39,6 +40,7 @@ public class CodeConfigController extends BaseController { | |||
| /** | |||
| * 通过主键查询单条数据 | |||
| * | |||
| * @param id | |||
| * @return 单条数据 | |||
| */ | |||
| @@ -49,17 +51,17 @@ public class CodeConfigController extends BaseController { | |||
| @PostMapping | |||
| public GenericsAjaxResult<CodeConfig> add(@RequestBody CodeConfig codeConfig){ | |||
| public GenericsAjaxResult<CodeConfig> add(@RequestBody CodeConfig codeConfig) { | |||
| return genericsSuccess(this.codeConfigService.insert(codeConfig)); | |||
| } | |||
| @PutMapping | |||
| public GenericsAjaxResult<CodeConfig> update(@RequestBody CodeConfig codeConfig){ | |||
| public GenericsAjaxResult<CodeConfig> update(@RequestBody CodeConfig codeConfig) { | |||
| return genericsSuccess(this.codeConfigService.update(codeConfig)); | |||
| } | |||
| @DeleteMapping("{id}") | |||
| public GenericsAjaxResult<String> delete(@PathVariable("id") Long id){ | |||
| public GenericsAjaxResult<String> delete(@PathVariable("id") Long id) { | |||
| return genericsSuccess(this.codeConfigService.removeById(id)); | |||
| } | |||
| } | |||