This commit is contained in:
2026-01-15 19:34:19 +08:00
parent 94b91919bc
commit 3d3b720712
495 changed files with 40840 additions and 95 deletions

View File

@@ -0,0 +1,156 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.modules.system.pojo.entity.ApiKey;
import org.springblade.modules.system.pojo.vo.ApiKeyVO;
import org.springblade.modules.system.service.IApiKeyService;
import org.springblade.modules.system.wrapper.ApiKeyWrapper;
import org.springframework.web.bind.annotation.*;
/**
* 令牌权限 控制器
*
* @author Chill
*/
@NonDS
@IsAdmin
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/api-key")
@Tag(name = "令牌权限", description = "令牌权限接口")
public class ApiKeyController extends BladeController {
private final IApiKeyService apiKeyService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入apiKey")
public R<ApiKeyVO> detail(ApiKey apiKey) {
ApiKey detail = apiKeyService.getOne(Condition.getQueryWrapper(apiKey));
return R.data(ApiKeyWrapper.build().entityVO(detail));
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入apiKey")
public R<IPage<ApiKeyVO>> list(@Parameter(hidden = true) ApiKey apiKey, Query query) {
IPage<ApiKey> pages = apiKeyService.page(Condition.getPage(query), Condition.getQueryWrapper(apiKey));
return R.data(ApiKeyWrapper.build().pageVO(pages));
}
/**
* 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "自定义分页", description = "传入apiKey")
public R<IPage<ApiKeyVO>> page(@Parameter(hidden = true) ApiKeyVO apiKey, Query query) {
IPage<ApiKeyVO> pages = apiKeyService.selectApiKeyPage(Condition.getPage(query), apiKey);
return R.data(pages);
}
/**
* 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入apiKey")
public R<String> save(@Valid @RequestBody ApiKey apiKey) {
return R.data(apiKeyService.submitApiKey(apiKey));
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入apiKey")
public R<String> update(@Valid @RequestBody ApiKey apiKey) {
return R.data(apiKeyService.submitApiKey(apiKey));
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入apiKey")
public R<String> submit(@Valid @RequestBody ApiKey apiKey) {
return R.data(apiKeyService.submitApiKey(apiKey));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R<Boolean> remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(apiKeyService.removeApiKey(ids));
}
/**
* 启用
*/
@PostMapping("/enable")
@ApiOperationSupport(order = 8)
@Operation(summary = "启用", description = "传入ids")
public R<Boolean> enable(@RequestParam String ids) {
return R.status(apiKeyService.enableApiKey(ids));
}
/**
* 禁用
*/
@PostMapping("/disable")
@ApiOperationSupport(order = 9)
@Operation(summary = "禁用", description = "传入ids")
public R<Boolean> disable(@RequestParam String ids) {
return R.status(apiKeyService.disableApiKey(ids));
}
}

View File

@@ -0,0 +1,134 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.ApiScope;
import org.springblade.modules.system.pojo.vo.ApiScopeVO;
import org.springblade.modules.system.service.IApiScopeService;
import org.springblade.modules.system.wrapper.ApiScopeWrapper;
import org.springframework.web.bind.annotation.*;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 接口权限控制器
*
* @author BladeX
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdmin
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/api-scope")
@Tag(name = "接口权限", description = "接口权限")
public class ApiScopeController extends BladeController {
private final IApiScopeService apiScopeService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入dataScope")
public R<ApiScope> detail(ApiScope dataScope) {
ApiScope detail = apiScopeService.getOne(Condition.getQueryWrapper(dataScope));
return R.data(detail);
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入dataScope")
public R<IPage<ApiScopeVO>> list(ApiScope dataScope, Query query) {
IPage<ApiScope> pages = apiScopeService.page(Condition.getPage(query), Condition.getQueryWrapper(dataScope));
return R.data(ApiScopeWrapper.build().pageVO(pages));
}
/**
* 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增", description = "传入dataScope")
public R save(@Valid @RequestBody ApiScope dataScope) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(apiScopeService.save(dataScope));
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 4)
@Operation(summary = "修改", description = "传入dataScope")
public R update(@Valid @RequestBody ApiScope dataScope) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(apiScopeService.updateById(dataScope));
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入dataScope")
public R submit(@Valid @RequestBody ApiScope dataScope) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(apiScopeService.saveOrUpdate(dataScope));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(apiScopeService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,126 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdministrator;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.AuthClient;
import org.springblade.modules.system.service.IAuthClientService;
import org.springframework.web.bind.annotation.*;
/**
* 应用管理控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdministrator
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/client")
@Tag(name = "应用管理", description = "应用管理")
public class AuthClientController extends BladeController {
private final IAuthClientService clientService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入client")
public R<AuthClient> detail(AuthClient authClient) {
AuthClient detail = clientService.getOne(Condition.getQueryWrapper(authClient));
return R.data(detail);
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入client")
public R<IPage<AuthClient>> list(AuthClient authClient, Query query) {
IPage<AuthClient> pages = clientService.page(Condition.getPage(query), Condition.getQueryWrapper(authClient));
return R.data(pages);
}
/**
* 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增", description = "传入client")
public R save(@Valid @RequestBody AuthClient authClient) {
return R.status(clientService.save(authClient));
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 4)
@Operation(summary = "修改", description = "传入client")
public R update(@Valid @RequestBody AuthClient authClient) {
return R.status(clientService.updateById(authClient));
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入client")
public R submit(@Valid @RequestBody AuthClient authClient) {
return R.status(clientService.saveOrUpdate(authClient));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(clientService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,134 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.DataScope;
import org.springblade.modules.system.pojo.vo.DataScopeVO;
import org.springblade.modules.system.service.IDataScopeService;
import org.springblade.modules.system.wrapper.DataScopeWrapper;
import org.springframework.web.bind.annotation.*;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 数据权限控制器
*
* @author BladeX
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdmin
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/data-scope")
@Tag(name = "数据权限", description = "数据权限")
public class DataScopeController extends BladeController {
private final IDataScopeService dataScopeService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入dataScope")
public R<DataScope> detail(DataScope dataScope) {
DataScope detail = dataScopeService.getOne(Condition.getQueryWrapper(dataScope));
return R.data(detail);
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入dataScope")
public R<IPage<DataScopeVO>> list(DataScope dataScope, Query query) {
IPage<DataScope> pages = dataScopeService.page(Condition.getPage(query), Condition.getQueryWrapper(dataScope));
return R.data(DataScopeWrapper.build().pageVO(pages));
}
/**
* 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增", description = "传入dataScope")
public R save(@Valid @RequestBody DataScope dataScope) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(dataScopeService.save(dataScope));
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 4)
@Operation(summary = "修改", description = "传入dataScope")
public R update(@Valid @RequestBody DataScope dataScope) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(dataScopeService.updateById(dataScope));
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入dataScope")
public R submit(@Valid @RequestBody DataScope dataScope) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(dataScopeService.saveOrUpdate(dataScope));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(dataScopeService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,211 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.DictCache;
import org.springblade.common.cache.UserCache;
import org.springblade.common.enums.DictEnum;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.secure.constant.AuthConstant;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.Dept;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.pojo.vo.DeptVO;
import org.springblade.modules.system.pojo.vo.UserVO;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.wrapper.DeptWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/dept")
@Tag(name = "部门", description = "部门")
public class DeptController extends BladeController {
private final IDeptService deptService;
/**
* 详情
*/
@PreAuth(menu = "dept")
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入dept")
public R<DeptVO> detail(Dept dept) {
Dept detail = deptService.getOne(Condition.getQueryWrapper(dept));
return R.data(DeptWrapper.build().entityVO(detail));
}
/**
* 列表
*/
@PreAuth(menu = "dept")
@GetMapping("/list")
@Parameters({
@Parameter(name = "deptName", description = "部门名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "fullName", description = "部门全称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "列表", description = "传入dept")
public R<List<DeptVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> dept, BladeUser bladeUser) {
QueryWrapper<Dept> queryWrapper = Condition.getQueryWrapper(dept, Dept.class);
List<Dept> list = deptService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Dept::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(DeptWrapper.build().listNodeVO(list));
}
/**
* 懒加载列表
*/
@PreAuth(menu = "dept")
@GetMapping("/lazy-list")
@Parameters({
@Parameter(name = "deptName", description = "部门名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "fullName", description = "部门全称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "懒加载列表", description = "传入dept")
public R<List<DeptVO>> lazyList(@Parameter(hidden = true) @RequestParam Map<String, Object> dept, Long parentId, BladeUser bladeUser) {
List<DeptVO> list = deptService.lazyList(bladeUser.getTenantId(), parentId, dept);
return R.data(DeptWrapper.build().listNodeLazyVO(list));
}
/**
* 获取部门树形结构
*/
@PreAuth(menu = "dept")
@GetMapping("/tree")
@ApiOperationSupport(order = 4)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<DeptVO>> tree(String tenantId, BladeUser bladeUser) {
List<DeptVO> tree = deptService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()));
return R.data(tree);
}
/**
* 懒加载获取部门树形结构
*/
@PreAuth(menu = "dept")
@GetMapping("/lazy-tree")
@ApiOperationSupport(order = 5)
@Operation(summary = "懒加载树形结构", description = "树形结构")
public R<List<DeptVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) {
List<DeptVO> tree = deptService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId);
return R.data(tree);
}
/**
* 新增或修改
*/
@IsAdmin
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入dept")
public R submit(@Valid @RequestBody Dept dept) {
if (deptService.submit(dept)) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
// 返回懒加载树更新节点所需字段
Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
.set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
return R.data(kv);
}
return R.fail("操作失败");
}
/**
* 删除
*/
@IsAdmin
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(deptService.removeDept(ids));
}
/**
* 下拉数据源
*/
@PreAuth(AuthConstant.PERMIT_ALL)
@GetMapping("/select")
@ApiOperationSupport(order = 8)
@Operation(summary = "下拉数据源", description = "传入id集合")
public R<List<Dept>> select(Long userId, String deptId) {
if (Func.isNotEmpty(userId)) {
User user = UserCache.getUser(userId);
deptId = user.getDeptId();
}
List<Dept> list = deptService.list(Wrappers.<Dept>lambdaQuery().in(Dept::getId, Func.toLongList(deptId)));
return R.data(list);
}
/**
* 获取部门的主管信息
*/
@IsAdmin
@GetMapping("/dept-leader-info")
@ApiOperationSupport(order = 9)
@Operation(summary = "获取部门的主管信息", description = "传入deptId")
public R<List<UserVO>> deptLeaderInfo(@Parameter(description = "部门id", required = true) @RequestParam Long deptId) {
List<UserVO> list = deptService.deptLeaderInfo(deptId);
return R.data(list);
}
}

View File

