| | |
| | | */ |
| | | package org.springblade.jfpt.healthcode.controller; |
| | | |
| | | import com.alibaba.nacos.common.utils.JacksonUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.jfpt.healthcode.entity.healthcode; |
| | | import org.springblade.jfpt.healthcode.entity.Healthcode; |
| | | import org.springblade.jfpt.healthcode.service.IhealthcodeService; |
| | | import org.springblade.jfpt.healthcode.vo.healthcodeVO; |
| | | import org.springblade.jfpt.healthcode.vo.HealthcodeVO; |
| | | import org.springblade.jfpt.healthcode.wrapper.healthcodeWrapper; |
| | | import org.springblade.jfpt.parcel.util.JacksonUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入lx") |
| | | public R<healthcodeVO> detail(healthcode healthcode) { |
| | | healthcode detail = ihealthcodeService.getOne(Condition.getQueryWrapper(healthcode)); |
| | | public R<HealthcodeVO> detail(Healthcode healthcode) { |
| | | Healthcode detail = ihealthcodeService.getOne(Condition.getQueryWrapper(healthcode)); |
| | | return R.data(healthcodeWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入lx") |
| | | public R<IPage<healthcodeVO>> list(healthcode healthcode, Query query) { |
| | | IPage<healthcode> pages = ihealthcodeService.page(Condition.getPage(query), Condition.getQueryWrapper(healthcode)); |
| | | public R<IPage<HealthcodeVO>> list(Healthcode healthcode, Query query) { |
| | | IPage<Healthcode> pages = ihealthcodeService.page(Condition.getPage(query), Condition.getQueryWrapper(healthcode)); |
| | | return R.data(healthcodeWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 自定义健康码分页/健康码统计图表点击事件 |
| | | * @param healthcodeVO 健康码对象 |
| | | * @param query 分页对象(页码) |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "自定义分页", notes = "传入lx") |
| | | public R<IPage<Healthcode>> page(HealthcodeVO healthcodeVO, Query query) { |
| | | return R.data(ihealthcodeService.selectHealthcodeListPage(Condition.getPage(query),healthcodeVO)); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入lx") |
| | | public R save(@Valid @RequestBody healthcode healthcode) { |
| | | public R save(@Valid @RequestBody Healthcode healthcode) { |
| | | return R.status(ihealthcodeService.save(healthcode)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入lx") |
| | | public R update(@Valid @RequestBody healthcode healthcode) { |
| | | public R update(@Valid @RequestBody Healthcode healthcode) { |
| | | return R.status(ihealthcodeService.updateById(healthcode)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入lx") |
| | | public R submit(@Valid @RequestBody healthcode healthcode) { |
| | | public R submit(@Valid @RequestBody Healthcode healthcode) { |
| | | return R.status(ihealthcodeService.saveOrUpdate(healthcode)); |
| | | } |
| | | |