|  |  | 
 |  |  | package com.ruoyi.project.controller; | 
 |  |  | 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 lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
 |  |  | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 捐献附件Controller | 
 |  |  |  *  | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2022-04-08 | 
 |  |  |  */ | 
 |  |  | @Slf4j | 
 |  |  | @Api("捐献附件") | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/project/documentfiles") | 
 |  |  | public class ServiceDocumentfilesController extends BaseController | 
 |  |  | { | 
 |  |  | public class ServiceDocumentfilesController extends BaseController { | 
 |  |  |     @Autowired | 
 |  |  |     private IServiceDocumentfilesService serviceDocumentfilesService; | 
 |  |  |  | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("查询捐献附件列表") | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     public TableDataInfo list(ServiceDocumentfiles serviceDocumentfiles) | 
 |  |  |     { | 
 |  |  |     public TableDataInfo list(ServiceDocumentfiles serviceDocumentfiles) { | 
 |  |  |         log.info("查询捐献附件列表:{}", serviceDocumentfiles); | 
 |  |  |         startPage(); | 
 |  |  |         //List<ServiceDocumentfiles> list = serviceDocumentfilesService.queryList(serviceDocumentfiles); | 
 |  |  |         List<ServiceDocumentfiles> list = serviceDocumentfilesService.selectList(serviceDocumentfiles); | 
 |  |  | 
 |  |  |     @ApiOperation("导出捐献附件列表") | 
 |  |  |     @Log(title = "捐献附件", businessType = BusinessType.EXPORT) | 
 |  |  |     @GetMapping("/export") | 
 |  |  |     public AjaxResult export(ServiceDocumentfiles serviceDocumentfiles) | 
 |  |  |     { | 
 |  |  |     public AjaxResult export(ServiceDocumentfiles serviceDocumentfiles) { | 
 |  |  |         log.info("导出捐献附件列表:{}", serviceDocumentfiles); | 
 |  |  |         List<ServiceDocumentfiles> list = serviceDocumentfilesService.queryList(serviceDocumentfiles); | 
 |  |  |         ExcelUtil<ServiceDocumentfiles> util = new ExcelUtil<ServiceDocumentfiles>(ServiceDocumentfiles.class); | 
 |  |  |         return util.exportExcel(list, "捐献附件数据"); | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("获取捐献附件详细信息") | 
 |  |  |     @GetMapping(value = "/{id}") | 
 |  |  |     public AjaxResult getInfo(@PathVariable("id") Long id) | 
 |  |  |     { | 
 |  |  |     public AjaxResult getInfo(@PathVariable("id") Long id) { | 
 |  |  |         log.info("获取捐献附件详细信息:{}", id); | 
 |  |  |         return AjaxResult.success(serviceDocumentfilesService.getById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增捐献附件") | 
 |  |  |     @Log(title = "捐献附件", businessType = BusinessType.INSERT) | 
 |  |  |     @PostMapping | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     @RepeatSubmit | 
 |  |  |     public AjaxResult add(@RequestBody ServiceDocumentfiles serviceDocumentfiles) | 
 |  |  |     { | 
 |  |  |         return toAjax(serviceDocumentfilesService.save(serviceDocumentfiles)); | 
 |  |  |     public AjaxResult add(@RequestBody ServiceDocumentfiles serviceDocumentfiles) { | 
 |  |  |         log.info("新增捐献附件:{}", serviceDocumentfiles); | 
 |  |  |         boolean save = serviceDocumentfilesService.save(serviceDocumentfiles); | 
 |  |  |         log.info("新增捐献附件serviceDocumentfiles的id:{}", serviceDocumentfiles.getId()); | 
 |  |  |         return AjaxResult.success(serviceDocumentfiles); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |     @ApiOperation("修改捐献附件") | 
 |  |  |     @Log(title = "捐献附件", businessType = BusinessType.UPDATE) | 
 |  |  |     @PostMapping("/edit") | 
 |  |  |     @RepeatSubmit     | 
 |  |  |     public AjaxResult edit(@RequestBody ServiceDocumentfiles serviceDocumentfiles) | 
 |  |  |     { | 
 |  |  |     @RepeatSubmit | 
 |  |  |     public AjaxResult edit(@RequestBody ServiceDocumentfiles serviceDocumentfiles) { | 
 |  |  |         log.info("修改捐献附件:{}", serviceDocumentfiles); | 
 |  |  |         return toAjax(serviceDocumentfilesService.updateById(serviceDocumentfiles)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation("删除捐献附件") | 
 |  |  |     @Log(title = "捐献附件", businessType = BusinessType.DELETE) | 
 |  |  |     @GetMapping("/remove/{ids}") | 
 |  |  |     public AjaxResult remove(@PathVariable Long[] ids) | 
 |  |  |     { | 
 |  |  |     public AjaxResult remove(@PathVariable Long[] ids) { | 
 |  |  |         log.info("删除捐献附件:{}", ids); | 
 |  |  |         return toAjax(serviceDocumentfilesService.removeByIds(Arrays.asList(ids))); | 
 |  |  |     } | 
 |  |  | } |