1
13693261870
2024-12-30 fbca82f5994ec49092fb05bc236f0956fecd387c
se-modules/se-system/src/main/java/com/se/system/controller/SysSoftController.java
@@ -1,8 +1,12 @@
package com.se.system.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import com.se.system.service.NacosService;
import org.omg.CORBA.ServerRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -28,10 +32,13 @@
 * @date 2024-11-22
 */
@RestController
@SuppressWarnings("ALL")
@RequestMapping("/soft")
public class SysSoftController extends BaseController
{
    @Autowired
public class SysSoftController extends BaseController {
    @Resource
    NacosService nacosService;
    @Resource
    private ISysSoftService sysSoftService;
    /**
@@ -39,8 +46,7 @@
     */
    @RequiresPermissions("system:soft:list")
    @GetMapping("/list")
    public TableDataInfo list(SysSoft sysSoft)
    {
    public TableDataInfo list(SysSoft sysSoft) {
        startPage();
        List<SysSoft> list = sysSoftService.selectSysSoftList(sysSoft);
        return getDataTable(list);
@@ -52,8 +58,7 @@
    @RequiresPermissions("system:soft:export")
    @Log(title = "软件", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysSoft sysSoft)
    {
    public void export(HttpServletResponse response, SysSoft sysSoft) {
        List<SysSoft> list = sysSoftService.selectSysSoftList(sysSoft);
        ExcelUtil<SysSoft> util = new ExcelUtil<SysSoft>(SysSoft.class);
        util.exportExcel(response, list, "软件数据");
@@ -64,8 +69,7 @@
     */
    @RequiresPermissions("system:soft:query")
    @GetMapping(value = "/{softId}")
    public AjaxResult getInfo(@PathVariable("softId") Long softId)
    {
    public AjaxResult getInfo(@PathVariable("softId") Long softId) {
        return success(sysSoftService.selectSysSoftBySoftId(softId));
    }
@@ -75,8 +79,7 @@
    @RequiresPermissions("system:soft:add")
    @Log(title = "软件", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysSoft sysSoft)
    {
    public AjaxResult add(@RequestBody SysSoft sysSoft) {
        return toAjax(sysSoftService.insertSysSoft(sysSoft));
    }
@@ -86,8 +89,7 @@
    @RequiresPermissions("system:soft:edit")
    @Log(title = "软件", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysSoft sysSoft)
    {
    public AjaxResult edit(@RequestBody SysSoft sysSoft) {
        return toAjax(sysSoftService.updateSysSoft(sysSoft));
    }
@@ -97,8 +99,21 @@
    @RequiresPermissions("system:soft:remove")
    @Log(title = "软件", businessType = BusinessType.DELETE)
   @DeleteMapping("/{softIds}")
    public AjaxResult remove(@PathVariable Long[] softIds)
    {
    public AjaxResult remove(@PathVariable Long[] softIds) {
        return toAjax(sysSoftService.deleteSysSoftBySoftIds(softIds));
    }
    @RequiresPermissions("system:soft:query")
    @GetMapping(value = "getNacosConfig")
    public void getNacosConfig(String dataId, HttpServletRequest req, HttpServletResponse res) {
        try {
            nacosService.getNacosConfig(dataId, req, res);
        } catch (Exception e) {
            try {
                res.getWriter().print(e.getMessage());
            } catch (Exception ex) {
                logger.error(ex.getMessage(), ex);
            }
        }
    }
}