@@ -0,0 +1,223 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.modules.system.pojo.entity.DictBiz;
import org.springblade.modules.system.service.IDictBizService;
import org.springblade.modules.system.pojo.vo.DictBizVO;
import org.springblade.modules.system.wrapper.DictBizWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.DICT_CACHE;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/dict-biz")
@Tag(name = "业务字典", description = "业务字典")
public class DictBizController extends BladeController {
private final IDictBizService dictService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入dict")
public R<DictBizVO> detail(DictBiz dict) {
DictBiz detail = dictService.getOne(Condition.getQueryWrapper(dict));
return R.data(DictBizWrapper.build().entityVO(detail));
}
/**
* 列表
*/
@GetMapping("/list")
@Parameters({
@Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "列表", description = "传入dict")
public R<List<DictBizVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> dict) {
List<DictBiz> list = dictService.list(Condition.getQueryWrapper(dict, DictBiz.class).lambda().orderByAsc(DictBiz::getSort));
return R.data(DictBizWrapper.build().listNodeVO(list));
}
/**
* 顶级列表
*/
@GetMapping("/parent-list")
@Parameters({
@Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "列表", description = "传入dict")
public R<IPage<DictBizVO>> parentList(@Parameter(hidden = true) @RequestParam Map<String, Object> dict, Query query) {
return R.data(dictService.parentList(dict, query));
}
/**
* 子列表
*/
@GetMapping("/child-list")
@Parameters({
@Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "parentId", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 4)
@Operation(summary = "列表", description = "传入dict")
public R<List<DictBizVO>> childList(@Parameter(hidden = true) @RequestParam Map<String, Object> dict, @RequestParam(required = false, defaultValue = "-1") Long parentId) {
return R.data(dictService.childList(dict, parentId));
}
/**
* 获取字典树形结构
*/
@GetMapping("/tree")
@ApiOperationSupport(order = 5)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<DictBizVO>> tree() {
List<DictBizVO> tree = dictService.tree();
return R.data(tree);
}
/**
* 获取字典树形结构
*/
@GetMapping("/parent-tree")
@ApiOperationSupport(order = 5)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<DictBizVO>> parentTree() {
List<DictBizVO> tree = dictService.parentTree();
return R.data(tree);
}
/**
* 新增或修改
*/
@PreAuth(menu = "dictbiz")
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入dict")
public R submit(@Valid @RequestBody DictBiz dict) {
CacheUtil.clear(DICT_CACHE);
return R.status(dictService.submit(dict));
}
/**
* 删除
*/
@PreAuth(menu = "dictbiz")
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(DICT_CACHE);
return R.status(dictService.removeDict(ids));
}
/**
* 获取字典
*/
@GetMapping("/dictionary")
@ApiOperationSupport(order = 8)
@Operation(summary = "获取字典", description = "获取字典")
public R<List<DictBiz>> dictionary(String code) {
List<DictBiz> tree = dictService.getList(code);
return R.data(tree);
}
/**
* 获取字典树
*/
@GetMapping("/dictionary-tree")
@ApiOperationSupport(order = 9)
@Operation(summary = "获取字典树", description = "获取字典树")
public R<List<DictBizVO>> dictionaryTree(String code) {
List<DictBiz> tree = dictService.getList(code);
return R.data(DictBizWrapper.build().listNodeVO(tree));
}
/**
* 字典键值列表
*/
@GetMapping("/select")
@ApiOperationSupport(order = 10)
@Operation(summary = "字典键值列表", description = "字典键值列表")
public R<List<DictBiz>> select() {
List<DictBiz> list = dictService.list(Wrappers.<DictBiz>query().lambda().eq(DictBiz::getParentId, CommonConstant.TOP_PARENT_ID));
list.forEach(dict -> dict.setDictValue(dict.getCode() + StringPool.COLON + StringPool.SPACE + dict.getDictValue()));
return R.data(list);
}
/**
* 字典全列表
*/
@GetMapping("/select-all")
@ApiOperationSupport(order = 11)
@Operation(summary = "字典全列表", description = "字典全列表")
public R<List<DictBiz>> selectAll() {
List<DictBiz> list = dictService.list(Wrappers.<DictBiz>query().lambda().eq(DictBiz::getIsDeleted, BladeConstant.DB_NOT_DELETED));
return R.data(list);
}
}

View File

@@ -0,0 +1,234 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.modules.system.pojo.entity.Dict;
import org.springblade.modules.system.service.IDictService;
import org.springblade.modules.system.pojo.vo.DictVO;
import org.springblade.modules.system.wrapper.DictWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.DICT_CACHE;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/dict")
@Tag(name = "系统字典", description = "系统字典")
public class DictController extends BladeController {
private final IDictService dictService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入dict")
public R<DictVO> detail(Dict dict) {
Dict detail = dictService.getOne(Condition.getQueryWrapper(dict));
return R.data(DictWrapper.build().entityVO(detail));
}
/**
* 列表
*/
@GetMapping("/list")
@Parameters({
@Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "列表", description = "传入dict")
public R<List<DictVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> dict) {
List<Dict> list = dictService.list(Condition.getQueryWrapper(dict, Dict.class).lambda().orderByAsc(Dict::getSort));
return R.data(DictWrapper.build().listNodeVO(list));
}
/**
* 顶级列表
*/
@GetMapping("/parent-list")
@Parameters({
@Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "列表", description = "传入dict")
public R<IPage<DictVO>> parentList(@Parameter(hidden = true) @RequestParam Map<String, Object> dict, Query query) {
return R.data(dictService.parentList(dict, query));
}
/**
* 子列表
*/
@GetMapping("/child-list")
@Parameters({
@Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "parentId", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 4)
@Operation(summary = "列表", description = "传入dict")
public R<List<DictVO>> childList(@Parameter(hidden = true) @RequestParam Map<String, Object> dict, @RequestParam(required = false, defaultValue = "-1") Long parentId) {
return R.data(dictService.childList(dict, parentId));
}
/**
* 获取字典树形结构
*/
@GetMapping("/tree")
@ApiOperationSupport(order = 5)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<DictVO>> tree() {
List<DictVO> tree = dictService.tree();
return R.data(tree);
}
/**
* 获取字典树形结构
*/
@GetMapping("/parent-tree")
@ApiOperationSupport(order = 5)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<DictVO>> parentTree() {
List<DictVO> tree = dictService.parentTree();
return R.data(tree);
}
/**
* 新增或修改
*/
@PreAuth(menu = "dict")
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "新增或修改")
public R submit(@Valid @RequestBody Dict dict) {
CacheUtil.clear(DICT_CACHE, Boolean.FALSE);
return R.status(dictService.submit(dict));
}
/**
* 删除
*/
@PreAuth(menu = "dict")
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(DICT_CACHE, Boolean.FALSE);
return R.status(dictService.removeDict(ids));
}
/**
* 获取字典
*/
@GetMapping("/dictionary")
@ApiOperationSupport(order = 8)
@Operation(summary = "获取字典", description = "获取字典")
public R<List<Dict>> dictionary(String code) {
List<Dict> tree = dictService.getList(code);
return R.data(tree);
}
/**
* 获取字典
*/
@GetMapping("/dictionary-full")
@ApiOperationSupport(order = 9)
@Operation(summary = "获取字典", description = "获取字典")
public R<List<Dict>> dictionaryFull(String code) {
List<Dict> tree = dictService.getList(code);
tree.forEach(dict -> dict.setDictValue(dict.getDictKey() + StringPool.SPACE + StringPool.COLON + StringPool.SPACE + dict.getDictValue()));
return R.data(tree);
}
/**
* 获取字典树
*/
@GetMapping("/dictionary-tree")
@ApiOperationSupport(order = 10)
@Operation(summary = "获取字典树", description = "获取字典树")
public R<List<DictVO>> dictionaryTree(String code) {
List<Dict> tree = dictService.getList(code);
return R.data(DictWrapper.build().listNodeVO(tree));
}
/**
* 字典键值列表
*/
@GetMapping("/select")
@ApiOperationSupport(order = 11)
@Operation(summary = "字典键值列表", description = "字典键值列表")
public R<List<Dict>> select() {
List<Dict> list = dictService.list(Wrappers.<Dict>query().lambda().eq(Dict::getParentId, CommonConstant.TOP_PARENT_ID));
list.forEach(dict -> dict.setDictValue(dict.getCode() + StringPool.COLON + StringPool.SPACE + dict.getDictValue()));
return R.data(list);
}
/**
* 字典全列表
*/
@GetMapping("/select-all")
@ApiOperationSupport(order = 12)
@Operation(summary = "字典全列表", description = "字典全列表")
public R<List<Dict>> selectAll() {
List<Dict> list = dictService.list(Wrappers.<Dict>query().lambda().eq(Dict::getIsDeleted, BladeConstant.DB_NOT_DELETED));
return R.data(list);
}
}

View File

@@ -0,0 +1,85 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.AllArgsConstructor;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.log.model.LogApi;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.modules.system.pojo.vo.LogApiVO;
import org.springblade.modules.system.service.ILogApiService;
import org.springblade.modules.system.wrapper.LogApiWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@Hidden
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_LOG_NAME + "/api")
public class LogApiController {
private final ILogApiService logService;
/**
* 查询单条
*/
@IsAdmin
@GetMapping("/detail")
public R<LogApi> detail(LogApi log) {
QueryWrapper<LogApi> queryWrapper = Condition.getQueryWrapper(log);
return R.data(queryWrapper.isEmptyOfWhere() ? null : logService.getOne(queryWrapper));
}
/**
* 查询多条(分页)
*/
@IsAdmin
@GetMapping("/list")
public R<IPage<LogApiVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> log, Query query) {
IPage<LogApi> pages = logService.page(Condition.getPage(query.setDescs("create_time")), Condition.getQueryWrapper(log, LogApi.class));
return R.data(LogApiWrapper.build().pageVO(pages));
}
}

View File

@@ -0,0 +1,85 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.AllArgsConstructor;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.log.model.LogError;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.modules.system.pojo.vo.LogErrorVO;
import org.springblade.modules.system.service.ILogErrorService;
import org.springblade.modules.system.wrapper.LogErrorWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@Hidden
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_LOG_NAME + "/error")
public class LogErrorController {
private final ILogErrorService errorLogService;
/**
* 查询单条
*/
@IsAdmin
@GetMapping("/detail")
public R<LogError> detail(LogError logError) {
QueryWrapper<LogError> queryWrapper = Condition.getQueryWrapper(logError);
return R.data(queryWrapper.isEmptyOfWhere() ? null : errorLogService.getOne(queryWrapper));
}
/**
* 查询多条(分页)
*/
@IsAdmin
@GetMapping("/list")
public R<IPage<LogErrorVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> logError, Query query) {
IPage<LogError> pages = errorLogService.page(Condition.getPage(query.setDescs("create_time")), Condition.getQueryWrapper(logError, LogError.class));
return R.data(LogErrorWrapper.build().pageVO(pages));
}
}

View File

@@ -0,0 +1,85 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.AllArgsConstructor;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.log.model.LogUsual;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.modules.system.pojo.vo.LogUsualVO;
import org.springblade.modules.system.service.ILogUsualService;
import org.springblade.modules.system.wrapper.LogUsualWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@Hidden
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_LOG_NAME + "/usual")
public class LogUsualController {
private final ILogUsualService logService;
/**
* 查询单条
*/
@IsAdmin
@GetMapping("/detail")
public R<LogUsual> detail(LogUsual log) {
QueryWrapper<LogUsual> queryWrapper = Condition.getQueryWrapper(log);
return R.data(logService.getOne(queryWrapper));
}
/**
* 查询多条(分页)
*/
@IsAdmin
@GetMapping("/list")
public R<IPage<LogUsualVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> log, Query query) {
IPage<LogUsual> pages = logService.page(Condition.getPage(query), Condition.getQueryWrapper(log, LogUsual.class));
return R.data(LogUsualWrapper.build().pageVO(pages));
}
}

View File

@@ -0,0 +1,310 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdministrator;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.node.TreeNode;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.Menu;
import org.springblade.modules.system.pojo.entity.TopMenu;
import org.springblade.modules.system.pojo.vo.CheckedTreeVO;
import org.springblade.modules.system.pojo.vo.GrantTreeVO;
import org.springblade.modules.system.pojo.vo.MenuVO;
import org.springblade.modules.system.service.IMenuService;
import org.springblade.modules.system.service.ITopMenuService;
import org.springblade.modules.system.wrapper.MenuWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.MENU_CACHE;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/menu")
@Tag(name = "菜单", description = "菜单")
public class MenuController extends BladeController {
private final IMenuService menuService;
private final ITopMenuService topMenuService;
/**
* 详情
*/
@IsAdministrator
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入menu")
public R<MenuVO> detail(Menu menu) {
Menu detail = menuService.getOne(Condition.getQueryWrapper(menu));
return R.data(MenuWrapper.build().entityVO(detail));
}
/**
* 列表
*/
@IsAdministrator
@GetMapping("/list")
@Parameters({
@Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "列表", description = "传入menu")
public R<List<MenuVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<Menu> list = menuService.list(Condition.getQueryWrapper(menu, Menu.class).lambda().orderByAsc(Menu::getSort));
return R.data(MenuWrapper.build().listNodeVO(list));
}
/**
* 懒加载列表
*/
@IsAdministrator
@GetMapping("/lazy-list")
@Parameters({
@Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "懒加载列表", description = "传入menu")
public R<List<MenuVO>> lazyList(Long parentId, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<MenuVO> list = menuService.lazyList(parentId, menu);
return R.data(MenuWrapper.build().listNodeLazyVO(list));
}
/**
* 菜单列表
*/
@IsAdministrator
@GetMapping("/menu-list")
@Parameters({
@Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 4)
@Operation(summary = "菜单列表", description = "传入menu")
public R<List<MenuVO>> menuList(@Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<Menu> list = menuService.list(Condition.getQueryWrapper(menu, Menu.class).lambda().eq(Menu::getCategory, 1).orderByAsc(Menu::getSort));
return R.data(MenuWrapper.build().listNodeVO(list));
}
/**
* 懒加载菜单列表
*/
@IsAdministrator
@GetMapping("/lazy-menu-list")
@Parameters({
@Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 5)
@Operation(summary = "懒加载菜单列表", description = "传入menu")
public R<List<MenuVO>> lazyMenuList(Long parentId, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<MenuVO> list = menuService.lazyMenuList(parentId, menu);
return R.data(MenuWrapper.build().listNodeLazyVO(list));
}
/**
* 新增或修改
*/
@IsAdministrator
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入menu")
public R submit(@Valid @RequestBody Menu menu) {
if (menuService.submit(menu)) {
CacheUtil.clear(MENU_CACHE);
CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
// 返回懒加载树更新节点所需字段
Kv kv = Kv.create().set("id", String.valueOf(menu.getId()));
return R.data(kv);
}
return R.fail("操作失败");
}
/**
* 删除
*/
@IsAdministrator
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(MENU_CACHE);
CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
return R.status(menuService.removeMenu(ids));
}
/**
* 前端菜单数据
*/
@GetMapping("/routes")
@ApiOperationSupport(order = 8)
@Operation(summary = "前端菜单数据", description = "前端菜单数据")
public R<List<MenuVO>> routes(BladeUser user, Long topMenuId) {
List<MenuVO> list = menuService.routes((user == null) ? null : user.getRoleId(), topMenuId);
return R.data(list);
}
/**
* 前端菜单数据
*/
@GetMapping("/routes-ext")
@ApiOperationSupport(order = 9)
@Operation(summary = "前端菜单数据", description = "前端菜单数据")
public R<List<MenuVO>> routesExt(BladeUser user, Long topMenuId) {
List<MenuVO> list = menuService.routesExt(user.getRoleId(), topMenuId);
return R.data(list);
}
/**
* 前端按钮数据
*/
@GetMapping("/buttons")
@ApiOperationSupport(order = 10)
@Operation(summary = "前端按钮数据", description = "前端按钮数据")
public R<List<MenuVO>> buttons(BladeUser user) {
List<MenuVO> list = menuService.buttons(user.getRoleId());
return R.data(list);
}
/**
* 获取菜单树形结构
*/
@GetMapping("/tree")
@ApiOperationSupport(order = 11)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<TreeNode>> tree() {
List<TreeNode> tree = menuService.tree();
return R.data(tree);
}
/**
* 获取权限分配树形结构
*/
@GetMapping("/grant-tree")
@ApiOperationSupport(order = 12)
@Operation(summary = "权限分配树形结构", description = "权限分配树形结构")
public R<GrantTreeVO> grantTree(BladeUser user) {
GrantTreeVO vo = new GrantTreeVO();
vo.setMenu(menuService.grantTree(user));
vo.setDataScope(menuService.grantDataScopeTree(user));
vo.setApiScope(menuService.grantApiScopeTree(user));
return R.data(vo);
}
/**
* 获取权限分配树形结构
*/
@GetMapping("/role-tree-keys")
@ApiOperationSupport(order = 13)
@Operation(summary = "角色所分配的树", description = "角色所分配的树")
public R<CheckedTreeVO> roleTreeKeys(String roleIds) {
CheckedTreeVO vo = new CheckedTreeVO();
vo.setMenu(menuService.roleTreeKeys(roleIds));
vo.setDataScope(menuService.dataScopeTreeKeys(roleIds));
vo.setApiScope(menuService.apiScopeTreeKeys(roleIds));
return R.data(vo);
}
/**
* 获取顶部菜单树形结构
*/
@GetMapping("/grant-top-tree")
@ApiOperationSupport(order = 14)
@Operation(summary = "顶部菜单树形结构", description = "顶部菜单树形结构")
public R<GrantTreeVO> grantTopTree(BladeUser user) {
GrantTreeVO vo = new GrantTreeVO();
vo.setMenu(menuService.grantTopTree(user));
return R.data(vo);
}
/**
* 获取顶部菜单树形结构
*/
@GetMapping("/top-tree-keys")
@ApiOperationSupport(order = 15)
@Operation(summary = "顶部菜单所分配的树", description = "顶部菜单所分配的树")
public R<CheckedTreeVO> topTreeKeys(String topMenuIds) {
CheckedTreeVO vo = new CheckedTreeVO();
vo.setMenu(menuService.topTreeKeys(topMenuIds));
return R.data(vo);
}
/**
* 顶部菜单数据
*/
@GetMapping("/top-menu")
@ApiOperationSupport(order = 16)
@Operation(summary = "顶部菜单数据", description = "顶部菜单数据")
public R<List<TopMenu>> topMenu(BladeUser user) {
if (Func.isEmpty(user)) {
return null;
}
List<TopMenu> list = topMenuService.list(Wrappers.<TopMenu>query().lambda().orderByAsc(TopMenu::getSort));
return R.data(list);
}
/**
* 获取配置的角色权限
*/
@GetMapping("auth-routes")
@ApiOperationSupport(order = 17)
@Operation(summary = "菜单的角色权限")
public R<List<Kv>> authRoutes(BladeUser user) {
if (Func.isEmpty(user)) {
return null;
}
return R.data(menuService.authRoutes(user));
}
}

View File

@@ -0,0 +1,123 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.Param;
import org.springblade.modules.system.service.IParamService;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdmin
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/param")
@Tag(name = "参数配置", description = "参数配置")
public class ParamController extends BladeController {
private final IParamService paramService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入param")
public R<Param> detail(Param param) {
Param detail = paramService.getOne(Condition.getQueryWrapper(param));
return R.data(detail);
}
/**
* 分页
*/
@GetMapping("/list")
@Parameters({
@Parameter(name = "paramName", description = "参数名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "paramKey", description = "参数键名", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "paramValue", description = "参数键值", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入param")
public R<IPage<Param>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> param, Query query) {
IPage<Param> pages = paramService.page(Condition.getPage(query), Condition.getQueryWrapper(param, Param.class));
return R.data(pages);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入param")
public R submit(@Valid @RequestBody Param param) {
CacheUtil.clear(PARAM_CACHE);
CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
return R.status(paramService.saveOrUpdate(param));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(PARAM_CACHE);
CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
return R.status(paramService.deleteLogic(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
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.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.Post;
import org.springblade.modules.system.service.IPostService;
import org.springblade.modules.system.pojo.vo.PostVO;
import org.springblade.modules.system.wrapper.PostWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 岗位表 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@PreAuth(menu = "post")
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/post")
@Tag(name = "岗位", description = "岗位")
public class PostController extends BladeController {
private final IPostService postService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入post")
public R<PostVO> detail(Post post) {
Post detail = postService.getOne(Condition.getQueryWrapper(post));
return R.data(PostWrapper.build().entityVO(detail));
}
/**
* 分页 岗位表
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入post")
public R<IPage<PostVO>> list(Post post, Query query) {
IPage<Post> pages = postService.page(Condition.getPage(query), Condition.getQueryWrapper(post));
return R.data(PostWrapper.build().pageVO(pages));
}
/**
* 自定义分页 岗位表
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入post")
public R<IPage<PostVO>> page(PostVO post, Query query) {
IPage<PostVO> pages = postService.selectPostPage(Condition.getPage(query), post);
return R.data(pages);
}
/**
* 新增 岗位表
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入post")
public R save(@Valid @RequestBody Post post) {
CacheUtil.clear(SYS_CACHE);
return R.status(postService.save(post));
}
/**
* 修改 岗位表
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入post")
public R update(@Valid @RequestBody Post post) {
CacheUtil.clear(SYS_CACHE);
return R.status(postService.updateById(post));
}
/**
* 新增或修改 岗位表
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入post")
public R submit(@Valid @RequestBody Post post) {
CacheUtil.clear(SYS_CACHE);
return R.status(postService.saveOrUpdate(post));
}
/**
* 删除 岗位表
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE);
return R.status(postService.deleteLogic(Func.toLongList(ids)));
}
/**
* 下拉数据源
*/
@GetMapping("/select")
@ApiOperationSupport(order = 8)
@Operation(summary = "下拉数据源", description = "传入post")
public R<List<Post>> select(String tenantId, BladeUser bladeUser) {
List<Post> list = postService.list(Wrappers.<Post>query().lambda().eq(Post::getTenantId, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId())));
return R.data(list);
}
}

View File

@@ -0,0 +1,133 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.secure.annotation.IsAdministrator;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.RecordData;
import org.springblade.modules.system.pojo.vo.RecordDataVO;
import org.springblade.modules.system.service.IRecordDataService;
import org.springblade.modules.system.wrapper.RecordDataWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 数据审计表 控制器
*
* @author BladeX
*/
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/record-data")
@Tag(name = "数据审计表", description = "数据审计表接口")
public class RecordDataController extends BladeController {
private final IRecordDataService recordDataService;
/**
* 数据审计表 详情
*/
@IsAdmin
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入recordData")
public R<RecordDataVO> detail(RecordData recordData) {
RecordData detail = recordDataService.getOne(Condition.getQueryWrapper(recordData));
return R.data(RecordDataWrapper.build().entityVO(detail));
}
/**
* 数据审计表 分页
*/
@IsAdmin
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入recordData")
public R<IPage<RecordDataVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> recordData, Query query) {
IPage<RecordData> pages = recordDataService.page(Condition.getPage(query.setDescs(BladeConstant.DB_PRIMARY_KEY)), Condition.getQueryWrapper(recordData, RecordData.class));
return R.data(RecordDataWrapper.build().pageVO(pages));
}
/**
* 数据审计表 新增
*/
@IsAdministrator
@PostMapping("/save")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增", description = "传入recordData")
public R save(@Valid @RequestBody RecordData recordData) {
return R.status(recordDataService.save(recordData));
}
/**
* 数据审计表 修改
*/
@IsAdministrator
@PostMapping("/update")
@ApiOperationSupport(order = 4)
@Operation(summary = "修改", description = "传入recordData")
public R update(@Valid @RequestBody RecordData recordData) {
return R.status(recordDataService.updateById(recordData));
}
/**
* 数据审计表 新增或修改
*/
@IsAdministrator
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入recordData")
public R submit(@Valid @RequestBody RecordData recordData) {
return R.status(recordDataService.saveOrUpdate(recordData));
}
/**
* 数据审计表 删除
*/
@IsAdministrator
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(recordDataService.removeByIds(Func.toLongList(ids)));
}
}

View File

@@ -0,0 +1,218 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.modules.system.pojo.entity.Region;
import org.springblade.modules.system.excel.RegionExcel;
import org.springblade.modules.system.excel.RegionImporter;
import org.springblade.modules.system.service.IRegionService;
import org.springblade.modules.system.pojo.vo.RegionVO;
import org.springblade.modules.system.wrapper.RegionWrapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 行政区划表 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@PreAuth(menu = "region")
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/region")
@Tag(name = "行政区划", description = "行政区划")
public class RegionController extends BladeController {
private final IRegionService regionService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入region")
public R<RegionVO> detail(Region region) {
Region detail = regionService.getOne(Condition.getQueryWrapper(region));
return R.data(RegionWrapper.build().entityVO(detail));
}
/**
* 分页 行政区划表
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入region")
public R<IPage<Region>> list(Region region, Query query) {
IPage<Region> pages = regionService.page(Condition.getPage(query), Condition.getQueryWrapper(region));
return R.data(pages);
}
/**
* 懒加载列表
*/
@GetMapping("/lazy-list")
@Parameters({
@Parameter(name = "code", description = "区划编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "name", description = "区划名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "懒加载列表", description = "传入menu")
public R<List<RegionVO>> lazyList(String parentCode, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<RegionVO> list = regionService.lazyList(parentCode, menu);
return R.data(RegionWrapper.build().listNodeLazyVO(list));
}
/**
* 懒加载列表
*/
@GetMapping("/lazy-tree")
@Parameters({
@Parameter(name = "code", description = "区划编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "name", description = "区划名称", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 4)
@Operation(summary = "懒加载列表", description = "传入menu")
public R<List<RegionVO>> lazyTree(String parentCode, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<RegionVO> list = regionService.lazyTree(parentCode, menu);
return R.data(RegionWrapper.build().listNodeLazyVO(list));
}
/**
* 新增 行政区划表
*/
@PostMapping("/save")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增", description = "传入region")
public R save(@Valid @RequestBody Region region) {
return R.status(regionService.save(region));
}
/**
* 修改 行政区划表
*/
@PostMapping("/update")
@ApiOperationSupport(order = 6)
@Operation(summary = "修改", description = "传入region")
public R update(@Valid @RequestBody Region region) {
return R.status(regionService.updateById(region));
}
/**
* 新增或修改 行政区划表
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 7)
@Operation(summary = "新增或修改", description = "传入region")
public R submit(@Valid @RequestBody Region region) {
return R.status(regionService.submit(region));
}
/**
* 删除 行政区划表
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 8)
@Operation(summary = "删除", description = "传入主键")
public R remove(@Parameter(description = "主键", required = true) @RequestParam String id) {
return R.status(regionService.removeRegion(id));
}
/**
* 行政区划下拉数据源
*/
@GetMapping("/select")
@ApiOperationSupport(order = 9)
@Operation(summary = "下拉数据源", description = "传入tenant")
public R<List<Region>> select(@RequestParam(required = false, defaultValue = "00") String code) {
List<Region> list = regionService.list(Wrappers.<Region>query().lambda().eq(Region::getParentCode, code));
return R.data(list);
}
/**
* 导入行政区划数据
*/
@PostMapping("import-region")
@ApiOperationSupport(order = 10)
@Operation(summary = "导入行政区划", description = "传入excel")
public R importRegion(MultipartFile file, Integer isCovered) {
RegionImporter regionImporter = new RegionImporter(regionService, isCovered == 1);
ExcelUtil.save(file, regionImporter, RegionExcel.class);
return R.success("操作成功");
}
/**
* 导出行政区划数据
*/
@GetMapping("export-region")
@ApiOperationSupport(order = 11)
@Operation(summary = "导出行政区划", description = "传入user")
public void exportRegion(@Parameter(hidden = true) @RequestParam Map<String, Object> region, HttpServletResponse response) {
QueryWrapper<Region> queryWrapper = Condition.getQueryWrapper(region, Region.class);
List<RegionExcel> list = regionService.exportRegion(queryWrapper);
ExcelUtil.export(response, "行政区划数据" + DateUtil.time(), "行政区划数据表", list, RegionExcel.class);
}
/**
* 导出模板
*/
@GetMapping("export-template")
@ApiOperationSupport(order = 12)
@Operation(summary = "导出模板")
public void exportUser(HttpServletResponse response) {
List<RegionExcel> list = new ArrayList<>();
ExcelUtil.export(response, "行政区划模板", "行政区划表", list, RegionExcel.class);
}
}

View File

@@ -0,0 +1,195 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.SysCache;
import org.springblade.common.cache.UserCache;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.secure.constant.AuthConstant;
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.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.Role;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.pojo.vo.GrantVO;
import org.springblade.modules.system.pojo.vo.RoleVO;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.wrapper.RoleWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdmin
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/role")
@Tag(name = "角色", description = "角色")
public class RoleController extends BladeController {
private final IRoleService roleService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入role")
public R<RoleVO> detail(Role role) {
Role detail = roleService.getOne(Condition.getQueryWrapper(role));
return R.data(RoleWrapper.build().entityVO(detail));
}
/**
* 列表
*/
@GetMapping("/list")
@Parameters({
@Parameter(name = "roleName", description = "参数名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "roleAlias", description = "角色别名", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "列表", description = "传入role")
public R<List<RoleVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> role, BladeUser bladeUser) {
QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class);
List<Role> list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(RoleWrapper.build().listNodeVO(list));
}
/**
* 获取角色树形结构
*/
@GetMapping("/tree")
@ApiOperationSupport(order = 3)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<RoleVO>> tree(String tenantId, BladeUser bladeUser) {
List<RoleVO> tree = roleService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()));
return R.data(tree);
}
/**
* 获取指定角色树形结构
*/
@GetMapping("/tree-by-id")
@ApiOperationSupport(order = 4)
@Operation(summary = "树形结构", description = "树形结构")
public R<List<RoleVO>> treeById(Long roleId, BladeUser bladeUser) {
Role role = SysCache.getRole(roleId);
List<RoleVO> tree = roleService.tree(Func.notNull(role) ? role.getTenantId() : bladeUser.getTenantId());
return R.data(tree);
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入role")
public R submit(@Valid @RequestBody Role role) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(roleService.submit(role));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(roleService.removeRole(ids));
}
/**
* 设置角色权限
*/
@PostMapping("/grant")
@ApiOperationSupport(order = 7)
@Operation(summary = "权限设置", description = "传入roleId集合以及menuId集合")
public R grant(@RequestBody GrantVO grantVO) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
boolean temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds(), grantVO.getApiScopeIds());
return R.status(temp);
}
/**
* 下拉数据源
*/
@PreAuth(AuthConstant.PERMIT_ALL)
@GetMapping("/select")
@ApiOperationSupport(order = 8)
@Operation(summary = "下拉数据源", description = "传入id集合")
public R<List<Role>> select(Long userId, String roleId) {
if (Func.isNotEmpty(userId)) {
User user = UserCache.getUser(userId);
roleId = user.getRoleId();
}
List<Role> list = roleService.list(Wrappers.<Role>lambdaQuery().in(Role::getId, Func.toLongList(roleId)));
return R.data(list);
}
/**
* 获取现有角色别名列表
*/
@GetMapping("/alias")
@ApiOperationSupport(order = 9)
@Operation(summary = "获取角色别名", description = "获取角色别名")
public R<List<Role>> alias() {
return R.data(roleService.alias(AuthUtil.getTenantId()));
}
}

View File

@@ -0,0 +1,167 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springblade.core.launch.constant.AppConstant;
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.modules.system.pojo.entity.Post;
import org.springblade.modules.system.pojo.vo.DeptVO;
import org.springblade.modules.system.pojo.vo.PostVO;
import org.springblade.modules.system.pojo.vo.RoleVO;
import org.springblade.modules.system.pojo.vo.UserVO;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IPostService;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.wrapper.PostWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 查询控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/search")
@Tag(name = "信息查询", description = "信息查询")
public class SearchController {
private final IRoleService roleService;
private final IDeptService deptService;
private final IPostService postService;
private final IUserService userService;
/**
* 角色信息查询
*/
@GetMapping("/role")
@ApiOperationSupport(order = 1)
@Operation(summary = "角色信息查询", description = "传入roleName或者parentId")
public R<List<RoleVO>> roleSearch(String roleName, Long parentId) {
return R.data(roleService.search(roleName, parentId));
}
/**
* 部门信息查询
*/
@GetMapping("/dept")
@ApiOperationSupport(order = 2)
@Operation(summary = "部门信息查询", description = "传入deptName或者parentId")
public R<List<DeptVO>> deptSearch(String deptName, Long parentId) {
return R.data(deptService.search(deptName, parentId));
}
/**
* 岗位信息查询
*/
@GetMapping("/post")
@ApiOperationSupport(order = 3)
@Operation(summary = "岗位信息查询", description = "传入postName")
public R<IPage<PostVO>> postSearch(String postName, Query query) {
LambdaQueryWrapper<Post> queryWrapper = Wrappers.<Post>query().lambda();
if (Func.isNotBlank(postName)) {
queryWrapper.like(Post::getPostName, postName);
}
IPage<Post> pages = postService.page(Condition.getPage(query), queryWrapper);
return R.data(PostWrapper.build().pageVO(pages));
}
/**
* 用户列表查询
*/
@Parameters({
@Parameter(name = "name", description = "人员姓名", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "deptName", description = "部门名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "postName", description = "职位名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "current", description = "当前页数", in = ParameterIn.QUERY, schema = @Schema(type = "int")),
@Parameter(name = "size", description = "每页数量", in = ParameterIn.QUERY, schema = @Schema(type = "int"))
})
@ApiOperationSupport(order = 4)
@Operation(summary = "用户列表查询", description = "用户列表查询")
@GetMapping("/user")
public R<IPage<UserVO>> userSearch(@Parameter(hidden = true) UserVO user, @Parameter(hidden = true) Query query) {
return R.data(userService.selectUserSearch(user, query));
}
/**
* 获取用户的主管信息
*/
@GetMapping("/leader-info")
@ApiOperationSupport(order = 5)
@Operation(summary = "获取用户的主管信息", description = "传入userId")
public R<List<UserVO>> leaderInfo(@Parameter(description = "userId", required = true) Long userId) {
List<UserVO> list = userService.leaderInfo(userId);
return R.data(list);
}
/**
* 获取部门的主管信息
*/
@GetMapping("/dept-leader-info")
@ApiOperationSupport(order = 6)
@Operation(summary = "获取部门的主管信息", description = "传入deptId")
public R<List<UserVO>> deptLeaderInfo(@Parameter(description = "部门id", required = true) Long deptId) {
List<UserVO> list = deptService.deptLeaderInfo(deptId);
return R.data(list);
}
/**
* 获取主管列表
*/
@GetMapping("/leader-list")
@ApiOperationSupport(order = 7)
@Operation(summary = "获取主管列表", description = "获取所有主管用户列表")
public R<List<UserVO>> leaderList(@Parameter(description = "租户编号") String tenantId, @Parameter(description = "用户姓名") String realName) {
List<UserVO> list = userService.leaderList(tenantId, realName);
return R.data(list);
}
}

View File

@@ -0,0 +1,274 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
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.annotation.IsAdmin;
import org.springblade.core.secure.annotation.IsAdministrator;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.Tenant;
import org.springblade.modules.system.pojo.entity.TenantPackage;
import org.springblade.modules.system.pojo.vo.TenantVO;
import org.springblade.modules.system.service.ITenantPackageService;
import org.springblade.modules.system.service.ITenantService;
import org.springblade.modules.system.wrapper.TenantWrapper;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static org.springblade.common.cache.SysCache.TENANT_PACKAGE_ID;
import static org.springblade.common.cache.SysCache.TENANT_TENANT_ID;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
import static org.springblade.core.tenant.constant.TenantBaseConstant.TENANT_DATASOURCE_CACHE;
import static org.springblade.core.tenant.constant.TenantBaseConstant.TENANT_DATASOURCE_EXIST_KEY;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/tenant")
@Tag(name = "租户管理", description = "租户管理")
public class TenantController extends BladeController {
private final ITenantService tenantService;
private final ITenantPackageService tenantPackageService;
/**
* 详情
*/
@IsAdmin
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入tenant")
public R<Tenant> detail(Tenant tenant) {
Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant));
return R.data(detail);
}
/**
* 分页
*/
@IsAdmin
@GetMapping("/list")
@Parameters({
@Parameter(name = "tenantId", description = "参数名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "tenantName", description = "角色别名", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "contactNumber", description = "联系电话", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入tenant")
public R<IPage<Tenant>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> tenant, Query query, BladeUser bladeUser) {
TenantWrapper.build().entityQuery(tenant);
QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class);
IPage<Tenant> pages = tenantService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(pages);
}
/**
* 下拉数据源
*/
@GetMapping("/select")
@ApiOperationSupport(order = 3)
@Operation(summary = "下拉数据源", description = "传入tenant")
public R<List<TenantVO>> select(Tenant tenant, BladeUser bladeUser) {
LambdaQueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant).lambda();
queryWrapper.eq(Tenant::getStatus, BladeConstant.DB_STATUS_NORMAL);
if (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) {
queryWrapper.eq(Tenant::getTenantId, bladeUser.getTenantId());
}
List<Tenant> list = tenantService.list(queryWrapper);
return R.data(TenantWrapper.build().listVO(list));
}
/**
* 自定义分页
*/
@IsAdmin
@GetMapping("/page")
@ApiOperationSupport(order = 4)
@Operation(summary = "分页", description = "传入tenant")
public R<IPage<Tenant>> page(Tenant tenant, Query query) {
IPage<Tenant> pages = tenantService.selectTenantPage(Condition.getPage(query), tenant);
return R.data(pages);
}
/**
* 新增或修改
*/
@IsAdministrator
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入tenant")
public R submit(@Valid @RequestBody Tenant tenant) {
return R.status(tenantService.submitTenant(tenant));
}
/**
* 删除至回收站
*/
@IsAdministrator
@PostMapping("/recycle")
@ApiOperationSupport(order = 6)
@Operation(summary = "删除至回收站", description = "传入ids")
public R recycle(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(tenantService.recycleTenant(Func.toLongList(ids)));
}
/**
* 从回收站恢复
*/
@IsAdministrator
@PostMapping("/pass")
@ApiOperationSupport(order = 7)
@Operation(summary = "从回收站恢复", description = "传入ids")
public R pass(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(tenantService.passTenant(Func.toLongList(ids)));
}
/**
* 从回收站删除
*/
@IsAdministrator
@PostMapping("/remove")
@ApiOperationSupport(order = 8)
@Operation(summary = "从回收站删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(tenantService.removeTenant(Func.toLongList(ids)));
}
/**
* 授权配置
*/
@IsAdministrator
@PostMapping("/setting")
@ApiOperationSupport(order = 9)
@Operation(summary = "授权配置", description = "传入ids,accountNumber,expireTime")
public R setting(@Parameter(description = "主键集合", required = true) @RequestParam String ids, @Parameter(description = "账号额度") Integer accountNumber, @Parameter(description = "过期时间") Date expireTime) {
return R.status(tenantService.setting(accountNumber, expireTime, ids));
}
/**
* 数据源配置
*/
@IsAdministrator
@PostMapping("datasource")
@ApiOperationSupport(order = 10)
@Operation(summary = "数据源配置", description = "传入datasource_id")
public R datasource(@Parameter(description = "租户ID", required = true) @RequestParam String tenantId, @Parameter(description = "数据源ID", required = true) @RequestParam Long datasourceId) {
CacheUtil.evict(TENANT_DATASOURCE_CACHE, TENANT_DATASOURCE_EXIST_KEY, tenantId, Boolean.FALSE);
return R.status(tenantService.update(Wrappers.<Tenant>update().lambda().set(Tenant::getDatasourceId, datasourceId).eq(Tenant::getTenantId, tenantId)));
}
/**
* 根据名称查询列表
*
* @param name 租户名称
*/
@IsAdmin
@GetMapping("/find-by-name")
@ApiOperationSupport(order = 11)
@Operation(summary = "详情", description = "传入tenant")
public R<List<Tenant>> findByName(String name) {
List<Tenant> list = tenantService.list(Wrappers.<Tenant>query().lambda().like(Tenant::getTenantName, name));
return R.data(list);
}
/**
* 根据域名查询信息
*
* @param domain 域名
*/
@GetMapping("/info")
@ApiOperationSupport(order = 12)
@Operation(summary = "配置信息", description = "传入domain")
public R<Kv> info(String domain) {
Tenant tenant = tenantService.getOne(Wrappers.<Tenant>query().lambda().eq(Tenant::getDomainUrl, domain));
Kv kv = Kv.create();
if (tenant != null) {
kv.set("tenantId", tenant.getTenantId())
.set("domain", tenant.getDomainUrl())
.set("backgroundUrl", tenant.getBackgroundUrl());
}
return R.data(kv);
}
/**
* 根据租户ID查询产品包详情
*
* @param tenantId 租户ID
*/
@IsAdministrator
@GetMapping("/package-detail")
@ApiOperationSupport(order = 13)
@Operation(summary = "产品包详情", description = "传入tenantId")
public R<TenantPackage> packageDetail(Long tenantId) {
Tenant tenant = tenantService.getById(tenantId);
return R.data(tenantPackageService.getById(tenant.getPackageId()));
}
/**
* 产品包配置
*/
@IsAdministrator
@PostMapping("/package-setting")
@ApiOperationSupport(order = 14)
@Operation(summary = "产品包配置", description = "传入packageId")
public R packageSetting(@Parameter(description = "租户ID", required = true) @RequestParam String tenantId, @Parameter(description = "产品包ID") Long packageId) {
CacheUtil.evict(SYS_CACHE, TENANT_TENANT_ID, tenantId, Boolean.FALSE);
CacheUtil.evict(SYS_CACHE, TENANT_PACKAGE_ID, tenantId, Boolean.FALSE);
return R.status(tenantService.update(Wrappers.<Tenant>update().lambda().set(Tenant::getPackageId, packageId).eq(Tenant::getTenantId, tenantId)));
}
}

View File

@@ -0,0 +1,142 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdministrator;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.system.pojo.entity.TenantDatasource;
import org.springblade.modules.system.service.ITenantDatasourceService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 多租户数据源表 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdministrator
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/tenant-datasource")
@Tag(name = "多租户数据源表", description = "多租户数据源表接口")
public class TenantDatasourceController extends BladeController {
private final ITenantDatasourceService datasourceService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入datasource")
public R<TenantDatasource> detail(TenantDatasource datasource) {
TenantDatasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource));
return R.data(detail);
}
/**
* 分页 数据源配置表
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入datasource")
public R<IPage<TenantDatasource>> list(TenantDatasource datasource, Query query) {
IPage<TenantDatasource> pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource));
return R.data(pages);
}
/**
* 新增 数据源配置表
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入datasource")
public R save(@Valid @RequestBody TenantDatasource datasource) {
return R.status(datasourceService.save(datasource));
}
/**
* 修改 数据源配置表
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入datasource")
public R update(@Valid @RequestBody TenantDatasource datasource) {
return R.status(datasourceService.updateById(datasource));
}
/**
* 新增或修改 数据源配置表
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入datasource")
public R submit(@Valid @RequestBody TenantDatasource datasource) {
if (StringUtil.isNotBlank(datasource.getUrl())) {
datasource.setUrl(datasource.getUrl().replace("&amp;", "&"));
}
return R.status(datasourceService.saveOrUpdate(datasource));
}
/**
* 删除 数据源配置表
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(datasourceService.deleteLogic(Func.toLongList(ids)));
}
/**
* 数据源列表
*/
@GetMapping("/select")
@ApiOperationSupport(order = 8)
@Operation(summary = "下拉数据源", description = "查询列表")
public R<List<TenantDatasource>> select() {
List<TenantDatasource> list = datasourceService.list();
return R.data(list);
}
}

View File

@@ -0,0 +1,149 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdministrator;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.TenantPackage;
import org.springblade.modules.system.service.ITenantPackageService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 租户产品表 控制器
*
* @author BladeX
*/
@RestController
@AllArgsConstructor
@IsAdministrator
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/tenant-package")
@Tag(name = "租户产品包", description = "租户产品包")
public class TenantPackageController extends BladeController {
private final ITenantPackageService tenantPackageService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入tenantPackage")
public R<TenantPackage> detail(TenantPackage tenantPackage) {
TenantPackage detail = tenantPackageService.getOne(Condition.getQueryWrapper(tenantPackage));
return R.data(detail);
}
/**
* 分页 租户产品表
*/
@GetMapping("/list")
@Parameters({
@Parameter(name = "packageName", description = "产品包名", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入tenantPackage")
public R<IPage<TenantPackage>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> tenantPackage, Query query) {
IPage<TenantPackage> pages = tenantPackageService.page(Condition.getPage(query), Condition.getQueryWrapper(tenantPackage, TenantPackage.class));
return R.data(pages);
}
/**
* 新增 租户产品表
*/
@PostMapping("/save")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增", description = "传入tenantPackage")
public R save(@Valid @RequestBody TenantPackage tenantPackage) {
return R.status(tenantPackageService.save(tenantPackage));
}
/**
* 修改 租户产品表
*/
@PostMapping("/update")
@ApiOperationSupport(order = 4)
@Operation(summary = "修改", description = "传入tenantPackage")
public R update(@Valid @RequestBody TenantPackage tenantPackage) {
return R.status(tenantPackageService.updateById(tenantPackage));
}
/**
* 新增或修改 租户产品表
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入tenantPackage")
public R submit(@Valid @RequestBody TenantPackage tenantPackage) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(tenantPackageService.saveOrUpdate(tenantPackage));
}
/**
* 删除 租户产品表
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
return R.status(tenantPackageService.deleteLogic(Func.toLongList(ids)));
}
/**
* 下拉数据源
*/
@GetMapping("/select")
@ApiOperationSupport(order = 7)
@Operation(summary = "下拉数据源", description = "传入tenant")
public R<List<TenantPackage>> select(TenantPackage tenantPackage) {
return R.data(tenantPackageService.list(Condition.getQueryWrapper(tenantPackage)));
}
}

View File

@@ -0,0 +1,144 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.pojo.entity.TopMenu;
import org.springblade.modules.system.pojo.vo.GrantVO;
import org.springblade.modules.system.service.ITopMenuService;
import org.springframework.web.bind.annotation.*;
import static org.springblade.core.cache.constant.CacheConstant.MENU_CACHE;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
* 顶部菜单表 控制器
*
* @author BladeX
*/
@NonDS
@RestController
@AllArgsConstructor
@IsAdmin
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/topmenu")
@Tag(name = "顶部菜单表", description = "顶部菜单")
public class TopMenuController extends BladeController {
private final ITopMenuService topMenuService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入topMenu")
public R<TopMenu> detail(TopMenu topMenu) {
TopMenu detail = topMenuService.getOne(Condition.getQueryWrapper(topMenu));
return R.data(detail);
}
/**
* 分页 顶部菜单表
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入topMenu")
public R<IPage<TopMenu>> list(TopMenu topMenu, Query query) {
IPage<TopMenu> pages = topMenuService.page(Condition.getPage(query), Condition.getQueryWrapper(topMenu).lambda().orderByAsc(TopMenu::getSort));
return R.data(pages);
}
/**
* 新增 顶部菜单表
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入topMenu")
public R save(@Valid @RequestBody TopMenu topMenu) {
return R.status(topMenuService.save(topMenu));
}
/**
* 修改 顶部菜单表
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入topMenu")
public R update(@Valid @RequestBody TopMenu topMenu) {
return R.status(topMenuService.updateById(topMenu));
}
/**
* 新增或修改 顶部菜单表
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入topMenu")
public R submit(@Valid @RequestBody TopMenu topMenu) {
return R.status(topMenuService.saveOrUpdate(topMenu));
}
/**
* 删除 顶部菜单表
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(topMenuService.deleteLogic(Func.toLongList(ids)));
}
/**
* 设置顶部菜单
*/
@PostMapping("/grant")
@ApiOperationSupport(order = 8)
@Operation(summary = "顶部菜单配置", description = "传入topMenuId集合以及menuId集合")
public R grant(@RequestBody GrantVO grantVO) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(MENU_CACHE);
CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
boolean temp = topMenuService.grant(grantVO.getTopMenuIds(), grantVO.getMenuIds());
return R.status(temp);
}
}

View File

@@ -0,0 +1,369 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.launch.constant.AppConstant;
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.annotation.IsAdmin;
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.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.excel.UserImporter;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.pojo.vo.UserVO;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.wrapper.UserWrapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/user")
@Tag(name = "用户", description = "用户")
public class UserController {
private final IUserService userService;
/**
* 查询单条
*/
@IsAdmin
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "查看详情", description = "传入id")
public R<UserVO> detail(User user) {
User detail = userService.getOne(Condition.getQueryWrapper(user));
return R.data(UserWrapper.build().entityVO(detail));
}
/**
* 查询单条
*/
@GetMapping("/info")
@ApiOperationSupport(order = 2)
@Operation(summary = "查看详情", description = "传入id")
public R<UserVO> info(BladeUser user) {
User detail = userService.getById(user.getUserId());
return R.data(UserWrapper.build().entityVO(detail));
}
/**
* 用户列表
*/
@IsAdmin
@GetMapping("/list")
@Parameters({
@Parameter(name = "account", description = "账号名", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "realName", description = "姓名", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "列表", description = "传入account和realName")
public R<IPage<UserVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) {
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
IPage<User> pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(UserWrapper.build().pageVO(pages));
}
/**
* 自定义用户列表
*/
@IsAdmin
@GetMapping("/page")
@Parameters({
@Parameter(name = "account", description = "账号名", in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "realName", description = "姓名", in = ParameterIn.QUERY, schema = @Schema(type = "string"))
})
@ApiOperationSupport(order = 3)
@Operation(summary = "列表", description = "传入account和realName")
public R<IPage<UserVO>> page(@Parameter(hidden = true) User user, Query query, Long deptId, BladeUser bladeUser) {
IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
return R.data(UserWrapper.build().pageVO(pages));
}
/**
* 新增或修改
*/
@IsAdmin
@PostMapping("/submit")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增或修改", description = "传入User")
public R submit(@Valid @RequestBody User user) {
return R.status(userService.submit(user));
}
/**
* 修改
*/
@IsAdmin
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入User")
public R update(@Valid @RequestBody User user) {
return R.status(userService.updateUser(user));
}
/**
* 删除
*/
@IsAdmin
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "删除", description = "传入id集合")
public R remove(@RequestParam String ids) {
return R.status(userService.removeUser(ids));
}
/**
* 设置菜单权限
*/
@IsAdmin
@PostMapping("/grant")
@ApiOperationSupport(order = 7)
@Operation(summary = "权限设置", description = "传入roleId集合以及menuId集合")
public R grant(@Parameter(description = "userId集合", required = true) @RequestParam String userIds,
@Parameter(description = "roleId集合", required = true) @RequestParam String roleIds) {
boolean temp = userService.grant(userIds, roleIds);
return R.status(temp);
}
/**
* 重置密码
*/
@IsAdmin
@PostMapping("/reset-password")
@ApiOperationSupport(order = 8)
@Operation(summary = "初始化密码", description = "传入userId集合")
public R resetPassword(@Parameter(description = "userId集合", required = true) @RequestParam String userIds) {
boolean temp = userService.resetPassword(userIds);
return R.status(temp);
}
/**
* 修改密码
*/
@PostMapping("/update-password")
@ApiOperationSupport(order = 9)
@Operation(summary = "修改密码", description = "传入密码")
public R updatePassword(BladeUser user, @Parameter(description = "旧密码", required = true) @RequestParam String oldPassword,
@Parameter(description = "新密码", required = true) @RequestParam String newPassword,
@Parameter(description = "新密码", required = true) @RequestParam String newPassword1) {
boolean temp = userService.updatePassword(user.getUserId(), oldPassword, newPassword, newPassword1);
return R.status(temp);
}
/**
* 修改基本信息
*/
@PostMapping("/update-info")
@ApiOperationSupport(order = 10)
@Operation(summary = "修改基本信息", description = "传入User")
public R updateInfo(@Valid @RequestBody User user) {
return R.status(userService.updateUserInfo(user));
}
/**
* 用户列表
*/
@GetMapping("/user-list")
@ApiOperationSupport(order = 11)
@Operation(summary = "用户列表", description = "传入user")
public R<List<UserVO>> userList(User user, BladeUser bladeUser) {
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user);
List<User> list = userService.list((!AuthUtil.isAdministrator()) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(UserWrapper.build().listVO(list));
}
/**
* 导入用户
*/
@IsAdmin
@PostMapping("import-user")
@ApiOperationSupport(order = 12)
@Operation(summary = "导入用户", description = "传入excel")
public R importUser(MultipartFile file, Integer isCovered) {
UserImporter userImporter = new UserImporter(userService, isCovered == 1);
ExcelUtil.save(file, userImporter, UserExcel.class);
return R.success("操作成功");
}
/**
* 导出用户
*/
@IsAdmin
@GetMapping("export-user")
@ApiOperationSupport(order = 13)
@Operation(summary = "导出用户", description = "传入user")
public void exportUser(@Parameter(hidden = true) @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
if (!AuthUtil.isAdministrator()) {
queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId());
}
queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<UserExcel> list = userService.exportUser(queryWrapper);
ExcelUtil.export(response, "用户数据" + DateUtil.time(), "用户数据表", list, UserExcel.class);
}
/**
* 导出模板
*/
@GetMapping("export-template")
@ApiOperationSupport(order = 14)
@Operation(summary = "导出模板")
public void exportUser(HttpServletResponse response) {
List<UserExcel> list = new ArrayList<>();
ExcelUtil.export(response, "用户数据模板", "用户数据表", list, UserExcel.class);
}
/**
* 第三方注册用户
*/
@PostMapping("/register-guest")
@ApiOperationSupport(order = 15)
@Operation(summary = "第三方注册用户", description = "传入user")
public R registerGuest(User user, Long oauthId) {
return R.status(userService.registerGuest(user, oauthId));
}
/**
* 配置用户平台信息
*/
@PostMapping("/update-platform")
@ApiOperationSupport(order = 16)
@Operation(summary = "配置用户平台信息", description = "传入user")
public R updatePlatform(Long userId, Integer userType, String userExt) {
return R.status(userService.updatePlatform(userId, userType, userExt));
}
/**
* 查看平台详情
*/
@IsAdmin
@GetMapping("/platform-detail")
@ApiOperationSupport(order = 17)
@Operation(summary = "查看平台详情", description = "传入id")
public R<UserVO> platformDetail(User user) {
return R.data(userService.platformDetail(user));
}
/**
* 用户解锁
*/
@IsAdmin
@PostMapping("/unlock")
@ApiOperationSupport(order = 18)
@Operation(summary = "账号解锁", description = "传入id集合")
public R unlock(String userIds) {
return R.status(userService.unlock(userIds));
}
/**
* 审核通过
*/
@IsAdmin
@PostMapping("/audit-pass")
@ApiOperationSupport(order = 19)
@Operation(summary = "审核通过", description = "传入id集合")
public R auditPass(String userIds) {
return R.status(userService.auditPass(userIds));
}
/**
* 审核拒绝
*/
@IsAdmin
@PostMapping("/audit-refuse")
@ApiOperationSupport(order = 20)
@Operation(summary = "审核拒绝", description = "传入id集合")
public R auditRefuse(String userIds) {
return R.status(userService.auditRefuse(userIds));
}
/**
* 设置用户为主管
*/
@IsAdmin
@PostMapping("/set-leader")
@ApiOperationSupport(order = 21)
@Operation(summary = "设置用户为主管", description = "传入userId")
public R setLeader(@Parameter(description = "userId", required = true) @RequestParam Long userId) {
return R.status(userService.setLeader(userId));
}
/**
* 获取用户的主管信息
*/
@IsAdmin
@GetMapping("/leader-info")
@ApiOperationSupport(order = 22)
@Operation(summary = "获取用户的主管信息", description = "传入userId")
public R<List<UserVO>> leaderInfo(@Parameter(description = "userId", required = true) @RequestParam Long userId) {
List<UserVO> list = userService.leaderInfo(userId);
return R.data(list);
}
/**
* 获取主管列表
*/
@IsAdmin
@GetMapping("/leader-list")
@ApiOperationSupport(order = 23)
@Operation(summary = "获取主管列表", description = "获取所有主管用户列表")
public R<List<UserVO>> leaderList(@Parameter(description = "租户编号") String tenantId, @Parameter(description = "用户姓名") String realName) {
List<UserVO> list = userService.leaderList(tenantId, realName);
return R.data(list);
}
}

View File

@@ -0,0 +1,101 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.excel;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* RegionExcel
*
* @author Chill
*/
@Data
@ColumnWidth(16)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class RegionExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelProperty("区划编号")
private String code;
@ExcelProperty("父区划编号")
private String parentCode;
@ExcelProperty("祖区划编号")
private String ancestors;
@ExcelProperty("区划名称")
private String name;
@ExcelProperty("省级区划编号")
private String provinceCode;
@ExcelProperty("省级名称")
private String provinceName;
@ExcelProperty("市级区划编号")
private String cityCode;
@ExcelProperty("市级名称")
private String cityName;
@ExcelProperty("区级区划编号")
private String districtCode;
@ExcelProperty("区级名称")
private String districtName;
@ExcelProperty("镇级区划编号")
private String townCode;
@ExcelProperty("镇级名称")
private String townName;
@ExcelProperty("村级区划编号")
private String villageCode;
@ExcelProperty("村级名称")
private String villageName;
@ExcelProperty("层级")
private Integer regionLevel;
@ExcelProperty("排序")
private Integer sort;
@ExcelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.modules.system.service.IRegionService;
import java.util.List;
/**
* 行政区划数据导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class RegionImporter implements ExcelImporter<RegionExcel> {
private final IRegionService service;
private final Boolean isCovered;
@Override
public void save(List<RegionExcel> data) {
service.importRegion(data, isCovered);
}
}

View File

@@ -0,0 +1,108 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* UserExcel
*
* @author Chill
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class UserExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ColumnWidth(15)
@ExcelProperty("租户编号")
private String tenantId;
@ExcelIgnore
@ExcelProperty("用户平台")
private String userType;
@ColumnWidth(20)
@ExcelProperty("用户平台名称")
private String userTypeName;
@ColumnWidth(15)
@ExcelProperty("账户")
private String account;
@ColumnWidth(10)
@ExcelProperty("昵称")
private String name;
@ColumnWidth(10)
@ExcelProperty("姓名")
private String realName;
@ExcelProperty("邮箱")
private String email;
@ColumnWidth(15)
@ExcelProperty("手机")
private String phone;
@ExcelIgnore
@ExcelProperty("角色ID")
private String roleId;
@ExcelIgnore
@ExcelProperty("部门ID")
private String deptId;
@ExcelIgnore
@ExcelProperty("岗位ID")
private String postId;
@ExcelProperty("角色名称")
private String roleName;
@ExcelProperty("部门名称")
private String deptName;
@ExcelProperty("岗位名称")
private String postName;
@ColumnWidth(20)
@ExcelProperty("生日")
private Date birthday;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.modules.system.service.IUserService;
import java.util.List;
/**
* 用户数据导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class UserImporter implements ExcelImporter<UserExcel> {
private final IUserService service;
private final Boolean isCovered;
@Override
public void save(List<UserExcel> data) {
service.importUser(data, isCovered);
}
}

View File

@@ -0,0 +1,52 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.system.pojo.entity.ApiKey;
import org.springblade.modules.system.pojo.vo.ApiKeyVO;
import java.util.List;
/**
* 令牌权限 Mapper 接口
*
* @author Chill
*/
public interface ApiKeyMapper extends BaseMapper<ApiKey> {
/**
* 自定义分页
*
* @param page 分页
* @param apiKey 实体
* @return List<ApiKeyVO>
*/
List<ApiKeyVO> selectApiKeyPage(IPage<ApiKeyVO> page, ApiKeyVO apiKey);
}

View File

@@ -0,0 +1,60 @@
<?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.modules.system.mapper.ApiKeyMapper">
<!-- 通用查询映射结果 -->
<resultMap id="apiKeyResultMap" type="org.springblade.modules.system.pojo.entity.ApiKey">
<id column="api_key" property="apiKey"/>
<result column="user_id" property="userId"/>
<result column="tenant_id" property="tenantId"/>
<result column="name" property="name"/>
<result column="expire_time" property="expireTime"/>
<result column="ext_params" property="extParams"/>
<result column="api_path" property="apiPath"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<!-- VO查询映射结果 -->
<resultMap id="apiKeyVOResultMap" type="org.springblade.modules.system.pojo.vo.ApiKeyVO">
<id column="api_key" property="apiKey"/>
<result column="user_id" property="userId"/>
<result column="tenant_id" property="tenantId"/>
<result column="name" property="name"/>
<result column="expire_time" property="expireTime"/>
<result column="ext_params" property="extParams"/>
<result column="api_path" property="apiPath"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="is_deleted" property="isDeleted"/>
<result column="user_name" property="userName"/>
<result column="account" property="account"/>
</resultMap>
<select id="selectApiKeyPage" resultMap="apiKeyVOResultMap">
SELECT
k.*,
u.name AS user_name,
u.account AS account
FROM
blade_api_key k
LEFT JOIN blade_user u ON k.user_id = u.id
WHERE
k.is_deleted = 0 AND k.tenant_id = #{apiKey.tenantId}
<if test="apiKey.name != null and apiKey.name != ''">
AND k.name LIKE CONCAT('%', #{apiKey.name}, '%')
</if>
<if test="apiKey.userId != null">
AND k.user_id = #{apiKey.userId}
</if>
<if test="apiKey.status != null">
AND k.status = #{apiKey.status}
</if>
ORDER BY k.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.ApiScope;
/**
* Mapper 接口
*
* @author BladeX
*/
public interface ApiScopeMapper extends BaseMapper<ApiScope> {
}

View File

@@ -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.modules.system.mapper.ApiScopeMapper">
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.AuthClient;
/**
* Mapper 接口
*
* @author Chill
*/
public interface AuthClientMapper extends BaseMapper<AuthClient> {
}

View File

@@ -0,0 +1,27 @@
<?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.modules.system.mapper.AuthClientMapper">
<!-- 通用查询映射结果 -->
<resultMap id="clientResultMap" type="org.springblade.modules.system.pojo.entity.AuthClient">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="client_id" property="clientId"/>
<result column="client_secret" property="clientSecret"/>
<result column="resources_ids" property="resourceIds"/>
<result column="scope" property="scope"/>
<result column="authorized_grant_types" property="authorizedGrantTypes"/>
<result column="web_server_redirect_uri" property="webServerRedirectUri"/>
<result column="authorities" property="authorities"/>
<result column="access_token_validity" property="accessTokenValidity"/>
<result column="refresh_token_validity" property="refreshTokenValidity"/>
<result column="additional_information" property="additionalInformation"/>
<result column="autoapprove" property="autoapprove"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.DataScope;
/**
* Mapper 接口
*
* @author BladeX
*/
public interface DataScopeMapper extends BaseMapper<DataScope> {
}

View File

@@ -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.modules.system.mapper.DataScopeMapper">
</mapper>

View File

@@ -0,0 +1,77 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.Dept;
import org.springblade.modules.system.pojo.vo.DeptVO;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
*
* @author Chill
*/
public interface DeptMapper extends BaseMapper<Dept> {
/**
* 懒加载部门列表
*
* @param tenantId
* @param parentId
* @param param
* @return
*/
List<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param);
/**
* 获取树形节点
*
* @param tenantId
* @return
*/
List<DeptVO> tree(String tenantId);
/**
* 懒加载获取树形节点
*
* @param tenantId
* @param parentId
* @return
*/
List<DeptVO> lazyTree(String tenantId, Long parentId);
/**
* 获取部门名
*
* @param ids
* @return
*/
List<String> getDeptNames(Long[] ids);
}

View File

@@ -0,0 +1,115 @@
<?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.modules.system.mapper.DeptMapper">
<!-- 通用查询映射结果 -->
<resultMap id="deptResultMap" type="org.springblade.modules.system.pojo.entity.Dept">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="dept_name" property="deptName"/>
<result column="full_name" property="fullName"/>
<result column="ancestors" property="ancestors"/>
<result column="dept_category" property="deptCategory"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<resultMap id="deptVOResultMap" type="org.springblade.modules.system.pojo.vo.DeptVO">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="dept_name" property="deptName"/>
<result column="full_name" property="fullName"/>
<result column="ancestors" property="ancestors"/>
<result column="dept_category" property="deptCategory"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="is_deleted" property="isDeleted"/>
<result column="has_children" property="hasChildren"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
<result column="key" property="key"/>
<result column="has_children" property="hasChildren"/>
</resultMap>
<select id="lazyList" resultMap="deptVOResultMap">
SELECT
dept.* ,
(
SELECT
CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
FROM
blade_dept
WHERE
parent_id = dept.id and is_deleted = 0
) AS "has_children"
FROM
blade_dept dept
WHERE dept.is_deleted = 0
<if test="param1!=null and param1!=''">
and dept.tenant_id = #{param1}
</if>
<if test="param2!=null">
and dept.parent_id = #{param2}
</if>
<if test="param3.deptName!=null and param3.deptName!=''">
and dept.dept_name like concat(concat('%', #{param3.deptName}),'%')
</if>
<if test="param3.fullName!=null and param3.fullName!=''">
and dept.full_name like concat(concat('%', #{param3.fullName}),'%')
</if>
ORDER BY dept.sort
</select>
<select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0
<if test="_parameter!=null and _parameter!=''">
and tenant_id = #{_parameter}
</if>
ORDER BY sort
</select>
<select id="lazyTree" resultMap="treeNodeResultMap" >
SELECT
dept.id,
dept.parent_id,
dept.dept_name AS title,
dept.id AS "value",
dept.id AS "key",
(
SELECT
CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
FROM
blade_dept
WHERE
parent_id = dept.id and is_deleted = 0
) AS "has_children"
FROM
blade_dept dept
WHERE
dept.parent_id = #{param2} AND dept.is_deleted = 0
<if test="param1!=null and param1!=''">
and dept.tenant_id = #{param1}
</if>
ORDER BY dept.sort
</select>
<select id="getDeptNames" resultType="java.lang.String">
SELECT
dept_name
FROM
blade_dept
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,77 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.core.tenant.annotation.TenantIgnore;
import org.springblade.modules.system.pojo.entity.DictBiz;
import org.springblade.modules.system.pojo.vo.DictBizVO;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
public interface DictBizMapper extends BaseMapper<DictBiz> {
/**
* 获取字典表对应中文
*
* @param tenantId 租户ID
* @param code 字典编号
* @param dictKey 字典序号
* @return
*/
@TenantIgnore
String getValue(String tenantId, String code, String dictKey);
/**
* 获取字典表
*
* @param tenantId 租户ID
* @param code 字典编号
* @return
*/
@TenantIgnore
List<DictBiz> getList(String tenantId, String code);
/**
* 获取树形节点
*
* @return
*/
List<DictBizVO> tree();
/**
* 获取树形节点
*
* @return
*/
List<DictBizVO> parentTree();
}

View File

@@ -0,0 +1,51 @@
<?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.modules.system.mapper.DictBizMapper">
<!-- 通用查询映射结果 -->
<resultMap id="dictResultMap" type="org.springblade.modules.system.pojo.entity.DictBiz">
<id column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="parent_id" property="parentId"/>
<result column="code" property="code"/>
<result column="dict_key" property="dictKey"/>
<result column="dict_value" property="dictValue"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
<result column="key" property="key"/>
</resultMap>
<select id="getValue" resultType="java.lang.String">
select
dict_value
from blade_dict_biz where tenant_id = #{param1} and code = #{param2} and dict_key = #{param3} and is_deleted = 0
</select>
<!-- oracle 版本 -->
<!--<select id="getValue" resultType="java.lang.String">
select
dict_value
from blade_dict_biz where code = #{param1, jdbcType=VARCHAR} and dict_key = #{param2} and dict_key >= 0 rownum 1
</select>-->
<select id="getList" resultMap="dictResultMap">
select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz where tenant_id = #{param1} and code = #{param2} and parent_id > 0 and is_sealed = 0 and is_deleted = 0 order by sort
</select>
<select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 order by sort
</select>
<select id="parentTree" resultMap="treeNodeResultMap">
select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 and parent_id = 0 order by sort
</select>
</mapper>

View File

@@ -0,0 +1,82 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.system.pojo.entity.Dict;
import org.springblade.modules.system.pojo.vo.DictVO;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
public interface DictMapper extends BaseMapper<Dict> {
/**
* 自定义分页
*
* @param page
* @param dict
* @return
*/
List<DictVO> selectDictPage(IPage page, DictVO dict);
/**
* 获取字典表对应中文
*
* @param code 字典编号
* @param dictKey 字典序号
* @return
*/
String getValue(String code, String dictKey);
/**
* 获取字典表
*
* @param code 字典编号
* @return
*/
List<Dict> getList(String code);
/**
* 获取树形节点
*
* @return
*/
List<DictVO> tree();
/**
* 获取树形节点
*
* @return
*/
List<DictVO> parentTree();
}

View File

@@ -0,0 +1,54 @@
<?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.modules.system.mapper.DictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="dictResultMap" type="org.springblade.modules.system.pojo.entity.Dict">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="code" property="code"/>
<result column="dict_key" property="dictKey"/>
<result column="dict_value" property="dictValue"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
<result column="key" property="key"/>
</resultMap>
<select id="selectDictPage" resultMap="dictResultMap">
select * from blade_dict where is_deleted = 0
</select>
<select id="getValue" resultType="java.lang.String">
select
dict_value
from blade_dict where code = #{param1} and dict_key = #{param2} and is_deleted = 0
</select>
<!-- oracle 版本 -->
<!--<select id="getValue" resultType="java.lang.String">
select
dict_value
from blade_dict where code = #{param1, jdbcType=VARCHAR} and dict_key = #{param2} and dict_key >= 0 rownum 1
</select>-->
<select id="getList" resultMap="dictResultMap">
select id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1} and parent_id > 0 and is_sealed = 0 and is_deleted = 0 order by sort
</select>
<select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 order by sort
</select>
<select id="parentTree" resultMap="treeNodeResultMap">
select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0 order by sort
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.core.log.model.LogApi;
/**
* Mapper 接口
*
* @author Chill
*/
public interface LogApiMapper extends BaseMapper<LogApi> {
}

View File

@@ -0,0 +1,26 @@
<?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.modules.system.mapper.LogApiMapper">
<!-- 通用查询映射结果 -->
<resultMap id="logResultMap" type="org.springblade.core.log.model.LogApi">
<result column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="service_id" property="serviceId"/>
<result column="server_host" property="serverHost"/>
<result column="server_ip" property="serverIp"/>
<result column="env" property="env"/>
<result column="type" property="type"/>
<result column="title" property="title"/>
<result column="method" property="method"/>
<result column="request_uri" property="requestUri"/>
<result column="user_agent" property="userAgent"/>
<result column="remote_ip" property="remoteIp"/>
<result column="method_class" property="methodClass"/>
<result column="method_name" property="methodName"/>
<result column="params" property="params"/>
<result column="time" property="time"/>
<result column="create_by" property="createBy"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.core.log.model.LogError;
/**
* Mapper 接口
*
* @author Chill
*/
public interface LogErrorMapper extends BaseMapper<LogError> {
}

View File

@@ -0,0 +1,27 @@
<?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.modules.system.mapper.LogErrorMapper">
<!-- 通用查询映射结果 -->
<resultMap id="errorLogResultMap" type="org.springblade.core.log.model.LogError">
<result column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="service_id" property="serviceId"/>
<result column="server_host" property="serverHost"/>
<result column="server_ip" property="serverIp"/>
<result column="env" property="env"/>
<result column="method" property="method"/>
<result column="request_uri" property="requestUri"/>
<result column="user_agent" property="userAgent"/>
<result column="stack_trace" property="stackTrace"/>
<result column="exception_name" property="exceptionName"/>
<result column="message" property="message"/>
<result column="line_number" property="lineNumber"/>
<result column="method_class" property="methodClass"/>
<result column="file_name" property="fileName"/>
<result column="method_name" property="methodName"/>
<result column="params" property="params"/>
<result column="create_by" property="createBy"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.core.log.model.LogUsual;
/**
* Mapper 接口
*
* @author Chill
*/
public interface LogUsualMapper extends BaseMapper<LogUsual> {
}

View File

@@ -0,0 +1,22 @@
<?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.modules.system.mapper.LogUsualMapper">
<!-- 通用查询映射结果 -->
<resultMap id="logResultMap" type="org.springblade.core.log.model.LogUsual">
<result column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="service_id" property="serviceId"/>
<result column="server_host" property="serverHost"/>
<result column="server_ip" property="serverIp"/>
<result column="env" property="env"/>
<result column="log_level" property="logLevel"/>
<result column="log_data" property="logData"/>
<result column="method" property="method"/>
<result column="request_uri" property="requestUri"/>
<result column="user_agent" property="userAgent"/>
<result column="params" property="params"/>
<result column="create_by" property="createBy"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,207 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.core.tool.node.TreeNode;
import org.springblade.modules.system.pojo.dto.MenuDTO;
import org.springblade.modules.system.pojo.entity.Menu;
import org.springblade.modules.system.pojo.vo.MenuVO;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
*
* @author Chill
*/
public interface MenuMapper extends BaseMapper<Menu> {
/**
* 懒加载列表
*
* @param parentId
* @param param
* @return
*/
List<MenuVO> lazyList(Long parentId, Map<String, Object> param);
/**
* 懒加载菜单列表
*
* @param parentId
* @param param
* @return
*/
List<MenuVO> lazyMenuList(Long parentId, Map<String, Object> param);
/**
* 树形结构
*
* @return
*/
List<TreeNode> tree();
/**
* 授权树形结构
*
* @return
*/
List<TreeNode> grantTree();
/**
* 授权树形结构
*
* @param roleId
* @return
*/
List<TreeNode> grantTreeByRole(List<Long> roleId);
/**
* 顶部菜单树形结构
*
* @return
*/
List<TreeNode> grantTopTree();
/**
* 顶部菜单树形结构
*
* @param roleId
* @return
*/
List<TreeNode> grantTopTreeByRole(List<Long> roleId);
/**
* 数据权限授权树形结构
*
* @return
*/
List<TreeNode> grantDataScopeTree();
/**
* 接口权限授权树形结构
*
* @return
*/
List<TreeNode> grantApiScopeTree();
/**
* 数据权限授权树形结构
*
* @param roleId
* @return
*/
List<TreeNode> grantDataScopeTreeByRole(List<Long> roleId);
/**
* 接口权限授权树形结构
*
* @param roleId
* @return
*/
List<TreeNode> grantApiScopeTreeByRole(List<Long> roleId);
/**
* 所有菜单
*
* @return
*/
List<Menu> allMenu();
/**
* 权限配置菜单
*
* @param roleId
* @param topMenuId
* @return
*/
List<Menu> roleMenu(List<Long> roleId, Long topMenuId);
/**
* 权限配置菜单
*
* @param roleId
* @return
*/
List<Menu> roleMenuByRoleId(List<Long> roleId);
/**
* 权限配置菜单
*
* @param topMenuId
* @return
*/
List<Menu> roleMenuByTopMenuId(Long topMenuId);
/**
* 所有菜单
*
* @return
*/
List<Menu> allMenuExt();
/**
* 权限配置菜单
*
* @param roleId
* @param topMenuId
* @return
*/
List<Menu> roleMenuExt(List<Long> roleId, Long topMenuId);
/**
* 菜单树形结构
*
* @param roleId
* @return
*/
List<Menu> routes(List<Long> roleId);
/**
* 按钮树形结构
*
* @return
*/
List<Menu> allButtons();
/**
* 按钮树形结构
*
* @param roleId
* @return
*/
List<Menu> buttons(List<Long> roleId);
/**
* 获取配置的角色权限
*
* @param roleIds
* @return
*/
List<MenuDTO> authRoutes(List<Long> roleIds);
}

View File

@@ -0,0 +1,496 @@
<?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.modules.system.mapper.MenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="menuResultMap" type="org.springblade.modules.system.pojo.entity.Menu">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="parent_id" property="parentId"/>
<result column="name" property="name"/>
<result column="alias" property="alias"/>
<result column="path" property="path"/>
<result column="source" property="source"/>
<result column="sort" property="sort"/>
<result column="category" property="category"/>
<result column="action" property="action"/>
<result column="is_open" property="isOpen"/>
<result column="remark" property="remark"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<resultMap id="menuVOResultMap" type="org.springblade.modules.system.pojo.vo.MenuVO">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="parent_id" property="parentId"/>
<result column="name" property="name"/>
<result column="alias" property="alias"/>
<result column="path" property="path"/>
<result column="source" property="source"/>
<result column="sort" property="sort"/>
<result column="category" property="category"/>
<result column="action" property="action"/>
<result column="is_open" property="isOpen"/>
<result column="remark" property="remark"/>
<result column="is_deleted" property="isDeleted"/>
<result column="has_children" property="hasChildren"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
<result column="key" property="key"/>
</resultMap>
<select id="lazyList" resultMap="menuVOResultMap">
SELECT
menu.*,
(
SELECT
CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
FROM
blade_menu
WHERE
parent_id = menu.id AND is_deleted = 0
) AS "has_children"
FROM
blade_menu menu
WHERE menu.is_deleted = 0
<if test="param1!=null">
and menu.parent_id = #{param1}
</if>
<if test="param2.name!=null and param2.name!=''">
and menu.name like concat(concat('%', #{param2.name}),'%')
</if>
<if test="param2.code!=null and param2.code!=''">
and menu.code like concat(concat('%', #{param2.code}),'%')
</if>
<if test="param2.alias!=null and param2.alias!=''">
and menu.alias like concat(concat('%', #{param2.alias}),'%')
</if>
ORDER BY menu.sort
</select>
<select id="lazyMenuList" resultMap="menuVOResultMap">
SELECT
menu.*,
(
SELECT
CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
FROM
blade_menu
WHERE
parent_id = menu.id AND is_deleted = 0 AND category = 1
) AS "has_children"
FROM
blade_menu menu
WHERE menu.is_deleted = 0 AND menu.category = 1
<if test="param1!=null">
and menu.parent_id = #{param1}
</if>
<if test="param2.name!=null and param2.name!=''">
and menu.name like concat(concat('%', #{param2.name}),'%')
</if>
<if test="param2.code!=null and param2.code!=''">
and menu.code like concat(concat('%', #{param2.code}),'%')
</if>
<if test="param2.alias!=null and param2.alias!=''">
and menu.alias like concat(concat('%', #{param2.alias}),'%')
</if>
ORDER BY menu.sort
</select>
<select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, name as title, id as "value", id as "key" from blade_menu where is_deleted = 0 and category = 1
</select>
<select id="allMenu" resultMap="menuResultMap">
select * from blade_menu where is_deleted = 0 and category = 1
</select>
<select id="roleMenu" resultMap="menuResultMap">
select * from blade_menu where is_deleted = 0 and id IN
( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
<if test="param2!=null and param2>0">
AND id IN
(
SELECT menu_id FROM blade_top_menu_setting WHERE top_menu_id = #{param2}
)
</if>
</select>
<select id="roleMenuByRoleId" resultMap="menuResultMap">
select * from blade_menu where is_deleted = 0 and id IN
( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</select>
<select id="roleMenuByTopMenuId" resultMap="menuResultMap">
select * from blade_menu where is_deleted = 0 and id IN
(
SELECT menu_id FROM blade_top_menu_setting WHERE top_menu_id = #{param1}
)
</select>
<select id="allMenuExt" resultMap="menuResultMap">
select * from blade_menu_ext where is_deleted = 0 and category = 1
</select>
<select id="roleMenuExt" resultMap="menuResultMap">
select * from blade_menu_ext where is_deleted = 0 and id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
<if test="param2!=null and param2>0">
AND id IN
(
SELECT menu_id FROM blade_top_menu_setting WHERE top_menu_id = #{param2}
)
</if>
</select>
<select id="routes" resultMap="menuResultMap">
SELECT
*
FROM
blade_menu
WHERE
is_deleted = 0 and category = 1
and id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
</select>
<select id="allButtons" resultMap="menuResultMap">
SELECT
id,
parent_id,
CODE,
NAME,
alias,
path,
source,
action,
sort
FROM
blade_menu
WHERE
(
category = 2 OR id IN ( SELECT parent_id FROM blade_menu WHERE is_deleted = 0 AND category = 2 )
)
AND is_deleted = 0
ORDER BY sort
</select>
<select id="buttons" resultMap="menuResultMap">
SELECT * FROM (
SELECT
id,
parent_id,
code,
name,
alias,
path,
source,
action,
sort
FROM
blade_menu
WHERE
is_deleted = 0 and id IN (
SELECT parent_id FROM blade_menu
WHERE ( category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
) ) )
UNION ALL
SELECT
id,
parent_id,
code,
name,
alias,
path,
source,
action,
sort
FROM
blade_menu
WHERE
is_deleted = 0 and category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>)
) a ORDER BY sort
</select>
<select id="grantTree" resultMap="treeNodeResultMap">
select id, parent_id, name as title, id as "value", id as "key" from blade_menu where is_deleted = 0 order by sort
</select>
<select id="grantTreeByRole" resultMap="treeNodeResultMap">
select id, parent_id, name as title, id as "value", id as "key" from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
or id in (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
order by sort
</select>
<select id="grantTopTree" resultMap="treeNodeResultMap">
select id, parent_id, name as title, id as "value", id as "key" from blade_menu where category = 1 and is_deleted = 0 order by sort
</select>
<select id="grantTopTreeByRole" resultMap="treeNodeResultMap">
select id, parent_id, name as title, id as "value", id as "key" from blade_menu where category = 1 and is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
or id in (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
order by sort
</select>
<select id="grantDataScopeTree" resultMap="treeNodeResultMap">
SELECT
*
FROM
(
SELECT
id,
parent_id,
NAME AS title,
id AS "value",
id AS "key"
FROM
blade_menu
WHERE
category = 1
AND is_deleted = 0
AND id IN ( SELECT menu_id FROM blade_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL )
) menu
UNION ALL
SELECT
id,
menu_id AS parent_id,
scope_name AS title,
id AS "value",
id AS "key"
FROM
blade_scope_data
WHERE
is_deleted = 0
AND menu_id IS NOT NULL
</select>
<select id="grantApiScopeTree" resultMap="treeNodeResultMap">
SELECT
*
FROM
(
SELECT
id,
parent_id,
NAME AS title,
id AS "value",
id AS "key"
FROM
blade_menu
WHERE
category = 1
AND is_deleted = 0
AND id IN ( SELECT menu_id FROM blade_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL )
) menu
UNION ALL
SELECT
id,
menu_id AS parent_id,
scope_name AS title,
id AS "value",
id AS "key"
FROM
blade_scope_api
WHERE
is_deleted = 0
AND menu_id IS NOT NULL
</select>
<select id="grantDataScopeTreeByRole" resultMap="treeNodeResultMap">
SELECT
*
FROM
(
SELECT
id,
parent_id,
NAME AS title,
id AS "value",
id AS "key"
FROM
blade_menu
WHERE
category = 1
AND is_deleted = 0
AND id IN ( SELECT menu_id FROM blade_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL )
AND (
id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
OR id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
)
) menu
UNION ALL
SELECT
id,
menu_id AS parent_id,
scope_name AS title,
id AS "value",
id AS "key"
FROM
blade_scope_data
WHERE
is_deleted = 0
AND (
menu_id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
OR menu_id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
)
AND menu_id IS NOT NULL
</select>
<select id="grantApiScopeTreeByRole" resultMap="treeNodeResultMap">
SELECT
*
FROM
(
SELECT
id,
parent_id,
NAME AS title,
id AS "value",
id AS "key"
FROM
blade_menu
WHERE
category = 1
AND is_deleted = 0
AND id IN ( SELECT menu_id FROM blade_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL )
AND (
id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
OR id IN (
select parent_id from blade_menu where is_deleted = 0
and id in (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
)
) menu
UNION ALL
SELECT
id,
menu_id AS parent_id,
scope_name AS title,
id AS "value",
id AS "key"
FROM
blade_scope_api
WHERE
is_deleted = 0
AND
(
menu_id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
OR menu_id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
)
AND menu_id IS NOT NULL
</select>
<select id="authRoutes" resultType="org.springblade.modules.system.pojo.dto.MenuDTO">
SELECT
GROUP_CONCAT(r.role_alias) as alias,
m.path
FROM
blade_role_menu rm
LEFT JOIN blade_menu m ON rm.menu_id = m.id
LEFT JOIN blade_role r ON rm.role_id = r.id
WHERE
rm.role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND m.path IS NOT NULL and m.is_deleted = 0
GROUP BY m.path
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.Param;
/**
* Mapper 接口
*
* @author Chill
*/
public interface ParamMapper extends BaseMapper<Param> {
}

View File

@@ -0,0 +1,20 @@
<?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.modules.system.mapper.ParamMapper">
<!-- 通用查询映射结果 -->
<resultMap id="paramResultMap" type="org.springblade.modules.system.pojo.entity.Param">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="param_name" property="paramName"/>
<result column="param_key" property="paramKey"/>
<result column="param_value" property="paramValue"/>
<result column="remark" property="remark"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import org.springblade.modules.system.pojo.entity.Post;
import org.springblade.modules.system.pojo.vo.PostVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 岗位表 Mapper 接口
*
* @author Chill
*/
public interface PostMapper extends BaseMapper<Post> {
/**
* 自定义分页
*
* @param page
* @param post
* @return
*/
List<PostVO> selectPostPage(IPage page, PostVO post);
/**
* 获取岗位名
*
* @param ids
* @return
*/
List<String> getPostNames(Long[] ids);
}

View File

@@ -0,0 +1,40 @@
<?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.modules.system.mapper.PostMapper">
<!-- 通用查询映射结果 -->
<resultMap id="postResultMap" type="org.springblade.modules.system.pojo.entity.Post">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="category" property="category"/>
<result column="post_code" property="postCode"/>
<result column="post_name" property="postName"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
</resultMap>
<select id="selectPostPage" resultMap="postResultMap">
select * from blade_post where is_deleted = 0
</select>
<select id="getPostNames" resultType="java.lang.String">
SELECT
post_name
FROM
blade_post
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.RecordData;
/**
* 数据审计表 Mapper 接口
*
* @author BladeX
*/
public interface RecordDataMapper extends BaseMapper<RecordData> {
}

View File

@@ -0,0 +1,26 @@
<?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.modules.system.mapper.RecordDataMapper">
<!-- 通用查询映射结果 -->
<resultMap id="recordDataResultMap" type="org.springblade.modules.system.pojo.entity.RecordData">
<result column="service_id" property="serviceId"/>
<result column="server_host" property="serverHost"/>
<result column="server_ip" property="serverIp"/>
<result column="env" property="env"/>
<result column="level" property="recordLevel"/>
<result column="method" property="method"/>
<result column="request_uri" property="requestUri"/>
<result column="user_agent" property="userAgent"/>
<result column="remote_ip" property="remoteIp"/>
<result column="operation" property="operation"/>
<result column="table_name" property="tableName"/>
<result column="old_data" property="oldData"/>
<result column="new_data" property="newData"/>
<result column="record_message" property="recordMessage"/>
<result column="record_result" property="recordResult"/>
<result column="record_cost" property="recordCost"/>
<result column="record_time" property="recordTime"/>
<result column="record_user" property="recordUser"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.system.pojo.entity.Region;
import org.springblade.modules.system.excel.RegionExcel;
import org.springblade.modules.system.pojo.vo.RegionVO;
import java.util.List;
import java.util.Map;
/**
* 行政区划表 Mapper 接口
*
* @author Chill
*/
public interface RegionMapper extends BaseMapper<Region> {
/**
* 懒加载列表
*
* @param parentCode
* @param param
* @return
*/
List<RegionVO> lazyList(String parentCode, Map<String, Object> param);
/**
* 懒加载列表
*
* @param parentCode
* @param param
* @return
*/
List<RegionVO> lazyTree(String parentCode, Map<String, Object> param);
/**
* 导出区划数据
*
* @param queryWrapper
* @return
*/
List<RegionExcel> exportRegion(@Param("ew") Wrapper<Region> queryWrapper);
}

View File

@@ -0,0 +1,105 @@
<?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.modules.system.mapper.RegionMapper">
<!-- 通用查询映射结果 -->
<resultMap id="regionResultMap" type="org.springblade.modules.system.pojo.entity.Region">
<id column="code" property="code"/>
<result column="parent_code" property="parentCode"/>
<result column="ancestors" property="ancestors"/>
<result column="name" property="name"/>
<result column="province_code" property="provinceCode"/>
<result column="province_name" property="provinceName"/>
<result column="city_code" property="cityCode"/>
<result column="city_name" property="cityName"/>
<result column="district_code" property="districtCode"/>
<result column="district_name" property="districtName"/>
<result column="town_code" property="townCode"/>
<result column="town_name" property="townName"/>
<result column="village_code" property="villageCode"/>
<result column="village_name" property="villageName"/>
<result column="regionLevel" property="regionLevel"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
</resultMap>
<resultMap id="regionVOResultMap" type="org.springblade.modules.system.pojo.vo.RegionVO">
<id column="code" property="code"/>
<result column="parent_code" property="parentCode"/>
<result column="ancestors" property="ancestors"/>
<result column="name" property="name"/>
<result column="province_code" property="provinceCode"/>
<result column="province_name" property="provinceName"/>
<result column="city_code" property="cityCode"/>
<result column="city_name" property="cityName"/>
<result column="district_code" property="districtCode"/>
<result column="district_name" property="districtName"/>
<result column="town_code" property="townCode"/>
<result column="town_name" property="townName"/>
<result column="village_code" property="villageCode"/>
<result column="village_name" property="villageName"/>
<result column="regionLevel" property="regionLevel"/>
<result column="sort" property="sort"/>
<result column="remark" property="remark"/>
<result column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="has_children" property="hasChildren"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
<result column="key" property="key"/>
<result column="has_children" property="hasChildren"/>
</resultMap>
<select id="lazyList" resultMap="regionVOResultMap">
SELECT
region.*,
( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM blade_region WHERE parent_code = region.code ) AS "has_children"
FROM
blade_region region
<where>
<if test="param1!=null">
and region.parent_code = #{param1}
</if>
<if test="param2.code!=null and param2.code!=''">
and region.code like concat(concat('%', #{param2.code}),'%')
</if>
<if test="param2.name!=null and param2.name!=''">
and region.name like concat(concat('%', #{param2.name}),'%')
</if>
</where>
</select>
<select id="lazyTree" resultMap="treeNodeResultMap">
SELECT
region.code AS "id",
region.parent_code AS "parent_id",
region.name AS "title",
region.code AS "value",
region.code AS "key",
( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM blade_region WHERE parent_code = region.code ) AS "has_children"
FROM
blade_region region
<where>
<if test="param1!=null">
and region.parent_code = #{param1}
</if>
<if test="param2.code!=null and param2.code!=''">
and region.code like concat(concat('%', #{param2.code}),'%')
</if>
<if test="param2.name!=null and param2.name!=''">
and region.name like concat(concat('%', #{param2.name}),'%')
</if>
</where>
ORDER BY region.code
</select>
<select id="exportRegion" resultType="org.springblade.modules.system.excel.RegionExcel">
SELECT * FROM blade_region ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,76 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.system.pojo.entity.Role;
import org.springblade.modules.system.pojo.vo.RoleVO;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
public interface RoleMapper extends BaseMapper<Role> {
/**
* 自定义分页
*
* @param page
* @param role
* @return
*/
List<RoleVO> selectRolePage(IPage page, RoleVO role);
/**
* 获取树形节点
*
* @param tenantId
* @param excludeRole
* @return
*/
List<RoleVO> tree(String tenantId, String excludeRole);
/**
* 获取角色名
*
* @param ids
* @return
*/
List<String> getRoleNames(Long[] ids);
/**
* 获取角色名
*
* @param ids
* @return
*/
List<String> getRoleAliases(Long[] ids);
}

View File

@@ -0,0 +1,63 @@
<?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.modules.system.mapper.RoleMapper">
<!-- 通用查询映射结果 -->
<resultMap id="roleResultMap" type="org.springblade.modules.system.pojo.entity.Role">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="role_name" property="roleName"/>
<result column="sort" property="sort"/>
<result column="role_alias" property="roleAlias"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="title" property="title"/>
<result column="value" property="value"/>
<result column="key" property="key"/>
</resultMap>
<select id="selectRolePage" resultMap="roleResultMap">
select * from blade_role where is_deleted = 0
</select>
<select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, role_name as title, id as "value", id as "key" from blade_role where is_deleted = 0
<if test="param1!=null">
and tenant_id = #{param1}
</if>
<if test="param2!=null">
and role_alias &lt;&gt; #{param2}
</if>
</select>
<select id="getRoleNames" resultType="java.lang.String">
SELECT
role_name
FROM
blade_role
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
<select id="getRoleAliases" resultType="java.lang.String">
SELECT
role_alias
FROM
blade_role
WHERE
id IN
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.system.pojo.entity.RoleMenu;
import org.springblade.modules.system.pojo.vo.RoleMenuVO;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
public interface RoleMenuMapper extends BaseMapper<RoleMenu> {
/**
* 自定义分页
* @param page
* @param roleMenu
* @return
*/
List<RoleMenuVO> selectRoleMenuPage(IPage page, RoleMenuVO roleMenu);
}

View File

@@ -0,0 +1,16 @@
<?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.modules.system.mapper.RoleMenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="roleMenuResultMap" type="org.springblade.modules.system.pojo.entity.RoleMenu">
<id column="id" property="id"/>
<result column="menu_id" property="menuId"/>
<result column="role_id" property="roleId"/>
</resultMap>
<select id="selectRoleMenuPage" resultMap="roleMenuResultMap">
select * from blade_role_menu where is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.RoleScope;
/**
* Mapper 接口
*
* @author Chill
*/
public interface RoleScopeMapper extends BaseMapper<RoleScope> {
}

View File

@@ -0,0 +1,12 @@
<?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.modules.system.mapper.RoleScopeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="roleMenuResultMap" type="org.springblade.modules.system.pojo.entity.RoleScope">
<id column="id" property="id"/>
<result column="scope_id" property="scopeId"/>
<result column="role_id" property="roleId"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.TenantDatasource;
/**
* 数据源配置表 Mapper 接口
*
* @author Chill
*/
public interface TenantDatasourceMapper extends BaseMapper<TenantDatasource> {
}

View File

@@ -0,0 +1,22 @@
<?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.modules.system.mapper.TenantDatasourceMapper">
<!-- 通用查询映射结果 -->
<resultMap id="datasourceResultMap" type="org.springblade.modules.system.pojo.entity.TenantDatasource">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="driver_class" property="driverClass"/>
<result column="url" property="url"/>
<result column="username" property="username"/>
<result column="password" property="password"/>
<result column="remark" property="remark"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.system.pojo.entity.Tenant;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
public interface TenantMapper extends BaseMapper<Tenant> {
/**
* 自定义分页
*
* @param page
* @param tenant
* @return
*/
List<Tenant> selectTenantPage(IPage page, Tenant tenant);
}

View File

@@ -0,0 +1,31 @@
<?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.modules.system.mapper.TenantMapper">
<!-- 通用查询映射结果 -->
<resultMap id="tenantResultMap" type="org.springblade.modules.system.pojo.entity.Tenant">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="tenant_id" property="tenantId"/>
<result column="tenant_name" property="tenantName"/>
<result column="domain_url" property="domainUrl"/>
<result column="background_url" property="backgroundUrl"/>
<result column="linkman" property="linkman"/>
<result column="contact_number" property="contactNumber"/>
<result column="address" property="address"/>
<result column="account_number" property="accountNumber"/>
<result column="expire_time" property="expireTime"/>
<result column="license_key" property="licenseKey"/>
</resultMap>
<select id="selectTenantPage" resultMap="tenantResultMap">
select * from blade_tenant where is_deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.TenantPackage;
/**
* 租户产品表 Mapper 接口
*
* @author BladeX
*/
public interface TenantPackageMapper extends BaseMapper<TenantPackage> {
}

View File

@@ -0,0 +1,20 @@
<?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.modules.system.mapper.TenantPackageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="tenantPackageResultMap" type="org.springblade.modules.system.pojo.entity.TenantPackage">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="package_name" property="packageName"/>
<result column="menu_id" property="menuId"/>
<result column="remark" property="remark"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.TopMenu;
/**
* 顶部菜单表 Mapper 接口
*
* @author BladeX
*/
public interface TopMenuMapper extends BaseMapper<TopMenu> {
}

View File

@@ -0,0 +1,22 @@
<?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.modules.system.mapper.TopMenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="topMenuResultMap" type="org.springblade.modules.system.pojo.entity.TopMenu">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="code" property="code"/>
<result column="name" property="name"/>
<result column="source" property="source"/>
<result column="path" property="path"/>
<result column="sort" property="sort"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.TopMenuSetting;
/**
* Mapper 接口
*
* @author Chill
*/
public interface TopMenuSettingMapper extends BaseMapper<TopMenuSetting> {
}

View File

@@ -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.modules.system.mapper.TopMenuSettingMapper">
</mapper>

View File

@@ -0,0 +1,39 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.UserApp;
/**
* Mapper 接口
*
* @author Chill
*/
public interface UserAppMapper extends BaseMapper<UserApp> {
}

View File

@@ -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.modules.system.mapper.UserAppMapper">
</mapper>

View File

@@ -0,0 +1,39 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.UserDept;
/**
* Mapper 接口
*
* @author Chill
*/
public interface UserDeptMapper extends BaseMapper<UserDept> {
}

View File

@@ -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.modules.system.mapper.UserDeptMapper">
</mapper>

View File

@@ -0,0 +1,81 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.pojo.entity.User;
import java.util.List;
/**
* Mapper 接口
*
* @author Chill
*/
public interface UserMapper extends BaseMapper<User> {
/**
* 自定义分页
*
* @param page
* @param user
* @param deptIdList
* @param tenantId
* @return
*/
List<User> selectUserPage(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId);
/**
* 获取用户
*
* @param tenantId
* @param account
* @return
*/
User getUser(String tenantId, String account);
/**
* 获取用户
*
* @param tenantId
* @param phone
* @return
*/
User getUserByPhone(String tenantId, String phone);
/**
* 获取导出用户数据
*
* @param queryWrapper
* @return
*/
List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper);
}

View File

@@ -0,0 +1,88 @@
<?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.modules.system.mapper.UserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="userResultMap" type="org.springblade.modules.system.pojo.entity.User">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="code" property="code"/>
<result column="user_type" property="userType"/>
<result column="account" property="account"/>
<result column="password" property="password"/>
<result column="name" property="name"/>
<result column="real_name" property="realName"/>
<result column="email" property="email"/>
<result column="phone" property="phone"/>
<result column="birthday" property="birthday"/>
<result column="sex" property="sex"/>
<result column="role_id" property="roleId"/>
<result column="dept_id" property="deptId"/>
<result column="post_id" property="postId"/>
</resultMap>
<select id="selectUserPage" resultMap="userResultMap">
select * from blade_user where is_deleted = 0
<if test="tenantId!=null and tenantId != ''">
and tenant_id = #{tenantId}
</if>
<if test="user.tenantId!=null and user.tenantId != ''">
and tenant_id = #{user.tenantId}
</if>
<if test="user.account!=null and user.account != ''">
and account = #{user.account}
</if>
<if test="user.realName!=null and user.realName != ''">
and real_name = #{user.realName}
</if>
<if test="user.userType!=null and user.userType != ''">
and user_type = #{user.userType}
</if>
<if test="user.status!=null and user.status>=0">
and status = #{user.status}
</if>
<if test="deptIdList!=null and deptIdList.size>0">
and id in (
SELECT
user_id
FROM
blade_user_dept
WHERE
status = 1 and is_deleted = 0 and dept_id IN
<foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
ORDER BY id
</select>
<select id="getUser" resultMap="userResultMap">
SELECT
*
FROM
blade_user
WHERE
tenant_id = #{param1} and account = #{param2} and status = 1 and is_deleted = 0
</select>
<select id="getUserByPhone" resultMap="userResultMap">
SELECT
*
FROM
blade_user
WHERE
tenant_id = #{param1} and phone = #{param2} and status = 1 and is_deleted = 0
</select>
<select id="exportUser" resultType="org.springblade.modules.system.excel.UserExcel">
SELECT id, tenant_id, user_type, account, name, real_name, email, phone, birthday, role_id, dept_id, post_id FROM blade_user ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.UserOauth;
/**
* Mapper 接口
*
* @author Chill
*/
public interface UserOauthMapper extends BaseMapper<UserOauth> {
}

View File

@@ -0,0 +1,22 @@
<?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.modules.system.mapper.UserOauthMapper">
<!-- 通用查询映射结果 -->
<resultMap id="userResultMap" type="org.springblade.modules.system.pojo.entity.UserOauth">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="user_id" property="userId"/>
<result column="username" property="username"/>
<result column="nickname" property="nickname"/>
<result column="avatar" property="avatar"/>
<result column="blog" property="blog"/>
<result column="company" property="company"/>
<result column="location" property="location"/>
<result column="email" property="email"/>
<result column="remark" property="remark"/>
<result column="gender" property="gender"/>
<result column="source" property="source"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,39 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.UserOther;
/**
* Mapper 接口
*
* @author Chill
*/
public interface UserOtherMapper extends BaseMapper<UserOther> {
}

View File

@@ -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.modules.system.mapper.UserOtherMapper">
</mapper>

View File

@@ -0,0 +1,39 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.modules.system.pojo.entity.UserWeb;
/**
* Mapper 接口
*
* @author Chill
*/
public interface UserWebMapper extends BaseMapper<UserWeb> {
}

View File

@@ -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.modules.system.mapper.UserWebMapper">
</mapper>

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.system.pojo.entity.Dept;
import java.io.Serial;
/**
* 数据传输对象实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DeptDTO extends Dept {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.system.pojo.entity.Dict;
import java.io.Serial;
/**
* 数据传输对象实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DictDTO extends Dict {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,44 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 数据传输对象实体类
*
* @author Chill
*/
@Data
public class MenuDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String alias;
private String path;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.system.pojo.entity.Param;
import java.io.Serial;
/**
* 数据传输对象实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ParamDTO extends Param {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.system.pojo.entity.Post;
import java.io.Serial;
/**
* 岗位表数据传输对象实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class PostDTO extends Post {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.system.pojo.entity.Role;
import java.io.Serial;
/**
* 数据传输对象实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class RoleDTO extends Role {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.system.pojo.entity.RoleMenu;
import java.io.Serial;
/**
* 数据传输对象实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class RoleMenuDTO extends RoleMenu {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,103 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.jackson.Sensitive;
import org.springblade.core.tool.sensitive.SensitiveType;
import java.io.Serial;
import java.util.Date;
/**
* 令牌权限 实体类
*
* @author Chill
*/
@Data
@TableName("blade_api_key")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "ApiKey对象")
public class ApiKey extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
* 令牌权限
*/
@Sensitive(type = SensitiveType.KEYS)
@Schema(description = "API Key")
private String apiKey;
/**
* 用户ID
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "用户ID")
private Long userId;
/**
* 密钥名称
*/
@Schema(description = "密钥名称")
private String name;
/**
* 过期时间
*/
@Schema(description = "过期时间")
private Date expireTime;
/**
* 扩展参数 (JSON格式, 存储 userId, deptId, roleId 等)
*/
@Schema(description = "扩展参数")
private String extParams;
/**
* 访问权限 (逗号分隔的URL路径,支持Ant风格匹配)
*/
@Schema(description = "访问权限")
private String apiPath;
}

View File

@@ -0,0 +1,82 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 实体类
*
* @author BladeX
*/
@Data
@TableName("blade_scope_api")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "ApiScope对象")
public class ApiScope extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 菜单主键
*/
@Schema(description = "菜单主键")
private Long menuId;
/**
* 资源编号
*/
@Schema(description = "资源编号")
private String resourceCode;
/**
* 接口权限名称
*/
@Schema(description = "接口权限名称")
private String scopeName;
/**
* 接口权限字段
*/
@Schema(description = "接口权限字段")
private String scopePath;
/**
* 接口权限类型
*/
@Schema(description = "接口权限类型")
private Integer scopeType;
/**
* 接口权限备注
*/
@Schema(description = "接口权限备注")
private String remark;
}

View File

@@ -0,0 +1,109 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 实体类
*
* @author BladeX
*/
@Data
@TableName("blade_client")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "AuthClient对象")
public class AuthClient extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 客户端id
*/
@Schema(description = "客户端id")
private String clientId;
/**
* 客户端密钥
*/
@Schema(description = "客户端密钥")
private String clientSecret;
/**
* 资源集合
*/
@Schema(description = "资源集合")
private String resourceIds;
/**
* 授权范围
*/
@Schema(description = "授权范围")
private String scope;
/**
* 授权类型
*/
@Schema(description = "授权类型")
private String authorizedGrantTypes;
/**
* 回调地址
*/
@Schema(description = "回调地址")
private String webServerRedirectUri;
/**
* 权限
*/
@Schema(description = "权限")
private String authorities;
/**
* 令牌过期秒数
*/
@Schema(description = "令牌过期秒数")
private Integer accessTokenValidity;
/**
* 刷新令牌过期秒数
*/
@Schema(description = "刷新令牌过期秒数")
private Integer refreshTokenValidity;
/**
* 附加说明
*/
@JsonIgnore
@Schema(description = "附加说明")
private String additionalInformation;
/**
* 自动授权
*/
@Schema(description = "自动授权")
private String autoapprove;
}

View File

@@ -0,0 +1,97 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 实体类
*
* @author BladeX
*/
@Data
@TableName("blade_scope_data")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "DataScope对象")
public class DataScope extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 菜单主键
*/
@Schema(description = "菜单主键")
private Long menuId;
/**
* 资源编号
*/
@Schema(description = "资源编号")
private String resourceCode;
/**
* 数据权限名称
*/
@Schema(description = "数据权限名称")
private String scopeName;
/**
* 数据权限可见字段
*/
@Schema(description = "数据权限可见字段")
private String scopeField;
/**
* 数据权限类名
*/
@Schema(description = "数据权限类名")
private String scopeClass;
/**
* 数据权限字段
*/
@Schema(description = "数据权限字段")
private String scopeColumn;
/**
* 数据权限类型
*/
@Schema(description = "数据权限类型")
private Integer scopeType;
/**
* 数据权限值域
*/
@Schema(description = "数据权限值域")
private String scopeValue;
/**
* 数据权限备注
*/
@Schema(description = "数据权限备注")
private String remark;
}

View File

@@ -0,0 +1,130 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 实体类
*
* @author Chill
*/
@Data
@TableName("blade_dept")
@Schema(description = "Dept对象")
public class Dept implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
* 租户ID
*/
@Schema(description = "租户ID")
private String tenantId;
/**
* 父主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "父主键")
private Long parentId;
/**
* 机构全称
*/
@Schema(description = "机构全称")
private String fullName;
/**
* 机构名
*/
@Schema(description = "机构名")
private String deptName;
/**
* 祖级机构主键
*/
@Schema(description = "祖级机构主键")
private String ancestors;
/**
* 部门主管id
*/
@Schema(description = "部门主管id")
private String leaderId;
/**
* 机构类型
*/
@Schema(description = "机构类型")
private Integer deptCategory;
/**
* 排序
*/
@Schema(description = "排序")
private Integer sort;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 业务状态
*/
@Schema(description = "业务状态")
private Integer status;
/**
* 是否已删除
*/
@TableLogic
@Schema(description = "是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,118 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 实体类
*
* @author Chill
*/
@Data
@TableName("blade_dict")
@Schema(description = "Dict对象")
public class Dict implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
* 父主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "父主键")
private Long parentId;
/**
* 字典码
*/
@Schema(description = "字典码")
private String code;
/**
* 字典值
*/
@Schema(description = "字典值")
private String dictKey;
/**
* 字典名称
*/
@Schema(description = "字典名称")
private String dictValue;
/**
* 排序
*/
@Schema(description = "排序")
private Integer sort;
/**
* 字典备注
*/
@Schema(description = "字典备注")
private String remark;
/**
* 是否已封存
*/
@Schema(description = "是否已封存")
private Integer isSealed;
/**
* 业务状态
*/
@Schema(description = "业务状态")
private Integer status;
/**
* 是否已删除
*/
@TableLogic
@Schema(description = "是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,124 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 实体类
*
* @author Chill
*/
@Data
@TableName("blade_dict_biz")
@Schema(description = "DictBiz对象")
public class DictBiz implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
* 租户ID
*/
@Schema(description = "租户ID")
private String tenantId;
/**
* 父主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "父主键")
private Long parentId;
/**
* 字典码
*/
@Schema(description = "字典码")
private String code;
/**
* 字典值
*/
@Schema(description = "字典值")
private String dictKey;
/**
* 字典名称
*/
@Schema(description = "字典名称")
private String dictValue;
/**
* 排序
*/
@Schema(description = "排序")
private Integer sort;
/**
* 字典备注
*/
@Schema(description = "字典备注")
private String remark;
/**
* 是否已封存
*/
@Schema(description = "是否已封存")
private Integer isSealed;
/**
* 业务状态
*/
@Schema(description = "业务状态")
private Integer status;
/**
* 是否已删除
*/
@TableLogic
@Schema(description = "是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,162 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;
/**
* 实体类
*
* @author Chill
*/
@Data
@TableName("blade_menu")
@Schema(description = "Menu对象")
public class Menu implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
* 菜单父主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "菜单父主键")
private Long parentId;
/**
* 菜单编号
*/
@Schema(description = "菜单编号")
private String code;
/**
* 菜单名称
*/
@Schema(description = "菜单名称")
private String name;
/**
* 菜单别名
*/
@Schema(description = "菜单别名")
private String alias;
/**
* 请求地址
*/
@Schema(description = "请求地址")
private String path;
/**
* 菜单资源
*/
@Schema(description = "菜单资源")
private String source;
/**
* 组件资源
*/
@Schema(description = "组件资源")
private String component;
/**
* 排序
*/
@Schema(description = "排序")
private Integer sort;
/**
* 菜单类型
*/
@Schema(description = "菜单类型")
private Integer category;
/**
* 操作按钮类型
*/
@Schema(description = "操作按钮类型")
private Integer action;
/**
* 是否打开新页面
*/
@Schema(description = "是否打开新页面")
private Integer isOpen;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 是否已删除
*/
@TableLogic
@Schema(description = "是否已删除")
private Integer isDeleted;
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
Menu other = (Menu) obj;
return Func.equals(this.getId(), other.getId());
}
@Override
public int hashCode() {
return Objects.hash(id, parentId, code);
}
}

View File

@@ -0,0 +1,75 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 实体类
*
* @author Chill
*/
@Data
@TableName("blade_param")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "Param对象")
public class Param extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 参数名
*/
@Schema(description = "参数名")
private String paramName;
/**
* 参数键
*/
@Schema(description = "参数键")
private String paramKey;
/**
* 参数值
*/
@Schema(description = "参数值")
private String paramValue;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

Some files were not shown because too many files have changed in this diff Show More