diff --git a/pom.xml b/pom.xml index 5801c63..fb9408b 100644 --- a/pom.xml +++ b/pom.xml @@ -119,11 +119,6 @@ org.springblade blade-starter-report - - - org.springblade - blade-starter-flowable - com.github.whvcse diff --git a/src/main/java/org/springblade/common/event/ApiLogListener.java b/src/main/java/org/springblade/common/event/ApiLogListener.java index bc23362..e6f9b76 100644 --- a/src/main/java/org/springblade/common/event/ApiLogListener.java +++ b/src/main/java/org/springblade/common/event/ApiLogListener.java @@ -51,10 +51,10 @@ public class ApiLogListener { @Order @EventListener(ApiLogEvent.class) public void saveApiLog(ApiLogEvent event) { - Map source = (Map) event.getSource(); - LogApi logApi = (LogApi) source.get(EventConstant.EVENT_LOG); - LogAbstractUtil.addOtherInfoToLog(logApi, bladeProperties, serverInfo); - logService.saveApiLog(logApi); +// Map source = (Map) event.getSource(); +// LogApi logApi = (LogApi) source.get(EventConstant.EVENT_LOG); +// LogAbstractUtil.addOtherInfoToLog(logApi, bladeProperties, serverInfo); +// logService.saveApiLog(logApi); } } diff --git a/src/main/java/org/springblade/common/event/ErrorLogListener.java b/src/main/java/org/springblade/common/event/ErrorLogListener.java index 19d2279..2fe2aff 100644 --- a/src/main/java/org/springblade/common/event/ErrorLogListener.java +++ b/src/main/java/org/springblade/common/event/ErrorLogListener.java @@ -49,9 +49,9 @@ public class ErrorLogListener { @Order @EventListener(ErrorLogEvent.class) public void saveErrorLog(ErrorLogEvent event) { - Map source = (Map) event.getSource(); - LogError logError = (LogError) source.get(EventConstant.EVENT_LOG); - LogAbstractUtil.addOtherInfoToLog(logError, bladeProperties, serverInfo); - logService.saveErrorLog(logError); +// Map source = (Map) event.getSource(); +// LogError logError = (LogError) source.get(EventConstant.EVENT_LOG); +// LogAbstractUtil.addOtherInfoToLog(logError, bladeProperties, serverInfo); +// logService.saveErrorLog(logError); } } diff --git a/src/main/java/org/springblade/common/event/UsualLogListener.java b/src/main/java/org/springblade/common/event/UsualLogListener.java index c8c357b..51ebb52 100644 --- a/src/main/java/org/springblade/common/event/UsualLogListener.java +++ b/src/main/java/org/springblade/common/event/UsualLogListener.java @@ -49,10 +49,10 @@ public class UsualLogListener { @Order @EventListener(UsualLogEvent.class) public void saveUsualLog(UsualLogEvent event) { - Map source = (Map) event.getSource(); - LogUsual logUsual = (LogUsual) source.get(EventConstant.EVENT_LOG); - LogAbstractUtil.addOtherInfoToLog(logUsual, bladeProperties, serverInfo); - logService.saveUsualLog(logUsual); +// Map source = (Map) event.getSource(); +// LogUsual logUsual = (LogUsual) source.get(EventConstant.EVENT_LOG); +// LogAbstractUtil.addOtherInfoToLog(logUsual, bladeProperties, serverInfo); +// logService.saveUsualLog(logUsual); } } diff --git a/src/main/java/org/springblade/modules/auth/endpoint/BladeSocialEndpoint.java b/src/main/java/org/springblade/modules/auth/endpoint/BladeSocialEndpoint.java deleted file mode 100644 index 707292e..0000000 --- a/src/main/java/org/springblade/modules/auth/endpoint/BladeSocialEndpoint.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.auth.endpoint; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhyd.oauth.model.AuthCallback; -import me.zhyd.oauth.model.AuthToken; -import me.zhyd.oauth.request.AuthRequest; -import me.zhyd.oauth.utils.AuthStateUtils; -import org.springblade.core.launch.constant.AppConstant; -import org.springblade.core.social.props.SocialProperties; -import org.springblade.core.social.utils.SocialUtil; -import org.springblade.core.tenant.annotation.NonDS; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * 第三方登陆端点 - * - * @author Chill - */ -@NonDS -@Slf4j -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_AUTH_NAME) -@ConditionalOnProperty(value = "social.enabled", havingValue = "true") -@Api(value = "第三方登陆", tags = "第三方登陆端点") -public class BladeSocialEndpoint { - - private final SocialProperties socialProperties; - - /** - * 授权完毕跳转 - */ - @ApiOperation(value = "授权完毕跳转") - @RequestMapping("/oauth/render/{source}") - public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException { - AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); - String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); - response.sendRedirect(authorizeUrl); - } - - /** - * 获取认证信息 - */ - @ApiOperation(value = "获取认证信息") - @RequestMapping("/oauth/callback/{source}") - public Object login(@PathVariable("source") String source, AuthCallback callback) { - AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); - return authRequest.login(callback); - } - - /** - * 撤销授权 - */ - @ApiOperation(value = "撤销授权") - @RequestMapping("/oauth/revoke/{source}/{token}") - public Object revokeAuth(@PathVariable("source") String source, @PathVariable("token") String token) { - AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); - return authRequest.revoke(AuthToken.builder().accessToken(token).build()); - } - - /** - * 续期accessToken - */ - @ApiOperation(value = "续期令牌") - @RequestMapping("/oauth/refresh/{source}") - public Object refreshAuth(@PathVariable("source") String source, String token) { - AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); - return authRequest.refresh(AuthToken.builder().refreshToken(token).build()); - } - - -} diff --git a/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java b/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java index c2a4fec..c7b5d93 100644 --- a/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java +++ b/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java @@ -230,7 +230,7 @@ public class ApmConfigServiceImpl extends ServiceImpl alreadyConfMap = new HashMap<>(); if (Func.isNotEmpty(alreadyConfList)) { for (ApmConfig config : alreadyConfList) { - String key = config.getProject() + config.getApmDay() + config.getPeriod() + config.getTimeFrame(); + String key = config.getProject() + DateUtil.format(config.getApmDay(), DateUtil.PATTERN_DATE) + config.getPeriod() + config.getTimeFrame(); if (alreadyConfMap.containsKey(key)) { continue; } @@ -259,9 +259,11 @@ public class ApmConfigServiceImpl extends ServiceImpl detail(Code code) { - Code detail = codeService.getOne(Condition.getQueryWrapper(code)); - return R.data(detail); - } - - /** - * 分页 - */ - @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string") - }) - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入code") - public R> list(@ApiIgnore @RequestParam Map code, Query query) { - IPage pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class)); - return R.data(pages); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增或修改", notes = "传入code") - public R submit(@Valid @RequestBody Code code) { - return R.status(codeService.submit(code)); - } - - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(codeService.removeByIds(Func.toLongList(ids))); - } - - /** - * 复制 - */ - @PostMapping("/copy") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "复制", notes = "传入id") - public R copy(@ApiParam(value = "主键", required = true) @RequestParam Long id) { - Code code = codeService.getById(id); - code.setId(null); - code.setCodeName(code.getCodeName() + "-copy"); - return R.status(codeService.save(code)); - } - - /** - * 代码生成 - */ - @PostMapping("/gen-code") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "代码生成", notes = "传入ids") - public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - Collection codes = codeService.listByIds(Func.toLongList(ids)); - codes.forEach(code -> { - BladeCodeGenerator generator = new BladeCodeGenerator(); - // 设置基础模型 - Model model = modelService.getById(code.getModelId()); - generator.setModelCode(model.getModelCode()); - generator.setModelClass(model.getModelClass()); - // 设置模型集合 - List prototypes = modelPrototypeService.prototypeList(model.getId()); - generator.setModel(JsonUtil.readMap(JsonUtil.toJson(model))); - generator.setPrototypes(JsonUtil.readListMap(JsonUtil.toJson(prototypes))); - if (StringUtil.isNotBlank(code.getSubModelId())) { - Model subModel = modelService.getById(Func.toLong(code.getSubModelId())); - List subPrototypes = modelPrototypeService.prototypeList(subModel.getId()); - generator.setSubModel(JsonUtil.readMap(JsonUtil.toJson(subModel))); - generator.setSubPrototypes(JsonUtil.readListMap(JsonUtil.toJson(subPrototypes))); - } - // 设置数据源 - Datasource datasource = datasourceService.getById(model.getDatasourceId()); - generator.setDriverName(datasource.getDriverClass()); - generator.setUrl(datasource.getUrl()); - generator.setUsername(datasource.getUsername()); - generator.setPassword(datasource.getPassword()); - // 设置基础配置 - generator.setCodeStyle(code.getCodeStyle()); - generator.setCodeName(code.getCodeName()); - generator.setServiceName(code.getServiceName()); - generator.setPackageName(code.getPackageName()); - generator.setPackageDir(code.getApiPath()); - generator.setPackageWebDir(code.getWebPath()); - generator.setTablePrefix(Func.toStrArray(code.getTablePrefix())); - generator.setIncludeTables(Func.toStrArray(code.getTableName())); - // 设置模版信息 - generator.setTemplateType(code.getTemplateType()); - generator.setAuthor(code.getAuthor()); - generator.setSubModelId(code.getSubModelId()); - generator.setSubFkId(code.getSubFkId()); - generator.setTreeId(code.getTreeId()); - generator.setTreePid(code.getTreePid()); - generator.setTreeName(code.getTreeName()); - // 设置是否继承基础业务字段 - generator.setHasSuperEntity(code.getBaseMode() == 2); - // 设置是否开启包装器模式 - generator.setHasWrapper(code.getWrapMode() == 2); - // 设置是否开启远程调用模式 - generator.setHasFeign(code.getFeignMode() == 2); - // 设置控制器服务名前缀 - generator.setHasServiceName(Boolean.TRUE); - // 启动代码生成 - generator.run(); - }); - return R.success("代码生成成功"); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/controller/DatasourceController.java b/src/main/java/org/springblade/modules/develop/controller/DatasourceController.java deleted file mode 100644 index 57fb9ec..0000000 --- a/src/main/java/org/springblade/modules/develop/controller/DatasourceController.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.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.develop.entity.Datasource; -import org.springblade.modules.develop.service.IDatasourceService; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 数据源配置表 控制器 - * - * @author Chill - */ -@NonDS -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_DEVELOP_NAME + "/datasource") -@Api(value = "数据源配置表", tags = "数据源配置表接口") -public class DatasourceController extends BladeController { - - private final IDatasourceService datasourceService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入datasource") - public R detail(Datasource datasource) { - Datasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource)); - return R.data(detail); - } - - /** - * 分页 数据源配置表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入datasource") - public R> list(Datasource datasource, Query query) { - IPage pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource)); - return R.data(pages); - } - - /** - * 新增 数据源配置表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入datasource") - public R save(@Valid @RequestBody Datasource datasource) { - return R.status(datasourceService.save(datasource)); - } - - /** - * 修改 数据源配置表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入datasource") - public R update(@Valid @RequestBody Datasource datasource) { - return R.status(datasourceService.updateById(datasource)); - } - - /** - * 新增或修改 数据源配置表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入datasource") - public R submit(@Valid @RequestBody Datasource datasource) { - datasource.setUrl(datasource.getUrl().replace("&", "&")); - return R.status(datasourceService.saveOrUpdate(datasource)); - } - - - /** - * 删除 数据源配置表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(datasourceService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 数据源列表 - */ - @GetMapping("/select") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "下拉数据源", notes = "查询列表") - public R> select() { - List list = datasourceService.list(); - return R.data(list); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/controller/ModelController.java b/src/main/java/org/springblade/modules/develop/controller/ModelController.java deleted file mode 100644 index 58d8002..0000000 --- a/src/main/java/org/springblade/modules/develop/controller/ModelController.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.generator.config.DataSourceConfig; -import com.baomidou.mybatisplus.generator.config.StrategyConfig; -import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; -import com.baomidou.mybatisplus.generator.config.po.TableInfo; -import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.launch.constant.AppConstant; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.StringPool; -import org.springblade.core.tool.utils.StringUtil; -import org.springblade.modules.develop.entity.Datasource; -import org.springblade.modules.develop.entity.Model; -import org.springblade.modules.develop.entity.ModelPrototype; -import org.springblade.modules.develop.service.IDatasourceService; -import org.springblade.modules.develop.service.IModelPrototypeService; -import org.springblade.modules.develop.service.IModelService; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 数据模型表 控制器 - * - * @author Chill - */ -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_DEVELOP_NAME + "/model") -@Api(value = "数据模型表", tags = "数据模型表接口") -public class ModelController extends BladeController { - - private final IModelService modelService; - private final IModelPrototypeService modelPrototypeService; - private final IDatasourceService datasourceService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入model") - public R detail(Model model) { - Model detail = modelService.getOne(Condition.getQueryWrapper(model)); - return R.data(detail); - } - - /** - * 分页 数据模型表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入model") - public R> list(Model model, Query query) { - IPage pages = modelService.page(Condition.getPage(query), Condition.getQueryWrapper(model)); - return R.data(pages); - } - - /** - * 新增 数据模型表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入model") - public R save(@Valid @RequestBody Model model) { - return R.status(modelService.save(model)); - } - - /** - * 修改 数据模型表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入model") - public R update(@Valid @RequestBody Model model) { - return R.status(modelService.updateById(model)); - } - - /** - * 新增或修改 数据模型表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入model") - public R submit(@Valid @RequestBody Model model) { - return R.status(modelService.saveOrUpdate(model)); - } - - /** - * 删除 数据模型表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(modelService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 模型列表 - */ - @GetMapping("/select") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "模型列表", notes = "模型列表") - public R> select() { - List list = modelService.list(); - list.forEach(model -> model.setModelName(model.getModelTable() + StringPool.COLON + StringPool.SPACE + model.getModelName())); - return R.data(list); - } - - /** - * 获取物理表列表 - */ - @GetMapping("/table-list") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "物理表列表", notes = "传入datasourceId") - public R> tableList(Long datasourceId) { - Datasource datasource = datasourceService.getById(datasourceId); - ConfigBuilder config = getConfigBuilder(datasource); - List tableInfoList = config.getTableInfoList().stream() - .filter(tableInfo -> !StringUtil.startsWithIgnoreCase(tableInfo.getName(), "ACT_")) - .map(tableInfo -> tableInfo.setComment(tableInfo.getName() + StringPool.COLON + tableInfo.getComment())) - .collect(Collectors.toList()); - return R.data(tableInfoList); - } - - /** - * 获取物理表信息 - */ - @GetMapping("/table-info") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "物理表信息", notes = "传入model信息") - public R tableInfo(Long modelId, String tableName, Long datasourceId) { - if (StringUtil.isBlank(tableName)) { - Model model = modelService.getById(modelId); - tableName = model.getModelTable(); - } - TableInfo tableInfo = getTableInfo(tableName, datasourceId); - return R.data(tableInfo); - } - - /** - * 获取字段信息 - */ - @GetMapping("/model-prototype") - @ApiOperationSupport(order = 10) - @ApiOperation(value = "物理表字段信息", notes = "传入modelId与datasourceId") - public R modelPrototype(Long modelId, Long datasourceId) { - List modelPrototypeList = modelPrototypeService.list(Wrappers.query().lambda().eq(ModelPrototype::getModelId, modelId)); - if (modelPrototypeList.size() > 0) { - return R.data(modelPrototypeList); - } - Model model = modelService.getById(modelId); - String tableName = model.getModelTable(); - TableInfo tableInfo = getTableInfo(tableName, datasourceId); - if (tableInfo != null) { - return R.data(tableInfo.getFields()); - } else { - return R.fail("未获得相关表信息"); - } - } - - /** - * 获取表信息 - * - * @param tableName 表名 - * @param datasourceId 数据源主键 - */ - private TableInfo getTableInfo(String tableName, Long datasourceId) { - Datasource datasource = datasourceService.getById(datasourceId); - ConfigBuilder config = getConfigBuilder(datasource); - List tableInfoList = config.getTableInfoList(); - TableInfo tableInfo = null; - Iterator iterator = tableInfoList.stream().filter(table -> table.getName().equals(tableName)).collect(Collectors.toList()).iterator(); - if (iterator.hasNext()) { - tableInfo = iterator.next(); - tableInfo.setEntityName(tableInfo.getEntityName().replace(StringUtil.firstCharToUpper(tableName.split(StringPool.UNDERSCORE)[0]), StringPool.EMPTY)); - } - return tableInfo; - } - - /** - * 获取表配置信息 - * - * @param datasource 数据源信息 - */ - private ConfigBuilder getConfigBuilder(Datasource datasource) { - StrategyConfig strategyConfig = new StrategyConfig.Builder() - .entityBuilder() - .naming(NamingStrategy.underline_to_camel) - .columnNaming(NamingStrategy.underline_to_camel).build(); - DataSourceConfig datasourceConfig = new DataSourceConfig.Builder( - datasource.getUrl(), datasource.getUsername(), datasource.getPassword() - ).build(); - return new ConfigBuilder(null, datasourceConfig, strategyConfig, null, null, null); - } - - -} diff --git a/src/main/java/org/springblade/modules/develop/controller/ModelPrototypeController.java b/src/main/java/org/springblade/modules/develop/controller/ModelPrototypeController.java deleted file mode 100644 index fbe5dfe..0000000 --- a/src/main/java/org/springblade/modules/develop/controller/ModelPrototypeController.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.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.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.launch.constant.AppConstant; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.StringPool; -import org.springblade.modules.develop.entity.ModelPrototype; -import org.springblade.modules.develop.service.IModelPrototypeService; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 数据原型表 控制器 - * - * @author Chill - */ -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_DEVELOP_NAME + "/model-prototype") -@Api(value = "数据原型表", tags = "数据原型表接口") -public class ModelPrototypeController extends BladeController { - - private final IModelPrototypeService modelPrototypeService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入modelPrototype") - public R detail(ModelPrototype modelPrototype) { - ModelPrototype detail = modelPrototypeService.getOne(Condition.getQueryWrapper(modelPrototype)); - return R.data(detail); - } - - /** - * 分页 数据原型表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入modelPrototype") - public R> list(ModelPrototype modelPrototype, Query query) { - IPage pages = modelPrototypeService.page(Condition.getPage(query), Condition.getQueryWrapper(modelPrototype)); - return R.data(pages); - } - - /** - * 新增 数据原型表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入modelPrototype") - public R save(@Valid @RequestBody ModelPrototype modelPrototype) { - return R.status(modelPrototypeService.save(modelPrototype)); - } - - /** - * 修改 数据原型表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入modelPrototype") - public R update(@Valid @RequestBody ModelPrototype modelPrototype) { - return R.status(modelPrototypeService.updateById(modelPrototype)); - } - - /** - * 新增或修改 数据原型表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入modelPrototype") - public R submit(@Valid @RequestBody ModelPrototype modelPrototype) { - return R.status(modelPrototypeService.saveOrUpdate(modelPrototype)); - } - - /** - * 批量新增或修改 数据原型表 - */ - @PostMapping("/submit-list") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "批量新增或修改", notes = "传入modelPrototype集合") - public R submitList(@Valid @RequestBody List modelPrototypes) { - return R.status(modelPrototypeService.submitList(modelPrototypes)); - } - - /** - * 删除 数据原型表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(modelPrototypeService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 数据原型列表 - */ - @GetMapping("/select") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "数据原型列表", notes = "数据原型列表") - public R> select(@ApiParam(value = "数据模型Id", required = true) @RequestParam Long modelId) { - List list = modelPrototypeService.list(Wrappers.query().lambda().eq(ModelPrototype::getModelId, modelId)); - list.forEach(prototype -> prototype.setComment(prototype.getJdbcName() + StringPool.COLON + StringPool.SPACE + prototype.getComment())); - return R.data(list); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/dto/ModelDTO.java b/src/main/java/org/springblade/modules/develop/dto/ModelDTO.java deleted file mode 100644 index bd40748..0000000 --- a/src/main/java/org/springblade/modules/develop/dto/ModelDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.dto; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.modules.develop.entity.Model; -import org.springblade.modules.develop.entity.ModelPrototype; - -import java.util.List; - -/** - * 代码模型DTO - * - * @author Chill - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class ModelDTO extends Model { - - private static final long serialVersionUID = 1L; - - /** - * 代码建模原型 - */ - private List prototypes; - -} diff --git a/src/main/java/org/springblade/modules/develop/entity/Code.java b/src/main/java/org/springblade/modules/develop/entity/Code.java deleted file mode 100644 index 0a161f7..0000000 --- a/src/main/java/org/springblade/modules/develop/entity/Code.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -/** - * 实体类 - * - * @author Chill - */ -@Data -@TableName("blade_code") -@ApiModel(value = "Code对象", description = "Code对象") -public class Code implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ASSIGN_ID) - private Long id; - - /** - * 数据模型主键 - */ - @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "数据模型主键") - private Long modelId; - - /** - * 模块名称 - */ - @ApiModelProperty(value = "服务名称") - private String serviceName; - - /** - * 模块名称 - */ - @ApiModelProperty(value = "模块名称") - private String codeName; - - /** - * 表名 - */ - @ApiModelProperty(value = "表名") - private String tableName; - - /** - * 实体名 - */ - @ApiModelProperty(value = "表前缀") - private String tablePrefix; - - /** - * 主键名 - */ - @ApiModelProperty(value = "主键名") - private String pkName; - - /** - * 后端包名 - */ - @ApiModelProperty(value = "后端包名") - private String packageName; - - /** - * 模版类型 - */ - @ApiModelProperty(value = "模版类型") - private String templateType; - - /** - * 作者信息 - */ - @ApiModelProperty(value = "作者信息") - private String author; - - /** - * 子表模型主键 - */ - @ApiModelProperty(value = "子表模型主键") - private String subModelId; - - /** - * 子表绑定外键 - */ - @ApiModelProperty(value = "子表绑定外键") - private String subFkId; - - /** - * 树主键字段 - */ - @ApiModelProperty(value = "树主键字段") - private String treeId; - - /** - * 树父主键字段 - */ - @ApiModelProperty(value = "树父主键字段") - private String treePid; - - /** - * 树名称字段 - */ - @ApiModelProperty(value = "树名称字段") - private String treeName; - - /** - * 基础业务模式 - */ - @ApiModelProperty(value = "基础业务模式") - private Integer baseMode; - - /** - * 包装器模式 - */ - @ApiModelProperty(value = "包装器模式") - private Integer wrapMode; - - /** - * 远程调用模式 - */ - @ApiModelProperty(value = "远程调用模式") - private Integer feignMode; - - /** - * 代码风格 - */ - @ApiModelProperty(value = "代码风格") - private String codeStyle; - - /** - * 后端路径 - */ - @ApiModelProperty(value = "后端路径") - private String apiPath; - - /** - * 前端路径 - */ - @ApiModelProperty(value = "前端路径") - private String webPath; - - /** - * 是否已删除 - */ - @TableLogic - @ApiModelProperty(value = "是否已删除") - private Integer isDeleted; - - -} diff --git a/src/main/java/org/springblade/modules/develop/entity/Datasource.java b/src/main/java/org/springblade/modules/develop/entity/Datasource.java deleted file mode 100644 index e0764cf..0000000 --- a/src/main/java/org/springblade/modules/develop/entity/Datasource.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; - -/** - * 数据源配置表实体类 - * - * @author Chill - */ -@Data -@TableName("blade_datasource") -@EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Datasource对象", description = "数据源配置表") -public class Datasource extends BaseEntity { - - private static final long serialVersionUID = 1L; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - /** - * 驱动类 - */ - @ApiModelProperty(value = "驱动类") - private String driverClass; - /** - * 连接地址 - */ - @ApiModelProperty(value = "连接地址") - private String url; - /** - * 用户名 - */ - @ApiModelProperty(value = "用户名") - private String username; - /** - * 密码 - */ - @ApiModelProperty(value = "密码") - private String password; - /** - * 备注 - */ - @ApiModelProperty(value = "备注") - private String remark; - - -} diff --git a/src/main/java/org/springblade/modules/develop/entity/Model.java b/src/main/java/org/springblade/modules/develop/entity/Model.java deleted file mode 100644 index e934d46..0000000 --- a/src/main/java/org/springblade/modules/develop/entity/Model.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; - -/** - * 数据模型表实体类 - * - * @author Chill - */ -@Data -@TableName("blade_model") -@EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Model对象", description = "数据模型表") -public class Model extends BaseEntity { - - private static final long serialVersionUID = 1L; - - /** - * 数据源主键 - */ - @ApiModelProperty(value = "数据源主键") - @JsonSerialize(using = ToStringSerializer.class) - private Long datasourceId; - /** - * 模型名称 - */ - @ApiModelProperty(value = "模型名称") - private String modelName; - /** - * 模型编号 - */ - @ApiModelProperty(value = "模型编号") - private String modelCode; - /** - * 物理表名 - */ - @ApiModelProperty(value = "物理表名") - private String modelTable; - /** - * 模型类名 - */ - @ApiModelProperty(value = "模型类名") - private String modelClass; - /** - * 模型备注 - */ - @ApiModelProperty(value = "模型备注") - private String modelRemark; - - -} diff --git a/src/main/java/org/springblade/modules/develop/entity/ModelPrototype.java b/src/main/java/org/springblade/modules/develop/entity/ModelPrototype.java deleted file mode 100644 index 5f8534e..0000000 --- a/src/main/java/org/springblade/modules/develop/entity/ModelPrototype.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; - -/** - * 数据原型表实体类 - * - * @author Chill - */ -@Data -@TableName("blade_model_prototype") -@EqualsAndHashCode(callSuper = true) -@ApiModel(value = "ModelPrototype对象", description = "数据原型表") -public class ModelPrototype extends BaseEntity { - - private static final long serialVersionUID = 1L; - - /** - * 模型主键 - */ - @ApiModelProperty(value = "模型主键") - @JsonSerialize(using = ToStringSerializer.class) - private Long modelId; - /** - * 物理列名 - */ - @ApiModelProperty(value = "物理列名") - private String jdbcName; - /** - * 物理类型 - */ - @ApiModelProperty(value = "物理类型") - private String jdbcType; - /** - * 实体列名 - */ - @ApiModelProperty(value = "实体列名") - private String propertyName; - /** - * 实体类型 - */ - @ApiModelProperty(value = "实体类型") - private String propertyType; - /** - * 实体类型引用 - */ - @ApiModelProperty(value = "实体类型引用") - private String propertyEntity; - /** - * 注释说明 - */ - @ApiModelProperty(value = "注释说明") - private String comment; - /** - * 列表显示 - */ - @ApiModelProperty(value = "列表显示") - private Integer isList; - /** - * 表单显示 - */ - @ApiModelProperty(value = "表单显示") - private Integer isForm; - /** - * 独占一行 - */ - @ApiModelProperty(value = "独占一行") - private Integer isRow; - /** - * 组件类型 - */ - @ApiModelProperty(value = "组件类型") - private String componentType; - /** - * 字典编码 - */ - @ApiModelProperty(value = "字典编码") - private String dictCode; - /** - * 是否必填 - */ - @ApiModelProperty(value = "是否必填") - private Integer isRequired; - /** - * 查询配置 - */ - @ApiModelProperty(value = "查询配置") - private Integer isQuery; - /** - * 查询类型 - */ - @ApiModelProperty(value = "查询类型") - private String queryType; - - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java b/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java deleted file mode 100644 index 1003b67..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springblade.modules.develop.entity.Code; - -/** - * Mapper 接口 - * - * @author Chill - */ -public interface CodeMapper extends BaseMapper { - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml b/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml deleted file mode 100644 index bec5490..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.java b/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.java deleted file mode 100644 index ab9643d..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springblade.modules.develop.entity.Datasource; - -/** - * 数据源配置表 Mapper 接口 - * - * @author Chill - */ -public interface DatasourceMapper extends BaseMapper { - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.xml b/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.xml deleted file mode 100644 index 0d58c20..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/org/springblade/modules/develop/mapper/ModelMapper.java b/src/main/java/org/springblade/modules/develop/mapper/ModelMapper.java deleted file mode 100644 index 5671b33..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/ModelMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springblade.modules.develop.entity.Model; - -/** - * 数据模型表 Mapper 接口 - * - * @author Chill - */ -public interface ModelMapper extends BaseMapper { - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/ModelMapper.xml b/src/main/java/org/springblade/modules/develop/mapper/ModelMapper.xml deleted file mode 100644 index d971420..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/ModelMapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/org/springblade/modules/develop/mapper/ModelPrototypeMapper.java b/src/main/java/org/springblade/modules/develop/mapper/ModelPrototypeMapper.java deleted file mode 100644 index 6db01c0..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/ModelPrototypeMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springblade.modules.develop.entity.ModelPrototype; - -/** - * 数据原型表 Mapper 接口 - * - * @author Chill - */ -public interface ModelPrototypeMapper extends BaseMapper { - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/ModelPrototypeMapper.xml b/src/main/java/org/springblade/modules/develop/mapper/ModelPrototypeMapper.xml deleted file mode 100644 index f7764bb..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/ModelPrototypeMapper.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/org/springblade/modules/develop/service/ICodeService.java b/src/main/java/org/springblade/modules/develop/service/ICodeService.java deleted file mode 100644 index f40e867..0000000 --- a/src/main/java/org/springblade/modules/develop/service/ICodeService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service; - - -import com.baomidou.mybatisplus.extension.service.IService; -import org.springblade.modules.develop.entity.Code; - -/** - * 服务类 - * - * @author Chill - */ -public interface ICodeService extends IService { - - /** - * 提交 - * - * @param code - * @return - */ - boolean submit(Code code); - -} diff --git a/src/main/java/org/springblade/modules/develop/service/IDatasourceService.java b/src/main/java/org/springblade/modules/develop/service/IDatasourceService.java deleted file mode 100644 index e23719e..0000000 --- a/src/main/java/org/springblade/modules/develop/service/IDatasourceService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service; - -import org.springblade.core.mp.base.BaseService; -import org.springblade.modules.develop.entity.Datasource; - -/** - * 数据源配置表 服务类 - * - * @author Chill - */ -public interface IDatasourceService extends BaseService { - -} diff --git a/src/main/java/org/springblade/modules/develop/service/IModelPrototypeService.java b/src/main/java/org/springblade/modules/develop/service/IModelPrototypeService.java deleted file mode 100644 index a6b75ec..0000000 --- a/src/main/java/org/springblade/modules/develop/service/IModelPrototypeService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service; - -import org.springblade.core.mp.base.BaseService; -import org.springblade.modules.develop.entity.ModelPrototype; - -import java.util.List; - -/** - * 数据原型表 服务类 - * - * @author Chill - */ -public interface IModelPrototypeService extends BaseService { - - /** - * 批量提交 - * - * @param modelPrototypes 原型集合 - * @return boolean - */ - boolean submitList(List modelPrototypes); - - /** - * 原型列表 - * - * @param modelId 模型ID - * @return List - */ - List prototypeList(Long modelId); - -} diff --git a/src/main/java/org/springblade/modules/develop/service/IModelService.java b/src/main/java/org/springblade/modules/develop/service/IModelService.java deleted file mode 100644 index a5c2cb8..0000000 --- a/src/main/java/org/springblade/modules/develop/service/IModelService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service; - -import org.springblade.core.mp.base.BaseService; -import org.springblade.modules.develop.entity.Model; - -/** - * 数据模型表 服务类 - * - * @author Chill - */ -public interface IModelService extends BaseService { - -} diff --git a/src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java b/src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java deleted file mode 100644 index 8ffb30d..0000000 --- a/src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springblade.core.tool.constant.BladeConstant; -import org.springblade.modules.develop.entity.Code; -import org.springblade.modules.develop.mapper.CodeMapper; -import org.springblade.modules.develop.service.ICodeService; -import org.springframework.stereotype.Service; - -/** - * 服务实现类 - * - * @author Chill - */ -@Service -public class CodeServiceImpl extends ServiceImpl implements ICodeService { - - @Override - public boolean submit(Code code) { - code.setIsDeleted(BladeConstant.DB_NOT_DELETED); - return saveOrUpdate(code); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/service/impl/DatasourceServiceImpl.java b/src/main/java/org/springblade/modules/develop/service/impl/DatasourceServiceImpl.java deleted file mode 100644 index d28b253..0000000 --- a/src/main/java/org/springblade/modules/develop/service/impl/DatasourceServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service.impl; - -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.modules.develop.entity.Datasource; -import org.springblade.modules.develop.mapper.DatasourceMapper; -import org.springblade.modules.develop.service.IDatasourceService; -import org.springframework.stereotype.Service; - -/** - * 数据源配置表 服务实现类 - * - * @author Chill - */ -@Service -public class DatasourceServiceImpl extends BaseServiceImpl implements IDatasourceService { - -} diff --git a/src/main/java/org/springblade/modules/develop/service/impl/ModelPrototypeServiceImpl.java b/src/main/java/org/springblade/modules/develop/service/impl/ModelPrototypeServiceImpl.java deleted file mode 100644 index 9228f87..0000000 --- a/src/main/java/org/springblade/modules/develop/service/impl/ModelPrototypeServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service.impl; - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.modules.develop.entity.ModelPrototype; -import org.springblade.modules.develop.mapper.ModelPrototypeMapper; -import org.springblade.modules.develop.service.IModelPrototypeService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * 数据原型表 服务实现类 - * - * @author Chill - */ -@Service -public class ModelPrototypeServiceImpl extends BaseServiceImpl implements IModelPrototypeService { - - @Override - @Transactional(rollbackFor = Exception.class) - public boolean submitList(List modelPrototypes) { - modelPrototypes.forEach(modelPrototype -> { - if (modelPrototype.getId() == null) { - this.save(modelPrototype); - } else { - this.updateById(modelPrototype); - } - }); - return true; - } - - @Override - public List prototypeList(Long modelId) { - return this.list(Wrappers.lambdaQuery().eq(ModelPrototype::getModelId, modelId)); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/service/impl/ModelServiceImpl.java b/src/main/java/org/springblade/modules/develop/service/impl/ModelServiceImpl.java deleted file mode 100644 index 842117f..0000000 --- a/src/main/java/org/springblade/modules/develop/service/impl/ModelServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.develop.service.impl; - -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.modules.develop.entity.Model; -import org.springblade.modules.develop.mapper.ModelMapper; -import org.springblade.modules.develop.service.IModelService; -import org.springframework.stereotype.Service; - -/** - * 数据模型表 服务实现类 - * - * @author Chill - */ -@Service -public class ModelServiceImpl extends BaseServiceImpl implements IModelService { - -} diff --git a/src/main/java/org/springblade/modules/resource/controller/AttachController.java b/src/main/java/org/springblade/modules/resource/controller/AttachController.java deleted file mode 100644 index 90eeffc..0000000 --- a/src/main/java/org/springblade/modules/resource/controller/AttachController.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.resource.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.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.resource.entity.Attach; -import org.springblade.modules.resource.service.IAttachService; -import org.springblade.modules.resource.vo.AttachVO; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * 附件表 控制器 - * - * @author Chill - */ -@NonDS -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_RESOURCE_NAME + "/attach") -@Api(value = "附件", tags = "附件") -public class AttachController extends BladeController { - - private final IAttachService attachService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入attach") - public R detail(Attach attach) { - Attach detail = attachService.getOne(Condition.getQueryWrapper(attach)); - return R.data(detail); - } - - /** - * 分页 附件表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入attach") - public R> list(Attach attach, Query query) { - IPage pages = attachService.page(Condition.getPage(query), Condition.getQueryWrapper(attach)); - return R.data(pages); - } - - /** - * 自定义分页 附件表 - */ - @GetMapping("/page") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入attach") - public R> page(AttachVO attach, Query query) { - IPage pages = attachService.selectAttachPage(Condition.getPage(query), attach); - return R.data(pages); - } - - /** - * 新增 附件表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入attach") - public R save(@Valid @RequestBody Attach attach) { - return R.status(attachService.save(attach)); - } - - /** - * 修改 附件表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入attach") - public R update(@Valid @RequestBody Attach attach) { - return R.status(attachService.updateById(attach)); - } - - /** - * 新增或修改 附件表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入attach") - public R submit(@Valid @RequestBody Attach attach) { - return R.status(attachService.saveOrUpdate(attach)); - } - - - /** - * 删除 附件表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(attachService.deleteLogic(Func.toLongList(ids))); - } - - -} diff --git a/src/main/java/org/springblade/modules/resource/controller/OssController.java b/src/main/java/org/springblade/modules/resource/controller/OssController.java deleted file mode 100644 index 9a97103..0000000 --- a/src/main/java/org/springblade/modules/resource/controller/OssController.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.resource.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.cache.utils.CacheUtil; -import org.springblade.core.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.RoleConstant; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.resource.entity.Oss; -import org.springblade.modules.resource.service.IOssService; -import org.springblade.modules.resource.vo.OssVO; -import org.springblade.modules.resource.wrapper.OssWrapper; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; - -import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; - -/** - * 控制器 - * - * @author BladeX - */ -@NonDS -@ApiIgnore -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_RESOURCE_NAME + "/oss") -@PreAuth(RoleConstant.HAS_ROLE_ADMIN) -@Api(value = "对象存储接口", tags = "对象存储接口") -public class OssController extends BladeController { - - private final IOssService ossService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入oss") - public R detail(Oss oss) { - Oss detail = ossService.getOne(Condition.getQueryWrapper(oss)); - return R.data(OssWrapper.build().entityVO(detail)); - } - - /** - * 分页 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入oss") - public R> list(Oss oss, Query query) { - IPage pages = ossService.page(Condition.getPage(query), Condition.getQueryWrapper(oss)); - return R.data(OssWrapper.build().pageVO(pages)); - } - - /** - * 自定义分页 - */ - @GetMapping("/page") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入oss") - public R> page(OssVO oss, Query query) { - IPage pages = ossService.selectOssPage(Condition.getPage(query), oss); - return R.data(pages); - } - - /** - * 新增 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入oss") - public R save(@Valid @RequestBody Oss oss) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(ossService.save(oss)); - } - - /** - * 修改 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入oss") - public R update(@Valid @RequestBody Oss oss) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(ossService.updateById(oss)); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入oss") - public R submit(@Valid @RequestBody Oss oss) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(ossService.submit(oss)); - } - - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(ossService.deleteLogic(Func.toLongList(ids))); - } - - - /** - * 启用 - */ - @PostMapping("/enable") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "配置启用", notes = "传入id") - public R enable(@ApiParam(value = "主键", required = true) @RequestParam Long id) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(ossService.enable(id)); - } - -} diff --git a/src/main/java/org/springblade/modules/resource/controller/SmsController.java b/src/main/java/org/springblade/modules/resource/controller/SmsController.java deleted file mode 100644 index 44acf4b..0000000 --- a/src/main/java/org/springblade/modules/resource/controller/SmsController.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.resource.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.cache.utils.CacheUtil; -import org.springblade.core.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.RoleConstant; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.resource.entity.Sms; -import org.springblade.modules.resource.service.ISmsService; -import org.springblade.modules.resource.vo.SmsVO; -import org.springblade.modules.resource.wrapper.SmsWrapper; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; - -import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; - -/** - * 短信配置表 控制器 - * - * @author BladeX - */ -@NonDS -@ApiIgnore -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_RESOURCE_NAME + "/sms") -@PreAuth(RoleConstant.HAS_ROLE_ADMIN) -@Api(value = "短信配置表", tags = "短信配置表接口") -public class SmsController extends BladeController { - - private final ISmsService smsService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入sms") - public R detail(Sms sms) { - Sms detail = smsService.getOne(Condition.getQueryWrapper(sms)); - return R.data(SmsWrapper.build().entityVO(detail)); - } - - /** - * 分页 短信配置表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入sms") - public R> list(Sms sms, Query query) { - IPage pages = smsService.page(Condition.getPage(query), Condition.getQueryWrapper(sms)); - return R.data(SmsWrapper.build().pageVO(pages)); - } - - - /** - * 自定义分页 短信配置表 - */ - @GetMapping("/page") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入sms") - public R> page(SmsVO sms, Query query) { - IPage pages = smsService.selectSmsPage(Condition.getPage(query), sms); - return R.data(pages); - } - - /** - * 新增 短信配置表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入sms") - public R save(@Valid @RequestBody Sms sms) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(smsService.save(sms)); - } - - /** - * 修改 短信配置表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入sms") - public R update(@Valid @RequestBody Sms sms) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(smsService.updateById(sms)); - } - - /** - * 新增或修改 短信配置表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入sms") - public R submit(@Valid @RequestBody Sms sms) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(smsService.submit(sms)); - } - - - /** - * 删除 短信配置表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(smsService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 启用 - */ - @PostMapping("/enable") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "配置启用", notes = "传入id") - public R enable(@ApiParam(value = "主键", required = true) @RequestParam Long id) { - CacheUtil.clear(RESOURCE_CACHE); - return R.status(smsService.enable(id)); - } - - -} diff --git a/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java b/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java index 000d2ad..9b65429 100644 --- a/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java +++ b/src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java @@ -54,91 +54,6 @@ public class OssEndpoint { */ private final OssBuilder ossBuilder; - /** - * 附件表服务 - */ - private final IAttachService attachService; - - /** - * 创建存储桶 - * - * @param bucketName 存储桶名称 - * @return Bucket - */ - @SneakyThrows - @PostMapping("/make-bucket") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R makeBucket(@RequestParam String bucketName) { - ossBuilder.template().makeBucket(bucketName); - return R.success("创建成功"); - } - - /** - * 创建存储桶 - * - * @param bucketName 存储桶名称 - * @return R - */ - @SneakyThrows - @PostMapping("/remove-bucket") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R removeBucket(@RequestParam String bucketName) { - ossBuilder.template().removeBucket(bucketName); - return R.success("删除成功"); - } - - /** - * 拷贝文件 - * - * @param fileName 存储桶对象名称 - * @param destBucketName 目标存储桶名称 - * @param destFileName 目标存储桶对象名称 - * @return R - */ - @SneakyThrows - @PostMapping("/copy-file") - public R copyFile(@RequestParam String fileName, @RequestParam String destBucketName, String destFileName) { - ossBuilder.template().copyFile(fileName, destBucketName, destFileName); - return R.success("操作成功"); - } - - /** - * 获取文件信息 - * - * @param fileName 存储桶对象名称 - * @return InputStream - */ - @SneakyThrows - @GetMapping("/stat-file") - public R statFile(@RequestParam String fileName) { - return R.data(ossBuilder.template().statFile(fileName)); - } - - /** - * 获取文件相对路径 - * - * @param fileName 存储桶对象名称 - * @return String - */ - @SneakyThrows - @GetMapping("/file-path") - public R filePath(@RequestParam String fileName) { - return R.data(ossBuilder.template().filePath(fileName)); - } - - - /** - * 获取文件外链 - * - * @param fileName 存储桶对象名称 - * @return String - */ - @SneakyThrows - @GetMapping("/file-link") - public R fileLink(@RequestParam String fileName) { - return R.data(ossBuilder.template().fileLink(fileName)); - } - /** * 上传文件 * @@ -148,105 +63,16 @@ public class OssEndpoint { @SneakyThrows @PostMapping("/put-file") public R putFile(@RequestParam MultipartFile file) { + // 由于部署到服务器会被上传可执行文件, 故此处添加图片格式限制 png, jpeg + String suffix = StringUtils.substringAfterLast(file.getOriginalFilename(), "."); + + if (!"png".equals(suffix) && !"jpeg".equals(suffix)) { + return R.fail("上传失败, 文件格式错误!"); + } + BladeFile bladeFile = ossBuilder.template().putFile(file.getOriginalFilename(), file.getInputStream()); String domain = StringUtils.substringBeforeLast(bladeFile.getDomain(), "/"); bladeFile.setLink(bladeFile.getLink().replace(domain, BusinessConstant.STRING_EMPTY)); return R.data(bladeFile); } - - /** - * 上传文件 - * - * @param fileName 存储桶对象名称 - * @param file 文件 - * @return ObjectStat - */ - @SneakyThrows - @PostMapping("/put-file-by-name") - public R putFile(@RequestParam String fileName, @RequestParam MultipartFile file) { - BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); - return R.data(bladeFile); - } - - /** - * 上传文件并保存至附件表 - * - * @param file 文件 - * @return ObjectStat - */ - @SneakyThrows - @PostMapping("/put-file-attach") - public R putFileAttach(@RequestParam MultipartFile file) { - String fileName = file.getOriginalFilename(); - BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); - Long attachId = buildAttach(fileName, file.getSize(), bladeFile); - bladeFile.setAttachId(attachId); - return R.data(bladeFile); - } - - /** - * 上传文件并保存至附件表 - * - * @param fileName 存储桶对象名称 - * @param file 文件 - * @return ObjectStat - */ - @SneakyThrows - @PostMapping("/put-file-attach-by-name") - public R putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file) { - BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); - Long attachId = buildAttach(fileName, file.getSize(), bladeFile); - bladeFile.setAttachId(attachId); - return R.data(bladeFile); - } - - /** - * 构建附件表 - * - * @param fileName 文件名 - * @param fileSize 文件大小 - * @param bladeFile 对象存储文件 - * @return attachId - */ - private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile) { - String fileExtension = FileUtil.getFileExtension(fileName); - Attach attach = new Attach(); - attach.setDomainUrl(bladeFile.getDomain()); - attach.setLink(bladeFile.getLink()); - attach.setName(bladeFile.getName()); - attach.setOriginalName(bladeFile.getOriginalName()); - attach.setAttachSize(fileSize); - attach.setExtension(fileExtension); - attachService.save(attach); - return attach.getId(); - } - - /** - * 删除文件 - * - * @param fileName 存储桶对象名称 - * @return R - */ - @SneakyThrows - @PostMapping("/remove-file") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R removeFile(@RequestParam String fileName) { - ossBuilder.template().removeFile(fileName); - return R.success("操作成功"); - } - - /** - * 批量删除文件 - * - * @param fileNames 存储桶对象名称集合 - * @return R - */ - @SneakyThrows - @PostMapping("/remove-files") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R removeFiles(@RequestParam String fileNames) { - ossBuilder.template().removeFiles(Func.toStrList(fileNames)); - return R.success("操作成功"); - } - } diff --git a/src/main/java/org/springblade/modules/resource/endpoint/SmsEndpoint.java b/src/main/java/org/springblade/modules/resource/endpoint/SmsEndpoint.java deleted file mode 100644 index 70f7fc3..0000000 --- a/src/main/java/org/springblade/modules/resource/endpoint/SmsEndpoint.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.resource.endpoint; - -import io.swagger.annotations.Api; -import lombok.AllArgsConstructor; -import lombok.SneakyThrows; -import org.springblade.core.launch.constant.AppConstant; -import org.springblade.core.sms.model.SmsCode; -import org.springblade.core.sms.model.SmsData; -import org.springblade.core.sms.model.SmsResponse; -import org.springblade.core.tenant.annotation.NonDS; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.jackson.JsonUtil; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.resource.builder.sms.SmsBuilder; -import org.springblade.modules.resource.utils.SmsUtil; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.HashMap; -import java.util.Map; - -import static org.springblade.modules.resource.utils.SmsUtil.*; - -/** - * 短信服务端点 - * - * @author Chill - */ -@NonDS -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_RESOURCE_NAME + "/sms/endpoint") -@Api(value = "短信服务端点", tags = "短信服务端点") -public class SmsEndpoint { - - /** - * 短信服务构建类 - */ - private final SmsBuilder smsBuilder; - - //================================= 短信服务校验 ================================= - - /** - * 短信验证码发送 - * - * @param phone 手机号 - */ - @SneakyThrows - @PostMapping("/send-validate") - public R sendValidate(@RequestParam String phone) { - Map params = SmsUtil.getValidateParams(); - SmsCode smsCode = smsBuilder.template().sendValidate(new SmsData(params).setKey(PARAM_KEY), phone); - return smsCode.isSuccess() ? R.data(smsCode, SEND_SUCCESS) : R.fail(SEND_FAIL); - } - - /** - * 校验短信 - * - * @param smsCode 短信校验信息 - */ - @SneakyThrows - @PostMapping("/validate-message") - public R validateMessage(SmsCode smsCode) { - boolean validate = smsBuilder.template().validateMessage(smsCode); - return validate ? R.success(VALIDATE_SUCCESS) : R.fail(VALIDATE_FAIL); - } - - //========== 通用短信自定义发送(支持自定义params参数传递, 推荐用于测试, 不推荐用于生产环境) ========== - - /** - * 发送信息 - * - * @param code 资源编号 - * @param params 自定义短信参数 - * @param phones 手机号集合 - */ - @SneakyThrows - @PostMapping("/send-message") - public R sendMessage(@RequestParam String code, @RequestParam String params, @RequestParam String phones) { - SmsData smsData = new SmsData(JsonUtil.readMap(params, String.class, String.class)); - return send(code, smsData, phones); - } - - //========== 指定短信服务发送(可根据各种场景自定拓展定制, 损失灵活性增加安全性, 推荐用于生产环境) ========== - - /** - * 短信通知 - * - * @param phones 手机号集合 - */ - @SneakyThrows - @PostMapping("/send-notice") - public R sendNotice(@RequestParam String phones) { - Map params = new HashMap<>(3); - params.put("title", "通知标题"); - params.put("content", "通知内容"); - params.put("date", "通知时间"); - SmsData smsData = new SmsData(params); - return send(smsData, phones); - } - - /** - * 订单通知 - * - * @param phones 手机号集合 - */ - @SneakyThrows - @PostMapping("/send-order") - public R sendOrder(@RequestParam String phones) { - Map params = new HashMap<>(3); - params.put("orderNo", "订单编号"); - params.put("packageNo", "快递单号"); - params.put("user", "收件人"); - SmsData smsData = new SmsData(params); - return send(smsData, phones); - } - - /** - * 会议通知 - * - * @param phones 手机号集合 - */ - @SneakyThrows - @PostMapping("/send-meeting") - public R sendMeeting(@RequestParam String phones) { - Map params = new HashMap<>(2); - params.put("roomId", "会议室"); - params.put("topic", "会议主题"); - params.put("date", "会议时间"); - SmsData smsData = new SmsData(params); - return send(smsData, phones); - } - - //================================= 通用短信发送接口 ================================= - - /** - * 通用短信发送接口 - * - * @param smsData 短信内容 - * @param phones 手机号列表 - * @return 是否发送成功 - */ - private R send(SmsData smsData, String phones) { - SmsResponse response = smsBuilder.template().sendMessage(smsData, Func.toStrList(phones)); - return response.isSuccess() ? R.success(SEND_SUCCESS) : R.fail(SEND_FAIL); - } - - /** - * 通用短信发送接口 - * - * @param code 资源编号 - * @param smsData 短信内容 - * @param phones 手机号列表 - * @return 是否发送成功 - */ - private R send(String code, SmsData smsData, String phones) { - SmsResponse response = smsBuilder.template(code).sendMessage(smsData, Func.toStrList(phones)); - return response.isSuccess() ? R.success(SEND_SUCCESS) : R.fail(SEND_FAIL); - } - -} diff --git a/src/main/java/org/springblade/modules/system/controller/DeptController.java b/src/main/java/org/springblade/modules/system/controller/DeptController.java index c01f46d..a648ac5 100644 --- a/src/main/java/org/springblade/modules/system/controller/DeptController.java +++ b/src/main/java/org/springblade/modules/system/controller/DeptController.java @@ -175,16 +175,4 @@ public class DeptController extends BladeController { return R.data(list); } - /** - * 列表-医院 - */ - @PreAuth("") - @GetMapping("/list-hospital") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "列表-医院", notes = "列表-医院") - public R> listHospital() { - List list = deptService.list(Wrappers.lambdaQuery().eq(Dept::getDeptCategory, BusinessConstant.DEPT_CATEGORY_HOSPITAL)); - return R.data(DeptWrapper.build().listNodeVO(list)); - } - } diff --git a/src/main/java/org/springblade/modules/system/controller/ParamController.java b/src/main/java/org/springblade/modules/system/controller/ParamController.java deleted file mode 100644 index 491c024..0000000 --- a/src/main/java/org/springblade/modules/system/controller/ParamController.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.system.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; -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.tenant.annotation.NonDS; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.system.entity.Param; -import org.springblade.modules.system.service.IParamService; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; -import java.util.Map; - -import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE; - -/** - * 控制器 - * - * @author Chill - */ -@NonDS -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/param") -@Api(value = "参数管理", tags = "参数管理") -public class ParamController extends BladeController { - - private final IParamService paramService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入param") - public R detail(Param param) { - Param detail = paramService.getOne(Condition.getQueryWrapper(param)); - return R.data(detail); - } - - /** - * 分页 - */ - @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "paramName", value = "参数名称", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "paramKey", value = "参数键名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "paramValue", value = "参数键值", paramType = "query", dataType = "string") - }) - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入param") - public R> list(@ApiIgnore @RequestParam Map param, Query query) { - IPage pages = paramService.page(Condition.getPage(query), Condition.getQueryWrapper(param, Param.class)); - return R.data(pages); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增或修改", notes = "传入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) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - CacheUtil.clear(PARAM_CACHE); - CacheUtil.clear(PARAM_CACHE, Boolean.FALSE); - return R.status(paramService.deleteLogic(Func.toLongList(ids))); - } - - -} diff --git a/src/main/java/org/springblade/modules/system/controller/PostController.java b/src/main/java/org/springblade/modules/system/controller/PostController.java deleted file mode 100644 index dd30eec..0000000 --- a/src/main/java/org/springblade/modules/system/controller/PostController.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.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.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.cache.utils.CacheUtil; -import org.springblade.core.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.tenant.annotation.NonDS; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.system.entity.Post; -import org.springblade.modules.system.service.IPostService; -import org.springblade.modules.system.vo.PostVO; -import org.springblade.modules.system.wrapper.PostWrapper; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; - -/** - * 岗位表 控制器 - * - * @author Chill - */ -@NonDS -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/post") -@Api(value = "岗位", tags = "岗位") -public class PostController extends BladeController { - - private final IPostService postService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入post") - public R detail(Post post) { - Post detail = postService.getOne(Condition.getQueryWrapper(post)); - return R.data(PostWrapper.build().entityVO(detail)); - } - - /** - * 分页 岗位表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入post") - public R> list(Post post, Query query) { - IPage pages = postService.page(Condition.getPage(query), Condition.getQueryWrapper(post)); - return R.data(PostWrapper.build().pageVO(pages)); - } - - - /** - * 自定义分页 岗位表 - */ - @GetMapping("/page") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入post") - public R> page(PostVO post, Query query) { - IPage pages = postService.selectPostPage(Condition.getPage(query), post); - return R.data(pages); - } - - /** - * 新增 岗位表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入post") - public R save(@Valid @RequestBody Post post) { - CacheUtil.clear(SYS_CACHE); - return R.status(postService.save(post)); - } - - /** - * 修改 岗位表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入post") - public R update(@Valid @RequestBody Post post) { - CacheUtil.clear(SYS_CACHE); - return R.status(postService.updateById(post)); - } - - /** - * 新增或修改 岗位表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入post") - public R submit(@Valid @RequestBody Post post) { - CacheUtil.clear(SYS_CACHE); - return R.status(postService.saveOrUpdate(post)); - } - - - /** - * 删除 岗位表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - CacheUtil.clear(SYS_CACHE); - return R.status(postService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 下拉数据源 - */ - @GetMapping("/select") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "下拉数据源", notes = "传入post") - public R> select(String tenantId, BladeUser bladeUser) { - List list = postService.list(Wrappers.query().lambda().eq(Post::getTenantId, Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()))); - return R.data(list); - } - -} diff --git a/src/main/java/org/springblade/modules/system/controller/SearchController.java b/src/main/java/org/springblade/modules/system/controller/SearchController.java deleted file mode 100644 index 75694d7..0000000 --- a/src/main/java/org/springblade/modules/system/controller/SearchController.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.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.annotations.Api; -import io.swagger.annotations.ApiOperation; -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.entity.Post; -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.vo.DeptVO; -import org.springblade.modules.system.vo.PostVO; -import org.springblade.modules.system.vo.RoleVO; -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") -@Api(value = "查询", tags = "查询") -public class SearchController { - - private final IRoleService roleService; - - private final IDeptService deptService; - - private final IPostService postService; - - /** - * 角色信息查询 - */ - @GetMapping("/role") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "角色信息查询", notes = "传入roleName或者parentId") - public R> roleSearch(String roleName, Long parentId) { - return R.data(roleService.search(roleName, parentId)); - } - - /** - * 部门信息查询 - */ - @GetMapping("/dept") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "部门信息查询", notes = "传入deptName或者parentId") - public R> deptSearch(String deptName, Long parentId) { - return R.data(deptService.search(deptName, parentId)); - } - - /** - * 岗位信息查询 - */ - @GetMapping("/post") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "岗位信息查询", notes = "传入postName") - public R> postSearch(String postName, Query query) { - LambdaQueryWrapper queryWrapper = Wrappers.query().lambda(); - if (Func.isNotBlank(postName)) { - queryWrapper.like(Post::getPostName, postName); - } - IPage pages = postService.page(Condition.getPage(query), queryWrapper); - return R.data(PostWrapper.build().pageVO(pages)); - } - -} diff --git a/src/main/java/org/springblade/modules/system/controller/TenantController.java b/src/main/java/org/springblade/modules/system/controller/TenantController.java deleted file mode 100644 index 589dc36..0000000 --- a/src/main/java/org/springblade/modules/system/controller/TenantController.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.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.annotations.*; -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.constant.BladeConstant; -import org.springblade.core.tool.constant.RoleConstant; -import org.springblade.core.tool.support.Kv; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.system.entity.Tenant; -import org.springblade.modules.system.entity.TenantPackage; -import org.springblade.modules.system.service.ITenantPackageService; -import org.springblade.modules.system.service.ITenantService; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; -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") -@Api(value = "租户管理", tags = "租户管理") -public class TenantController extends BladeController { - - private final ITenantService tenantService; - private final ITenantPackageService tenantPackageService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R detail(Tenant tenant) { - Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant)); - return R.data(detail); - } - - /** - * 分页 - */ - @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "tenantId", value = "参数名称", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "tenantName", value = "角色别名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "contactNumber", value = "联系电话", paramType = "query", dataType = "string") - }) - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> list(@ApiIgnore @RequestParam Map tenant, Query query, BladeUser bladeUser) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class); - IPage 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) - @ApiOperation(value = "下拉数据源", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> select(Tenant tenant, BladeUser bladeUser) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(tenant); - List list = tenantService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); - return R.data(list); - } - - /** - * 自定义分页 - */ - @GetMapping("/page") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "分页", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> page(Tenant tenant, Query query) { - IPage pages = tenantService.selectTenantPage(Condition.getPage(query), tenant); - return R.data(pages); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) - public R submit(@Valid @RequestBody Tenant tenant) { - return R.status(tenantService.submitTenant(tenant)); - } - - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(tenantService.removeTenant(Func.toLongList(ids))); - } - - /** - * 授权配置 - */ - @PostMapping("/setting") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "授权配置", notes = "传入ids,accountNumber,expireTime") - @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) - public R setting(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @ApiParam(value = "账号额度") Integer accountNumber, @ApiParam(value = "过期时间") Date expireTime) { - return R.status(tenantService.setting(accountNumber, expireTime, ids)); - } - - /** - * 数据源配置 - */ - @PostMapping("datasource") - @ApiOperationSupport(order = 8) - @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) - @ApiOperation(value = "数据源配置", notes = "传入datasource_id") - public R datasource(@ApiParam(value = "租户ID", required = true) @RequestParam String tenantId, @ApiParam(value = "数据源ID", required = true) @RequestParam Long datasourceId) { - CacheUtil.evict(TENANT_DATASOURCE_CACHE, TENANT_DATASOURCE_EXIST_KEY, tenantId, Boolean.FALSE); - return R.status(tenantService.update(Wrappers.update().lambda().set(Tenant::getDatasourceId, datasourceId).eq(Tenant::getTenantId, tenantId))); - } - - /** - * 根据名称查询列表 - * - * @param name 租户名称 - */ - @GetMapping("/find-by-name") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "详情", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> findByName(String name) { - List list = tenantService.list(Wrappers.query().lambda().like(Tenant::getTenantName, name)); - return R.data(list); - } - - /** - * 根据域名查询信息 - * - * @param domain 域名 - */ - @GetMapping("/info") - @ApiOperationSupport(order = 10) - @ApiOperation(value = "配置信息", notes = "传入domain") - public R info(String domain) { - Tenant tenant = tenantService.getOne(Wrappers.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 - */ - @GetMapping("/package-detail") - @ApiOperationSupport(order = 11) - @ApiOperation(value = "产品包详情", notes = "传入tenantId") - @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) - public R packageDetail(Long tenantId) { - Tenant tenant = tenantService.getById(tenantId); - return R.data(tenantPackageService.getById(tenant.getPackageId())); - } - - /** - * 产品包配置 - */ - @PostMapping("/package-setting") - @ApiOperationSupport(order = 12) - @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) - @ApiOperation(value = "产品包配置", notes = "传入packageId") - public R packageSetting(@ApiParam(value = "租户ID", required = true) @RequestParam String tenantId, @ApiParam(value = "产品包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.update().lambda().set(Tenant::getPackageId, packageId).eq(Tenant::getTenantId, tenantId))); - } - - -} diff --git a/src/main/java/org/springblade/modules/system/controller/TenantPackageController.java b/src/main/java/org/springblade/modules/system/controller/TenantPackageController.java deleted file mode 100644 index 476800b..0000000 --- a/src/main/java/org/springblade/modules/system/controller/TenantPackageController.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.system.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.cache.utils.CacheUtil; -import org.springblade.core.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.tool.api.R; -import org.springblade.core.tool.constant.RoleConstant; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.system.entity.TenantPackage; -import org.springblade.modules.system.service.ITenantPackageService; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; - -/** - * 租户产品表 控制器 - * - * @author BladeX - */ -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/tenant-package") -@Api(value = "租户产品表", tags = "租户产品表接口") -public class TenantPackageController extends BladeController { - - private final ITenantPackageService tenantPackageService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入tenantPackage") - public R detail(TenantPackage tenantPackage) { - TenantPackage detail = tenantPackageService.getOne(Condition.getQueryWrapper(tenantPackage)); - return R.data(detail); - } - - /** - * 分页 租户产品表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入tenantPackage") - public R> list(TenantPackage tenantPackage, Query query) { - IPage pages = tenantPackageService.page(Condition.getPage(query), Condition.getQueryWrapper(tenantPackage)); - return R.data(pages); - } - - /** - * 新增 租户产品表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入tenantPackage") - public R save(@Valid @RequestBody TenantPackage tenantPackage) { - return R.status(tenantPackageService.save(tenantPackage)); - } - - /** - * 修改 租户产品表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入tenantPackage") - public R update(@Valid @RequestBody TenantPackage tenantPackage) { - return R.status(tenantPackageService.updateById(tenantPackage)); - } - - /** - * 新增或修改 租户产品表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入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) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - CacheUtil.clear(SYS_CACHE, Boolean.FALSE); - return R.status(tenantPackageService.deleteLogic(Func.toLongList(ids))); - } - - - /** - * 下拉数据源 - */ - @GetMapping("/select") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "下拉数据源", notes = "传入tenant") - @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> select(TenantPackage tenantPackage) { - return R.data(tenantPackageService.list(Condition.getQueryWrapper(tenantPackage))); - } - - -} diff --git a/src/main/java/org/springblade/modules/system/controller/TopMenuController.java b/src/main/java/org/springblade/modules/system/controller/TopMenuController.java deleted file mode 100644 index 53a1b9d..0000000 --- a/src/main/java/org/springblade/modules/system/controller/TopMenuController.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.modules.system.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.cache.utils.CacheUtil; -import org.springblade.core.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.RoleConstant; -import org.springblade.core.tool.utils.Func; -import org.springblade.modules.system.entity.TopMenu; -import org.springblade.modules.system.service.ITopMenuService; -import org.springblade.modules.system.vo.GrantVO; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -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 -@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/topmenu") -@Api(value = "顶部菜单表", tags = "顶部菜单") -@PreAuth(RoleConstant.HAS_ROLE_ADMIN) -public class TopMenuController extends BladeController { - - private final ITopMenuService topMenuService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入topMenu") - public R detail(TopMenu topMenu) { - TopMenu detail = topMenuService.getOne(Condition.getQueryWrapper(topMenu)); - return R.data(detail); - } - - /** - * 分页 顶部菜单表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入topMenu") - public R> list(TopMenu topMenu, Query query) { - IPage pages = topMenuService.page(Condition.getPage(query), Condition.getQueryWrapper(topMenu).lambda().orderByAsc(TopMenu::getSort)); - return R.data(pages); - } - - /** - * 新增 顶部菜单表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入topMenu") - public R save(@Valid @RequestBody TopMenu topMenu) { - return R.status(topMenuService.save(topMenu)); - } - - /** - * 修改 顶部菜单表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入topMenu") - public R update(@Valid @RequestBody TopMenu topMenu) { - return R.status(topMenuService.updateById(topMenu)); - } - - /** - * 新增或修改 顶部菜单表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入topMenu") - public R submit(@Valid @RequestBody TopMenu topMenu) { - return R.status(topMenuService.saveOrUpdate(topMenu)); - } - - - /** - * 删除 顶部菜单表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(topMenuService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 设置顶部菜单 - */ - @PostMapping("/grant") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "顶部菜单配置", notes = "传入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); - } - -} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2a7317c..dc38f76 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -120,6 +120,8 @@ blade: token: #是否有状态 state: false + # 令牌签名 + sign-key: QdscgsASDFQWERZXZCVHYGTNBJIOLKMUPabc123defghijkmalnopteqrstzuvwxhgrzy345 #redis序列化方式 redis: serializer-type: protostuff @@ -141,49 +143,19 @@ blade: big-num-to-string: true #支持text文本请求,与报文加密同时开启 support-text-plain: false - #xss配置 -# xss: -# enabled: true -# skip-url: -# - /blade-chat/weixin -# - /blade-desk/notice/submit #安全框架配置 secure: #接口放行 skip-url: - - /blade-test/** - - /blade-business/** - - /blade-system/** -# #授权认证配置 -# auth: -# - method: ALL -# pattern: /blade-chat/weixin/** -# expression: "hasAuth()" -# - method: POST -# pattern: /blade-desk/dashboard/upload -# expression: "hasTimeAuth(9, 17)" -# - method: POST -# pattern: /blade-desk/dashboard/submit -# expression: "hasAnyRole('administrator', 'admin', 'user')" -# #基础认证配置 -# basic: -# - method: ALL -# pattern: /blade-desk/dashboard/info -# username: "blade" -# password: "blade" -# #动态签名认证配置 -# sign: -# - method: ALL -# pattern: /blade-desk/dashboard/sign -# crypto: "sha1" -# #多终端认证配置 -# client: -# - client-id: sword -# path-patterns: -# - /blade-sword/** -# - client-id: saber -# path-patterns: -# - /blade-saber/** + - /blade-system/dept-hospital/list-hospital + - /blade-business/article/detail-publish + - /blade-business/blacklist/user-blacklist + - /blade-business/apm-config/already-config-day + - /blade-business/apm-config/detail-for-apm + - /blade-business/apm-record/save + - /blade-business/apm-record/page + - /blade-business/apm-record/cancel + - /blade-business/common-api/get-system-datetime #多租户配置 tenant: #多租户增强 diff --git a/src/main/resources/static/images/icon.png b/src/main/resources/static/images/icon.png deleted file mode 100644 index 633a2f0..0000000 Binary files a/src/main/resources/static/images/icon.png and /dev/null differ