1
This commit is contained in:
1 parent
cf9c801b93
commit
f0b438eb6c
8 files changed
+158
-89
No files matched your search
@@ -1,98 +1,92 @@
|
||||
package com.ruoyi.system.controller;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import java.util.List;
|
||||
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.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.Apps;
|
||||
import com.ruoyi.system.domain.AppsPlus;
|
||||
import com.ruoyi.system.service.IAppsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 应用管理Controller
|
||||
*
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2025-11-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/apps")
|
||||
public class AppsController extends BaseController
|
||||
{
|
||||
public class AppsController extends BaseController {
|
||||
@Autowired
|
||||
private IAppsService appsService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<AppsPlus> list = appsService.getByIds(ids.getLongIds(),false,AppsPlus::getName,AppsPlus::getId);
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<AppsPlus> list = appsService.getByIds(ids.getLongIds(), false, AppsPlus::getName, AppsPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-getByIds')")
|
||||
@PostMapping("/user/getByIds")
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<AppsPlus> list = appsService.getByIds(ids.getLongIds(),true,AppsPlus::getName,AppsPlus::getUserId,AppsPlus::getId);
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids) {
|
||||
List<AppsPlus> list = appsService.getByIds(ids.getLongIds(), true, AppsPlus::getName, AppsPlus::getUserId, AppsPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = appsService.select(keyword,false);
|
||||
public AjaxResult select(String keyword) {
|
||||
List<SelectItem> list = appsService.select(keyword, false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-select')")
|
||||
@GetMapping("/user/select")
|
||||
public AjaxResult userSelect(String keyword)
|
||||
{
|
||||
List<SelectItem> list = appsService.select(keyword,true);
|
||||
public AjaxResult userSelect(String keyword) {
|
||||
List<SelectItem> list = appsService.select(keyword, true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Apps apps)
|
||||
{
|
||||
public TableDataInfo list(Apps apps) {
|
||||
startPage();
|
||||
List<Apps> list = appsService.selectAppsList(apps,false);
|
||||
List<Apps> list = appsService.selectAppsList(apps, false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo userList(Apps apps)
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo userList(Apps apps) {
|
||||
startPage();
|
||||
List<Apps> list = appsService.selectAppsList(apps,true);
|
||||
List<Apps> list = appsService.selectAppsList(apps, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
|
||||
/**
|
||||
* 导出应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:export')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(Apps apps)
|
||||
{
|
||||
List<Apps> list = appsService.selectAppsList(apps,false);
|
||||
public AjaxResult export(Apps apps) {
|
||||
List<Apps> list = appsService.selectAppsList(apps, false);
|
||||
ExcelUtil<Apps> util = new ExcelUtil<Apps>(Apps.class);
|
||||
return util.exportExcel(list, "apps");
|
||||
}
|
||||
@@ -102,74 +96,73 @@ public class AppsController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(appsService.selectAppsById(id,false));
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(appsService.selectAppsById(id, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-query')")
|
||||
@GetMapping(value = "/user/{id}")
|
||||
public AjaxResult userGetInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(appsService.selectAppsById(id,true));
|
||||
public AjaxResult userGetInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(appsService.selectAppsById(id, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:add')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.insertApps(apps,false));
|
||||
public AjaxResult add(@RequestBody Apps apps) {
|
||||
return toAjax(appsService.insertApps(apps, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-add')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user")
|
||||
public AjaxResult userAdd(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.insertApps(apps,true));
|
||||
public AjaxResult userAdd(@RequestBody Apps apps) {
|
||||
return toAjax(appsService.insertApps(apps, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:edit')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.updateApps(apps,false));
|
||||
public AjaxResult edit(@RequestBody Apps apps) {
|
||||
return toAjax(appsService.updateApps(apps, false));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-edit')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user")
|
||||
public AjaxResult userEdit(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.updateApps(apps,true));
|
||||
public AjaxResult userEdit(@RequestBody Apps apps) {
|
||||
return toAjax(appsService.updateApps(apps, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:remove')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(appsService.deleteAppsByIds(ids,false));
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(appsService.deleteAppsByIds(ids, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-remove')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}")
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(appsService.deleteAppsByIds(ids,true));
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids) {
|
||||
return toAjax(appsService.deleteAppsByIds(ids, true));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user