fuliqi
2024-09-04 cc511acb919f842e95c2f6027f4fc4429c7b7b1a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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));
    }
 
}