126 lines
3.5 KiB
Java
126 lines
3.5 KiB
Java
![]() |
package com.ruoyi.web.bst;
|
||
|
|
||
|
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.core.validate.ValidGroup;
|
||
|
import com.ruoyi.common.enums.BusinessType;
|
||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||
|
import com.ruoyi.bst.app.domain.App;
|
||
|
import com.ruoyi.bst.app.domain.AppQuery;
|
||
|
import com.ruoyi.bst.app.domain.AppVO;
|
||
|
import com.ruoyi.bst.app.domain.vo.AppAllVO;
|
||
|
import com.ruoyi.bst.app.service.AppService;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||
|
import org.springframework.validation.annotation.Validated;
|
||
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
||
|
import javax.servlet.http.HttpServletResponse;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* APP信息Controller
|
||
|
*
|
||
|
* @author ruoyi
|
||
|
* @date 2025-01-08
|
||
|
*/
|
||
|
@RestController
|
||
|
@RequestMapping("/bst/app")
|
||
|
public class AppController extends BaseController
|
||
|
{
|
||
|
@Autowired
|
||
|
private AppService appService;
|
||
|
|
||
|
/**
|
||
|
* 查询APP信息列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:list')")
|
||
|
@GetMapping("/list")
|
||
|
public TableDataInfo list(AppQuery query)
|
||
|
{
|
||
|
startPage();
|
||
|
startOrderBy();
|
||
|
List<AppVO> list = appService.selectAppList(query);
|
||
|
return getDataTable(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 查询所有APP信息
|
||
|
* @return
|
||
|
*/
|
||
|
@GetMapping("/all")
|
||
|
public AjaxResult all() {
|
||
|
List<AppAllVO> list = appService.selectAll();
|
||
|
return success(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 根据id集合查询APP信息列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:list')")
|
||
|
@PostMapping("/listByIds")
|
||
|
public AjaxResult listByIds(@RequestBody List<Long> ids)
|
||
|
{
|
||
|
List<AppVO> list = appService.selectByIds(ids);
|
||
|
return success(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 导出APP信息列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:export')")
|
||
|
@Log(title = "APP信息", businessType = BusinessType.EXPORT)
|
||
|
@PostMapping("/export")
|
||
|
public void export(HttpServletResponse response, AppQuery query)
|
||
|
{
|
||
|
List<AppVO> list = appService.selectAppList(query);
|
||
|
ExcelUtil<AppVO> util = new ExcelUtil<AppVO>(AppVO.class);
|
||
|
util.exportExcel(response, list, "APP信息数据");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取APP信息详细信息
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:query')")
|
||
|
@GetMapping(value = "/{id}")
|
||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||
|
{
|
||
|
return success(appService.selectAppById(id));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 新增APP信息
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:add')")
|
||
|
@Log(title = "APP信息", businessType = BusinessType.INSERT)
|
||
|
@PostMapping
|
||
|
public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class) App app)
|
||
|
{
|
||
|
return toAjax(appService.insertApp(app));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 修改APP信息
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:edit')")
|
||
|
@Log(title = "APP信息", businessType = BusinessType.UPDATE)
|
||
|
@PutMapping
|
||
|
public AjaxResult edit(@RequestBody @Validated(ValidGroup.Create.class) App app)
|
||
|
{
|
||
|
return toAjax(appService.updateApp(app));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 删除APP信息
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('bst:app:remove')")
|
||
|
@Log(title = "APP信息", businessType = BusinessType.DELETE)
|
||
|
@DeleteMapping("/{ids}")
|
||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||
|
{
|
||
|
return toAjax(appService.deleteAppByIds(ids));
|
||
|
}
|
||
|
}
|