package com.ycl.platform.controller;
|
|
import annotation.Log;
|
import com.ycl.platform.domain.entity.ImageResourceSecurity;
|
import com.ycl.platform.service.IImageResourceSecurityService;
|
import com.ycl.system.AjaxResult;
|
import com.ycl.system.controller.BaseController;
|
import com.ycl.system.page.TableDataInfo;
|
import enumeration.BusinessType;
|
import jakarta.servlet.http.HttpServletResponse;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import java.util.List;
|
|
/**
|
* platformController
|
*
|
* @author flq
|
* @date 2024-08-24
|
*/
|
@RestController
|
@RequestMapping("/platform/resourceSecurity")
|
public class ImageResourceSecurityController extends BaseController
|
{
|
@Autowired
|
private IImageResourceSecurityService imageResourceSecurityService;
|
|
/**
|
* 查询platform列表
|
*/
|
@PreAuthorize("@ss.hasPermi('imageResource:security:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(ImageResourceSecurity imageResourceSecurity)
|
{
|
List<ImageResourceSecurity> list = imageResourceSecurityService.selectImageResourceSecurityList(imageResourceSecurity);
|
return getDataTable(list);
|
}
|
|
/**
|
* 获取platform详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('imageResource:security:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
{
|
return success(imageResourceSecurityService.selectImageResourceSecurityById(id));
|
}
|
|
/**
|
* 修改platform
|
*/
|
@PreAuthorize("@ss.hasPermi('platform:security:edit')")
|
@Log(title = "platform", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody ImageResourceSecurity imageResourceSecurity)
|
{
|
return toAjax(imageResourceSecurityService.updateImageResourceSecurity(imageResourceSecurity));
|
}
|
|
/**
|
* 导入模板
|
*/
|
@PreAuthorize("@ss.hasPermi('imageResource:security:template')")
|
@Log(title = "导入模板", businessType = BusinessType.IMPORT)
|
@PostMapping("/importTemplate")
|
public void importTemplate(HttpServletResponse response) {
|
imageResourceSecurityService.importTemplate(response);
|
}
|
|
/**
|
* 导入数据
|
*/
|
@PreAuthorize("@ss.hasPermi('imageResource:security:import')")
|
@Log(title = "导入", businessType = BusinessType.IMPORT)
|
@PostMapping("/importData")
|
public AjaxResult importData(MultipartFile file) {
|
return toAjax(imageResourceSecurityService.importData(file));
|
}
|
|
}
|