102 lines
3.3 KiB
Java
102 lines
3.3 KiB
Java
![]() |
package com.ruoyi.web.bst;
|
||
|
|
||
|
import com.ruoyi.bst.softwareVersion.domain.SoftwareVersion;
|
||
|
import com.ruoyi.bst.softwareVersion.domain.SoftwareVersionQuery;
|
||
|
import com.ruoyi.bst.softwareVersion.domain.SoftwareVersionVO;
|
||
|
import com.ruoyi.bst.softwareVersion.service.SoftwareVersionService;
|
||
|
import com.ruoyi.common.annotation.Log;
|
||
|
import com.ruoyi.common.core.controller.BaseController;
|
||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||
|
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 ruoyi
|
||
|
* @date 2025-04-07
|
||
|
*/
|
||
|
@RestController
|
||
|
@RequestMapping("/bst/softwareVersion")
|
||
|
public class SoftwareVersionController extends BaseController
|
||
|
{
|
||
|
@Autowired
|
||
|
private SoftwareVersionService softwareVersionService;
|
||
|
|
||
|
/**
|
||
|
* 查询软件版本列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:softwareVersion:list')")
|
||
|
@GetMapping("/list")
|
||
|
public TableDataInfo list(SoftwareVersionQuery query)
|
||
|
{
|
||
|
startPage();
|
||
|
startOrderBy();
|
||
|
List<SoftwareVersionVO> list = softwareVersionService.selectSoftwareVersionList(query);
|
||
|
return getDataTable(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 导出软件版本列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:softwareVersion:export')")
|
||
|
@Log(title = "软件版本", businessType = BusinessType.EXPORT)
|
||
|
@PostMapping("/export")
|
||
|
public void export(HttpServletResponse response, SoftwareVersionQuery query)
|
||
|
{
|
||
|
List<SoftwareVersionVO> list = softwareVersionService.selectSoftwareVersionList(query);
|
||
|
ExcelUtil<SoftwareVersionVO> util = new ExcelUtil<SoftwareVersionVO>(SoftwareVersionVO.class);
|
||
|
util.exportExcel(response, list, "软件版本数据");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取软件版本详细信息
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:softwareVersion:query')")
|
||
|
@GetMapping(value = "/{id}")
|
||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||
|
{
|
||
|
return success(softwareVersionService.selectSoftwareVersionById(id));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 新增软件版本
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:softwareVersion:add')")
|
||
|
@Log(title = "软件版本", businessType = BusinessType.INSERT)
|
||
|
@PostMapping
|
||
|
public AjaxResult add(@RequestBody SoftwareVersion softwareVersion)
|
||
|
{
|
||
|
return toAjax(softwareVersionService.insertSoftwareVersion(softwareVersion));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 修改软件版本
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:softwareVersion:edit')")
|
||
|
@Log(title = "软件版本", businessType = BusinessType.UPDATE)
|
||
|
@PutMapping
|
||
|
public AjaxResult edit(@RequestBody SoftwareVersion softwareVersion)
|
||
|
{
|
||
|
return toAjax(softwareVersionService.updateSoftwareVersion(softwareVersion));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 删除软件版本
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:softwareVersion:remove')")
|
||
|
@Log(title = "软件版本", businessType = BusinessType.DELETE)
|
||
|
@DeleteMapping("/{ids}")
|
||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||
|
{
|
||
|
return toAjax(softwareVersionService.deleteSoftwareVersionByIds(ids));
|
||
|
}
|
||
|
}
|