package org.springblade.modules.apply.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.modules.apply.entity.ExamPayment; import org.springblade.modules.apply.service.ExamPaymentService; import org.springblade.modules.apply.vo.ExamPaymentVO; import org.springframework.web.bind.annotation.*; /** * @author zhongrj * @time 2021-07-22 * @desc 考试缴费管理控制层 */ @RestController @AllArgsConstructor @RequestMapping("/examPayment") public class ExamPaymentController { private final ExamPaymentService examPaymentService; /** * 自定义分页 * @param query page,size * @param examPayment 考试缴费信息对象 */ @GetMapping("/page") public R> page(ExamPaymentVO examPayment, Query query) { IPage pages = examPaymentService.selectExamPaymentPage(Condition.getPage(query), examPayment); return R.data(pages); } /** * 分页 */ @GetMapping("/list") public R> list(ExamPayment examPayment, Query query) { IPage pages = examPaymentService.page(Condition.getPage(query), Condition.getQueryWrapper(examPayment)); return R.data(pages); } /** * 新增 * @param examPayment 考试缴费信息对象 */ @PostMapping("/save") @ApiOperation(value = "新增", notes = "传入examPayment") public R save(@RequestBody ExamPayment examPayment) { return R.status(examPaymentService.save(examPayment)); } /** * 修改 * @param examPayment 考试缴费信息对象 */ @PostMapping("/update") public R update(@RequestBody ExamPayment examPayment) { return R.status(examPaymentService.updateById(examPayment)); } /** * 新增或修改 * @param examPayment 考试缴费信息对象 */ @PostMapping("/submit") public R submit(@RequestBody ExamPayment examPayment) { return R.status(examPaymentService.saveOrUpdate(examPayment)); } /** * 删除 * @param ids 考试缴费信息ids 数组 */ @PostMapping("/remove") public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { return R.status(examPaymentService.removeByIds(Func.toLongList(ids))); } /** * 详情 * @param examPayment 考试缴费信息对象 */ @GetMapping("/detail") @ApiOperation(value = "详情", notes = "传入examPayment") public R details(ExamPayment examPayment) { //查询考试缴费详情 ExamPaymentVO detail = examPaymentService.selectExamPaymentInfo(examPayment); //返回 return R.data(detail); } }