You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.4 KiB
105 lines
3.4 KiB
|
3 months ago
|
package com.ruoyi.system.controller;
|
||
|
|
|
||
|
|
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.Routes;
|
||
|
|
import com.ruoyi.system.service.IRoutesService;
|
||
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 实体部署与航线Controller
|
||
|
|
*
|
||
|
|
* @author ruoyi
|
||
|
|
* @date 2026-01-14
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/system/routes")
|
||
|
|
public class RoutesController extends BaseController
|
||
|
|
{
|
||
|
|
@Autowired
|
||
|
|
private IRoutesService routesService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询实体部署与航线列表
|
||
|
|
*/
|
||
|
|
@PreAuthorize("@ss.hasPermi('system:routes:list')")
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo list(Routes routes)
|
||
|
|
{
|
||
|
|
startPage();
|
||
|
|
List<Routes> list = routesService.selectRoutesList(routes);
|
||
|
|
return getDataTable(list);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出实体部署与航线列表
|
||
|
|
*/
|
||
|
|
@PreAuthorize("@ss.hasPermi('system:routes:export')")
|
||
|
|
@Log(title = "实体部署与航线", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(HttpServletResponse response, Routes routes)
|
||
|
|
{
|
||
|
|
List<Routes> list = routesService.selectRoutesList(routes);
|
||
|
|
ExcelUtil<Routes> util = new ExcelUtil<Routes>(Routes.class);
|
||
|
|
util.exportExcel(response, list, "实体部署与航线数据");
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取实体部署与航线详细信息
|
||
|
|
*/
|
||
|
|
@PreAuthorize("@ss.hasPermi('system:routes:query')")
|
||
|
|
@GetMapping(value = "/{id}")
|
||
|
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||
|
|
{
|
||
|
|
return success(routesService.selectRoutesById(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增实体部署与航线
|
||
|
|
*/
|
||
|
|
@PreAuthorize("@ss.hasPermi('system:routes:add')")
|
||
|
|
@Log(title = "实体部署与航线", businessType = BusinessType.INSERT)
|
||
|
|
@PostMapping
|
||
|
|
public AjaxResult add(@RequestBody Routes routes)
|
||
|
|
{
|
||
|
|
return toAjax(routesService.insertRoutes(routes));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改实体部署与航线
|
||
|
|
*/
|
||
|
|
@PreAuthorize("@ss.hasPermi('system:routes:edit')")
|
||
|
|
@Log(title = "实体部署与航线", businessType = BusinessType.UPDATE)
|
||
|
|
@PutMapping
|
||
|
|
public AjaxResult edit(@RequestBody Routes routes)
|
||
|
|
{
|
||
|
|
return toAjax(routesService.updateRoutes(routes));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除实体部署与航线
|
||
|
|
*/
|
||
|
|
@PreAuthorize("@ss.hasPermi('system:routes:remove')")
|
||
|
|
@Log(title = "实体部署与航线", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{ids}")
|
||
|
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||
|
|
{
|
||
|
|
return toAjax(routesService.deleteRoutesByIds(ids));
|
||
|
|
}
|
||
|
|
}
|