package com.qianwen.smartman.modules.system.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import java.util.List; import javax.validation.Valid; import com.qianwen.smartman.common.constant.CommonConstant; import com.qianwen.core.scanner.modular.annotation.DeleteResource; import com.qianwen.core.scanner.modular.annotation.GetResource; import com.qianwen.core.scanner.modular.annotation.PostResource; import com.qianwen.core.scanner.modular.annotation.PutResource; import com.qianwen.core.scanner.modular.stereotype.ApiResource; import com.qianwen.core.tenant.annotation.NonDS; import com.qianwen.core.tool.api.R; import com.qianwen.smartman.modules.system.convert.WorkbenchConvert; import com.qianwen.smartman.modules.system.entity.Workbench; import com.qianwen.smartman.modules.system.service.IWorkbenchService; import com.qianwen.smartman.modules.system.vo.WorkbenchVO; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @Api(value = "工作台", tags = {"工作台"}) @RestController @ApiResource({"blade-system/workbench"}) @NonDS /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/controller/WorkbenchController.class */ public class WorkbenchController { private final IWorkbenchService workbenchService; public WorkbenchController(final IWorkbenchService workbenchService) { this.workbenchService = workbenchService; } @ApiOperation(value = "查看所有工作台", notes = "查看所有工作台") @GetResource({"/list"}) public R> list(@RequestParam("status") @ApiParam("status") Integer status) { return R.data(this.workbenchService.listWorkbench(status)); } @PostResource @ApiOperation(value = "增加工作台", notes = "增加工作台") public R addWorkbench(@RequestParam("name") @ApiParam("工作台名称") String name) { return R.data(this.workbenchService.addWorkbench(name)); } @PutResource @ApiOperation(value = "编辑工作台", notes = "编辑工作台") public R updateWorkbench(@Valid @RequestBody WorkbenchVO workbenchVO) { return R.status(this.workbenchService.updateWorkbench(workbenchVO).booleanValue()); } @ApiOperation(value = "删除工作台", notes = "删除工作台") @DeleteResource public R deleteWorkbench(@RequestParam("id") @ApiParam(value = "工作台Id", required = true) Long id) { return R.status(this.workbenchService.deleteWorkbench(id).booleanValue()); } @ApiOperation(value = "工作台详情", notes = "工作台详情") @GetResource({"detailed-workbench"}) public R queryWorkbench(@RequestParam("id") @ApiParam(value = "工作台Id", required = true) Long id) { return R.data(WorkbenchConvert.INSTANCE.convert((Workbench) this.workbenchService.getById(id))); } @PostResource({"switch-status"}) @ApiOperation(value = "启动/禁用工作台", notes = "启动/禁用工作台") public R openWorkbench(@RequestParam("id") @ApiParam(value = "工作台Id", required = true) Long id, @RequestParam("status") @ApiParam(value = "启用", required = true) Integer status) { return R.status(this.workbenchService.switchWorkbench(id, status).booleanValue()); } @PutResource({CommonConstant.SORT_FIELD}) @ApiOperation(value = "排序工作台", notes = "排序工作台") public R sortWorkbench(@Valid @RequestBody List workbenchVOS) { return R.status(this.workbenchService.sortWorkbench(workbenchVOS).booleanValue()); } }