feat(路段分组控制层创建):
This commit is contained in:
parent
1b058afb9a
commit
3606c978bf
|
@ -0,0 +1,89 @@
|
||||||
|
package com.ruoyi.web.controller.board;
|
||||||
|
|
||||||
|
import com.ruoyi.board.domain.RoadGroup;
|
||||||
|
import com.ruoyi.board.service.IRoadGroupService;
|
||||||
|
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.common.utils.poi.ExcelUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路段分组Controller
|
||||||
|
*
|
||||||
|
* @author fuhao
|
||||||
|
* @date 2024-09-03
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/road/group")
|
||||||
|
public class RoadGroupController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IRoadGroupService roadGroupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询路段分组列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('road:group:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(RoadGroup roadGroup) {
|
||||||
|
List<RoadGroup> list = roadGroupService.list();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出路段分组列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('road:group:export')")
|
||||||
|
@Log(title = "路段分组", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, RoadGroup roadGroup) {
|
||||||
|
List<RoadGroup> list = roadGroupService.list();
|
||||||
|
ExcelUtil<RoadGroup> util = new ExcelUtil<RoadGroup>(RoadGroup.class);
|
||||||
|
util.exportExcel(response, list, "路段分组数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取路段分组详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('road:group:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return success(roadGroupService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增路段分组
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('road:group:add')")
|
||||||
|
@Log(title = "路段分组", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody RoadGroup roadGroup) {
|
||||||
|
return toAjax(roadGroupService.save(roadGroup));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改路段分组
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('road:group:edit')")
|
||||||
|
@Log(title = "路段分组", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody RoadGroup roadGroup) {
|
||||||
|
return toAjax(roadGroupService.saveOrUpdate(roadGroup));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除路段分组
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('road:group:remove')")
|
||||||
|
@Log(title = "路段分组", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||||
|
return toAjax(roadGroupService.removeByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue