commit
d58c2d0a19
18 changed files with 542 additions and 24 deletions
@ -0,0 +1,30 @@ |
||||
package org.springblade.plugin.operation.database.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
@Data |
||||
@TableName("t_data_table") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class DataTable extends TenantEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 模块名称 |
||||
*/ |
||||
private String systemModuleName; |
||||
|
||||
/** |
||||
* 表名称 |
||||
*/ |
||||
private String dataTableName; |
||||
|
||||
/** |
||||
* 中文别名 |
||||
*/ |
||||
private String dataTableAlias; |
||||
|
||||
} |
||||
@ -0,0 +1,113 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.controller; |
||||
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.cache.utils.CacheUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tenant.annotation.NonDS; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.plugin.operation.system.entity.ModuleInfo; |
||||
import org.springblade.plugin.operation.system.service.IModuleInfoService; |
||||
import org.springblade.plugin.operation.system.service.IProjectInfoService; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
import java.util.List; |
||||
|
||||
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
*/ |
||||
@NonDS |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/moduleInfo") |
||||
@Api(value = "接口权限", tags = "接口权限") |
||||
public class ModuleInfoController extends BladeController { |
||||
|
||||
private final IModuleInfoService moduleInfoService; |
||||
|
||||
private final IProjectInfoService projectInfoService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入dataScope") |
||||
public R<ModuleInfo> detail(ModuleInfo moduleInfo) { |
||||
ModuleInfo detail = moduleInfoService.getOne(Condition.getQueryWrapper(moduleInfo)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入dataScope") |
||||
public R<IPage<ModuleInfo>> list(ModuleInfo moduleInfo, Query query) { |
||||
IPage<ModuleInfo> pages = moduleInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(moduleInfo)); |
||||
List<ModuleInfo> infoList = pages.getRecords(); |
||||
if (CollectionUtils.isNotEmpty(infoList)) { |
||||
infoList.forEach(item-> item.setProjectName(projectInfoService.getById(item.getProjectInfoId()).getProjectName())); |
||||
} |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "新增", notes = "传入dataScope") |
||||
public R save(@Valid @RequestBody ModuleInfo moduleInfo) { |
||||
return R.status(moduleInfoService.save(moduleInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "修改", notes = "传入dataScope") |
||||
public R update(@Valid @RequestBody ModuleInfo moduleInfo) { |
||||
return R.status(moduleInfoService.updateById(moduleInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "新增或修改", notes = "传入dataScope") |
||||
public R submit(@Valid @RequestBody ModuleInfo moduleInfo) { |
||||
return R.status(moduleInfoService.saveOrUpdate(moduleInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(moduleInfoService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,103 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.cache.utils.CacheUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tenant.annotation.NonDS; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.plugin.operation.system.entity.ProjectInfo; |
||||
import org.springblade.plugin.operation.system.service.IProjectInfoService; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
*/ |
||||
@NonDS |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/projectInfo") |
||||
@Api(value = "接口权限", tags = "接口权限") |
||||
public class ProjectInfoController extends BladeController { |
||||
|
||||
private final IProjectInfoService projectInfoService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入dataScope") |
||||
public R<ProjectInfo> detail(ProjectInfo projectInfo) { |
||||
ProjectInfo detail = projectInfoService.getOne(Condition.getQueryWrapper(projectInfo)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入dataScope") |
||||
public R<IPage<ProjectInfo>> list(ProjectInfo projectInfo, Query query) { |
||||
IPage<ProjectInfo> pages = projectInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(projectInfo)); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "新增", notes = "传入dataScope") |
||||
public R save(@Valid @RequestBody ProjectInfo projectInfo) { |
||||
return R.status(projectInfoService.save(projectInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "修改", notes = "传入dataScope") |
||||
public R update(@Valid @RequestBody ProjectInfo projectInfo) { |
||||
return R.status(projectInfoService.updateById(projectInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "新增或修改", notes = "传入dataScope") |
||||
public R submit(@Valid @RequestBody ProjectInfo projectInfo) { |
||||
return R.status(projectInfoService.saveOrUpdate(projectInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(projectInfoService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,14 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.springblade.plugin.operation.system.entity.ModuleInfo; |
||||
|
||||
/** |
||||
* Mapper 接口 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
public interface ModuleInfoMapper extends BaseMapper<ModuleInfo> { |
||||
|
||||
} |
||||
@ -0,0 +1,15 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.springblade.plugin.operation.system.entity.ProjectInfo; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
|
||||
/** |
||||
* Mapper 接口 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
public interface ProjectInfoMapper extends BaseMapper<ProjectInfo> { |
||||
|
||||
} |
||||
@ -0,0 +1,15 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.service; |
||||
|
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.plugin.operation.system.entity.ModuleInfo; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
|
||||
/** |
||||
* 服务类 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
public interface IModuleInfoService extends BaseService<ModuleInfo> { |
||||
|
||||
} |
||||
@ -0,0 +1,15 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.service; |
||||
|
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.plugin.operation.system.entity.ProjectInfo; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
|
||||
/** |
||||
* 服务类 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
public interface IProjectInfoService extends BaseService<ProjectInfo> { |
||||
|
||||
} |
||||
@ -0,0 +1,21 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.service.impl; |
||||
|
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.plugin.operation.system.entity.ModuleInfo; |
||||
import org.springblade.plugin.operation.system.mapper.ModuleInfoMapper; |
||||
import org.springblade.plugin.operation.system.service.IModuleInfoService; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
import org.springblade.plugin.operation.task.mapper.TaskInfoMapper; |
||||
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* 服务实现类 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
@Service |
||||
public class ModuleInfoServiceImpl extends BaseServiceImpl<ModuleInfoMapper, ModuleInfo> implements IModuleInfoService { |
||||
|
||||
} |
||||
@ -0,0 +1,21 @@ |
||||
|
||||
package org.springblade.plugin.operation.system.service.impl; |
||||
|
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.plugin.operation.system.entity.ProjectInfo; |
||||
import org.springblade.plugin.operation.system.mapper.ProjectInfoMapper; |
||||
import org.springblade.plugin.operation.system.service.IProjectInfoService; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
import org.springblade.plugin.operation.task.mapper.TaskInfoMapper; |
||||
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* 服务实现类 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
@Service |
||||
public class ProjectInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, ProjectInfo> implements IProjectInfoService { |
||||
|
||||
} |
||||
@ -0,0 +1,106 @@ |
||||
|
||||
package org.springblade.plugin.operation.task.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.cache.utils.CacheUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.secure.BladeUser; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tenant.annotation.NonDS; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.plugin.operation.database.entity.DataBase; |
||||
import org.springblade.plugin.operation.database.service.IDataBaseService; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
*/ |
||||
@NonDS |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/taskInfo") |
||||
@Api(value = "接口权限", tags = "接口权限") |
||||
public class TaskInfoController extends BladeController { |
||||
|
||||
private final ITaskInfoService taskInfoService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入dataScope") |
||||
public R<TaskInfo> detail(TaskInfo taskInfo) { |
||||
BladeUser user = AuthUtil.getUser(); |
||||
TaskInfo detail = taskInfoService.getOne(Condition.getQueryWrapper(taskInfo)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入dataScope") |
||||
public R<IPage<TaskInfo>> list(TaskInfo taskInfo, Query query) { |
||||
IPage<TaskInfo> pages = taskInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(taskInfo)); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "新增", notes = "传入dataScope") |
||||
public R save(@Valid @RequestBody TaskInfo taskInfo) { |
||||
return R.status(taskInfoService.save(taskInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "修改", notes = "传入dataScope") |
||||
public R update(@Valid @RequestBody TaskInfo taskInfo) { |
||||
return R.status(taskInfoService.updateById(taskInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "新增或修改", notes = "传入dataScope") |
||||
public R submit(@Valid @RequestBody TaskInfo taskInfo) { |
||||
return R.status(taskInfoService.saveOrUpdate(taskInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(taskInfoService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,15 @@ |
||||
|
||||
package org.springblade.plugin.operation.task.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.springblade.plugin.operation.database.entity.DataBase; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
|
||||
/** |
||||
* Mapper 接口 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
public interface TaskInfoMapper extends BaseMapper<TaskInfo> { |
||||
|
||||
} |
||||
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.springblade.plugin.operation.task.mapper.TaskInfoMapper"> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,15 @@ |
||||
|
||||
package org.springblade.plugin.operation.task.service; |
||||
|
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.plugin.operation.database.entity.DataBase; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
|
||||
/** |
||||
* 服务类 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
public interface ITaskInfoService extends BaseService<TaskInfo> { |
||||
|
||||
} |
||||
@ -0,0 +1,21 @@ |
||||
|
||||
package org.springblade.plugin.operation.task.service.impl; |
||||
|
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.plugin.operation.database.entity.DataBase; |
||||
import org.springblade.plugin.operation.database.mapper.DataBaseMapper; |
||||
import org.springblade.plugin.operation.database.service.IDataBaseService; |
||||
import org.springblade.plugin.operation.task.entity.TaskInfo; |
||||
import org.springblade.plugin.operation.task.mapper.TaskInfoMapper; |
||||
import org.springblade.plugin.operation.task.service.ITaskInfoService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* 服务实现类 |
||||
* |
||||
* @author BladeX |
||||
*/ |
||||
@Service |
||||
public class TaskInfoServiceImpl extends BaseServiceImpl<TaskInfoMapper, TaskInfo> implements ITaskInfoService { |
||||
|
||||
} |
||||
Loading…
Reference in new issue