| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.entity.CodeButtonEntity; |
| | | import com.vci.ubcs.code.entity.CodeButton; |
| | | import com.vci.ubcs.code.mapper.CodeButtonMapper; |
| | | import com.vci.ubcs.code.service.ICodeButtonService; |
| | | import com.vci.ubcs.code.vo.CodeButtonVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeButtonVO; |
| | | import com.vci.ubcs.code.wrapper.CodeButtonWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入codebutton") |
| | | public R<CodeButtonVO> detail(CodeButtonEntity codebutton) { |
| | | CodeButtonEntity detail = codeButtonMapper.selectOne(Condition.getQueryWrapper(codebutton)); |
| | | public R<CodeButtonVO> detail(CodeButton codebutton) { |
| | | CodeButton detail = codeButtonMapper.selectOne(Condition.getQueryWrapper(codebutton)); |
| | | return R.data(CodeButtonWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入codebutton") |
| | | public R<IPage<CodeButtonVO>> list(CodeButtonEntity codebutton, Query query) { |
| | | IPage<CodeButtonEntity> pages = codeButtonMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(codebutton)); |
| | | public R<IPage<CodeButtonVO>> list(CodeButton codebutton, Query query) { |
| | | IPage<CodeButton> pages = codeButtonMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(codebutton)); |
| | | return R.data(CodeButtonWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入codebutton") |
| | | public R save(@Valid @RequestBody CodeButtonEntity codebutton) { |
| | | public R save(@Valid @RequestBody CodeButton codebutton) { |
| | | return R.status(SqlHelper.retBool(codeButtonMapper.insert(codebutton))); |
| | | } |
| | | |
| | |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入codebutton") |
| | | public R update(@Valid @RequestBody CodeButtonEntity codebutton) { |
| | | public R update(@Valid @RequestBody CodeButton codebutton) { |
| | | return R.status(SqlHelper.retBool(codeButtonMapper.updateById(codebutton))); |
| | | } |
| | | |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入codebutton") |
| | | public R submit(@Valid @RequestBody CodeButtonEntity codebutton) { |
| | | public R submit(@Valid @RequestBody CodeButton codebutton) { |
| | | if(codebutton.getOid() != null){ |
| | | return R.status(SqlHelper.retBool(codeButtonMapper.updateById(codebutton))); |
| | | } |