package com.ruoyi.web.controller.project; import java.util.Arrays; import java.util.List; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.RepeatSubmit; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.project.domain.VServiceDonateorganRegister; import com.ruoyi.project.service.IVServiceDonateorganRegisterService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 器官信息登记新Controller * * @author shenjie * @date 2021-11-11 */ @Api("器官登记管理") @RestController @RequestMapping("/project/register") public class VServiceDonateorganRegisterController extends BaseController { @Autowired private IVServiceDonateorganRegisterService vServiceDonateorganRegisterService; /** * 查询器官信息登记新列表 */ @ApiOperation("获取器官登记列表") //@PreAuthorize("@ss.hasPermi('project:register:list')") @GetMapping("/list") public TableDataInfo list(VServiceDonateorganRegister vServiceDonateorganRegister) { startPage(); List list = vServiceDonateorganRegisterService.queryList(vServiceDonateorganRegister); return getDataTable(list); } /** * 导出器官信息登记新列表 */ @ApiOperation("导出器官登记列表") //@PreAuthorize("@ss.hasPermi('project:register:export')") @Log(title = "器官信息登记新", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(VServiceDonateorganRegister vServiceDonateorganRegister) { List list = vServiceDonateorganRegisterService.queryList(vServiceDonateorganRegister); ExcelUtil util = new ExcelUtil(VServiceDonateorganRegister.class); return util.exportExcel(list, "器官信息登记新数据"); } /** * 获取器官信息登记新详细信息 */ @ApiOperation("通过id获取器官登记信息") //@PreAuthorize("@ss.hasPermi('project:register:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(vServiceDonateorganRegisterService.getById(id)); } /** * 新增器官信息登记新 */ @ApiOperation("新增器官登记") //@PreAuthorize("@ss.hasPermi('project:register:add')") @Log(title = "器官信息登记新", businessType = BusinessType.INSERT) @PostMapping @RepeatSubmit public AjaxResult add(@RequestBody VServiceDonateorganRegister vServiceDonateorganRegister) { return toAjax(vServiceDonateorganRegisterService.save(vServiceDonateorganRegister)); } /** * 修改器官信息登记新 */ @ApiOperation("修改器官登记") //@PreAuthorize("@ss.hasPermi('project:register:edit')") @Log(title = "器官信息登记新", businessType = BusinessType.UPDATE) @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody VServiceDonateorganRegister vServiceDonateorganRegister) { return toAjax(vServiceDonateorganRegisterService.updateById(vServiceDonateorganRegister)); } /** * 删除器官信息登记新 */ @ApiOperation("删除器官登记") //@PreAuthorize("@ss.hasPermi('project:register:remove')") @Log(title = "器官信息登记新", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(vServiceDonateorganRegisterService.removeByIds(Arrays.asList(ids))); } }