package com.ruoyi.web.controller.project; 
 | 
  
 | 
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.core.page.TableDataInfo; 
 | 
import com.ruoyi.common.enums.BusinessType; 
 | 
import com.ruoyi.common.utils.poi.ExcelUtil; 
 | 
import com.ruoyi.project.domain.ServiceDonateorganstatics; 
 | 
import com.ruoyi.project.service.IServiceDonateorganstaticsService; 
 | 
import io.swagger.annotations.Api; 
 | 
import io.swagger.annotations.ApiOperation; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.security.access.prepost.PreAuthorize; 
 | 
import org.springframework.web.bind.annotation.*; 
 | 
  
 | 
import java.util.Arrays; 
 | 
import java.util.List; 
 | 
  
 | 
/** 
 | 
 * 捐献案例器官列Controller 
 | 
 * 
 | 
 * @author ruoyi 
 | 
 * @date 2023-12-27 
 | 
 */ 
 | 
@Api("捐献案例器官列") 
 | 
@RestController 
 | 
@RequestMapping("/project/donateorganstatics") 
 | 
public class ServiceDonateorganstaticsController extends BaseController { 
 | 
    @Autowired 
 | 
    private IServiceDonateorganstaticsService serviceDonateorganstaticsService; 
 | 
  
 | 
    /** 
 | 
     * 查询捐献案例器官列列表 
 | 
     */ 
 | 
    @ApiOperation("查询捐献案例器官列列表") 
 | 
    // @PreAuthorize("@ss.hasPermi('project:donateorganstatics:list')") 
 | 
    @GetMapping("/list") 
 | 
    public TableDataInfo list(ServiceDonateorganstatics serviceDonateorganstatics) { 
 | 
        startPage(); 
 | 
        List<ServiceDonateorganstatics> list = serviceDonateorganstaticsService.queryList(serviceDonateorganstatics); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出捐献案例器官列列表 
 | 
     */ 
 | 
    @ApiOperation("导出捐献案例器官列列表") 
 | 
    // @PreAuthorize("@ss.hasPermi('project:donateorganstatics:export')") 
 | 
    @Log(title = "捐献案例器官列", businessType = BusinessType.EXPORT) 
 | 
    @GetMapping("/export") 
 | 
    public AjaxResult export(ServiceDonateorganstatics serviceDonateorganstatics) { 
 | 
        List<ServiceDonateorganstatics> list = serviceDonateorganstaticsService.queryList(serviceDonateorganstatics); 
 | 
        ExcelUtil<ServiceDonateorganstatics> util = new ExcelUtil<ServiceDonateorganstatics>(ServiceDonateorganstatics.class); 
 | 
        return util.exportExcel(list, "捐献案例器官列数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取捐献案例器官列详细信息 
 | 
     */ 
 | 
    @ApiOperation("获取捐献案例器官列详细信息") 
 | 
    // @PreAuthorize("@ss.hasPermi('project:donateorganstatics:query')") 
 | 
    @GetMapping(value = "/getInfo/{id}") 
 | 
    public AjaxResult getInfo(@PathVariable("id") Long id) { 
 | 
        return AjaxResult.success(serviceDonateorganstaticsService.getById(id)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增捐献案例器官列 
 | 
     */ 
 | 
    @ApiOperation("新增捐献案例器官列") 
 | 
    // @PreAuthorize("@ss.hasPermi('project:donateorganstatics:add')") 
 | 
    @Log(title = "捐献案例器官列", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    @RepeatSubmit 
 | 
    public AjaxResult add(@RequestBody ServiceDonateorganstatics serviceDonateorganstatics) { 
 | 
        boolean save = serviceDonateorganstaticsService.save(serviceDonateorganstatics); 
 | 
        return AjaxResult.success(serviceDonateorganstatics); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改捐献案例器官列 
 | 
     */ 
 | 
    @ApiOperation("修改捐献案例器官列") 
 | 
    // @PreAuthorize("@ss.hasPermi('project:donateorganstatics:edit')") 
 | 
    @Log(title = "捐献案例器官列", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    @RepeatSubmit 
 | 
    public AjaxResult edit(@RequestBody ServiceDonateorganstatics serviceDonateorganstatics) { 
 | 
        return toAjax(serviceDonateorganstaticsService.updateById(serviceDonateorganstatics)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除捐献案例器官列 
 | 
     */ 
 | 
    @ApiOperation("删除捐献案例器官列") 
 | 
    // @PreAuthorize("@ss.hasPermi('project:donateorganstatics:remove')") 
 | 
    @Log(title = "捐献案例器官列", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{ids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] ids) { 
 | 
        return toAjax(serviceDonateorganstaticsService.removeByIds(Arrays.asList(ids))); 
 | 
    } 
 | 
} 
 |