wzp
2025-05-08 077b5ea7955e39f949e9c869602e3ddf8f400114
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package com.ruoyi.web.controller.system;
 
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysGpsConfig;
import com.ruoyi.system.service.IGpsConfigService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.SecurityUtils;
 
/**
 * GPS配置Controller
 */
@RestController
@RequestMapping("/system/gpsconfig")
public class SysGpsConfigController extends BaseController {
    @Autowired
    private IGpsConfigService gpsConfigService;
 
    /**
     * 查询GPS配置列表
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysGpsConfig gpsConfig) {
        startPage();
        List<SysGpsConfig> list = gpsConfigService.selectGpsConfigList(gpsConfig);
        return getDataTable(list);
    }
 
    /**
     * 导出GPS配置列表
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:export')")
    @Log(title = "GPS配置", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysGpsConfig gpsConfig) {
        List<SysGpsConfig> list = gpsConfigService.selectGpsConfigList(gpsConfig);
        ExcelUtil<SysGpsConfig> util = new ExcelUtil<SysGpsConfig>(SysGpsConfig.class);
        util.exportExcel(response, list, "GPS配置数据");
    }
 
    /**
     * 获取GPS配置详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:query')")
    @GetMapping(value = "/{configId}")
    public AjaxResult getInfo(@PathVariable("configId") Long configId) {
        return success(gpsConfigService.selectGpsConfigById(configId));
    }
 
    /**
     * 新增GPS配置
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:add')")
    @Log(title = "GPS配置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysGpsConfig gpsConfig) {
        gpsConfig.setCreateBy(SecurityUtils.getUsername());
        gpsConfig.setUpdateBy(SecurityUtils.getUsername());
        return toAjax(gpsConfigService.insertGpsConfig(gpsConfig));
    }
 
    /**
     * 修改GPS配置
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:edit')")
    @Log(title = "GPS配置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysGpsConfig gpsConfig) {
        gpsConfig.setUpdateBy(SecurityUtils.getUsername());
        return toAjax(gpsConfigService.updateGpsConfig(gpsConfig));
    }
 
    /**
     * 删除GPS配置
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:remove')")
    @Log(title = "GPS配置", businessType = BusinessType.DELETE)
    @DeleteMapping("/{configIds}")
    public AjaxResult remove(@PathVariable Long[] configIds) {
        return toAjax(gpsConfigService.deleteGpsConfigByIds(configIds));
    }
 
    /**
     * 获取有效的token
     */
    @PreAuthorize("@ss.hasPermi('system:gpsconfig:query')")
    @GetMapping("/token/{configKey}")
    public AjaxResult getValidToken(@PathVariable("configKey") String configKey) {
        return success(gpsConfigService.getValidToken(configKey));
    }