yangys
2024-04-11 d19f16214e16b1a33b71fd8f63662a35d8a2dc04
修改lambda错误,增加swagger开关
已修改9个文件
47 ■■■■ 文件已修改
smart-man-boot/src/main/java/com/qianwen/smartman/common/config/SwaggerConfiguration.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/common/launch/SwaggerPlugin.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/InterfaceConfigFieldController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/DictServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/GalleryServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/InterfaceConfigFieldServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/InterfaceConfigServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/resources/application.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-swagger/src/main/java/com/qianwen/core/swagger/SwaggerUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/common/config/SwaggerConfiguration.java
@@ -14,6 +14,8 @@
import com.qianwen.core.swagger.SwaggerProperties;
import com.qianwen.core.swagger.SwaggerUtil;
import com.qianwen.smartman.modules.dmpLog.constant.DmpLogSyncConstant;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.plugin.core.config.EnablePluginRegistries;
@@ -33,6 +35,8 @@
@EnableSwagger
@Configuration
@EnablePluginRegistries({SwaggerPlugin.class})
public class SwaggerConfiguration {
    private final SwaggerProperties swaggerProperties;
    private final OpenApiExtensionResolver openApiExtensionResolver;
smart-man-boot/src/main/java/com/qianwen/smartman/common/launch/SwaggerPlugin.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.StrUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
@@ -15,9 +16,11 @@
@Component
@Order(-2147481647)
@ConditionalOnProperty(name ="enable" ,prefix = "swagger",havingValue = "true",matchIfMissing = true)
public class SwaggerPlugin implements OperationBuilderPlugin {
    private static final Logger log = LoggerFactory.getLogger(SwaggerPlugin.class);
    @Override
    public void apply(OperationContext operationContext) {
        RequestMappingContext requestContext = (RequestMappingContext) BeanUtil.getProperty(operationContext, "requestContext");
        WebMvcRequestHandler handler = (WebMvcRequestHandler) BeanUtil.getProperty(requestContext, "handler");
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/controller/InterfaceConfigFieldController.java
@@ -40,7 +40,6 @@
@Api(value = "动态接口字段管理", tags = {"动态接口字段管理"})
@ApiResource({"blade-system/interface-config-field"})
@RestController
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/controller/InterfaceConfigFieldController.class */
public class InterfaceConfigFieldController extends BladeController {
    private IInterfaceConfigFieldService interfaceConfigFieldService;
@@ -62,9 +61,8 @@
    @ApiOperation(value = "接口字段表列表", notes = "传入map")
    public R<List<InterfaceConfigFieldVO>> list(@RequestParam @ApiIgnore Map<String, Object> params) {
        String configId = (String) params.get("configId");
        List<InterfaceConfigField> list = this.interfaceConfigFieldService.list(Condition.getQueryWrapper(params, InterfaceConfigField.class).lambda().eq(Func.isNotBlank(configId), (v0) -> {
            return v0.getConfigId();
        }, configId));
        List<InterfaceConfigField> list = this.interfaceConfigFieldService.list(Condition.getQueryWrapper(params, InterfaceConfigField.class).lambda().eq(Func.isNotBlank(configId),
                InterfaceConfigField::getConfigId, configId));
        List<InterfaceConfigFieldVO> collect = list.stream().map(item -> {
            InterfaceConfigFieldVO convert = InterfaceConfigFieldConvert.INSTANCE.convert(item);
            convert.setRelationFieldNames(Optional.ofNullable(this.interfaceConfigFieldService.findRelation(item)).map(f -> {
@@ -81,7 +79,7 @@
    @GetResource({"/count"})
    @ApiOperation(value = "接口字段表统计值", notes = "传入map")
    public R<Long> count(@RequestParam @ApiIgnore Map<String, Object> params) {
        Long count = Long.valueOf(this.interfaceConfigFieldService.count(Condition.getQueryWrapper(params, InterfaceConfigField.class)));
        Long count = this.interfaceConfigFieldService.count(Condition.getQueryWrapper(params, InterfaceConfigField.class));
        return R.data(count);
    }
@@ -114,7 +112,7 @@
    @ApiOperationSupport(order = 6)
    @DeleteResource({"/remove"})
    @ApiOperation(value = "接口字段表删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键", required = true) @RequestBody List<String> ids) {
    public R<Void> remove(@ApiParam(value = "主键", required = true) @RequestBody List<String> ids) {
        if (ids.isEmpty()) {
            return R.status(false);
        }
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/DictServiceImpl.java
@@ -28,22 +28,22 @@
@Service
public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements IDictService {
    
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public IPage<DictVO> selectDictPage(IPage<DictVO> page, DictVO dict) {
        return page.setRecords(this.baseMapper.selectDictPage(page, dict));
    }
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public List<DictVO> tree() {
        return ForestNodeMerger.merge(this.baseMapper.tree());
    }
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public List<DictVO> parentTree() {
        return ForestNodeMerger.merge(this.baseMapper.parentTree());
    }
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public String getValue(String code, String dictKey) {
        return Func.toStr(this.baseMapper.getValue(code, dictKey), "");
    }
@@ -53,7 +53,7 @@
        return this.baseMapper.getList(code);
    }
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public boolean submit(Dict dict) {
        LambdaQueryWrapper<Dict> lqw = Wrappers.<Dict>query().lambda().eq(Dict::getCode, dict.getCode()).eq(Dict::getDictKey, dict.getDictKey());
        Long cnt = this.baseMapper.selectCount(Func.isEmpty(dict.getId()) ? lqw : lqw.notIn(Dict::getId, new Object[] { dict.getId() }));
@@ -102,7 +102,7 @@
        return removeByIds(Func.toLongList(ids));
    }
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public IPage<DictVO> parentList(Map<String, Object> dict, Query query) {
        IPage<Dict> page = page(Condition.getPage(query), Condition.getQueryWrapper(dict, Dict.class).lambda().eq(Dict::getParentId, BladeConstant.TOP_PARENT_ID).orderByAsc(Dict::getSort));
        /*
@@ -114,7 +114,7 @@
        return DictWrapper.build().pageVO(page);
    }
    @Override // org.springblade.modules.system.service.IDictService
    @Override
    public List<DictVO> childList(Map<String, Object> dict, Long parentId) {
        if (parentId.longValue() < 0) {
            return new ArrayList<>();
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/GalleryServiceImpl.java
@@ -7,6 +7,5 @@
import org.springframework.stereotype.Service;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/service/impl/GalleryServiceImpl.class */
public class GalleryServiceImpl extends BaseServiceImpl<GalleryMapper, Gallery> implements IGalleryService {
}
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/InterfaceConfigFieldServiceImpl.java
@@ -15,13 +15,8 @@
public class InterfaceConfigFieldServiceImpl extends BaseServiceImpl<InterfaceConfigFieldMapper, InterfaceConfigField> implements IInterfaceConfigFieldService {
    
    @Override // org.springblade.modules.system.service.IInterfaceConfigFieldService
    @Override
    public List<InterfaceConfigField> findRelation(InterfaceConfigField field) {
        if (StringUtils.isEmpty(field.getRelationField())) {
            return null;
        }
        return list(Lambda.eq((v0) -> {
            return v0.getId();
        }, field.getRelationField()));
        return StringUtils.isEmpty(field.getRelationField()) ? null : list(Lambda.eq(InterfaceConfigField::getId, field.getRelationField()));
    }
}
smart-man-boot/src/main/java/com/qianwen/smartman/modules/system/service/impl/InterfaceConfigServiceImpl.java
@@ -7,6 +7,5 @@
import org.springframework.stereotype.Service;
@Service
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/service/impl/InterfaceConfigServiceImpl.class */
public class InterfaceConfigServiceImpl extends BaseServiceImpl<InterfaceConfigMapper, InterfaceConfig> implements IInterfaceConfigService {
}
smart-man-boot/src/main/resources/application.yml
@@ -132,6 +132,7 @@
#swagger公共信息
swagger:
  enable: true
  title: smart 接口文档系统
  description: smart 接口文档系统
  version: 2.8.2.RELEASE
smart-starter-swagger/src/main/java/com/qianwen/core/swagger/SwaggerUtil.java
@@ -8,7 +8,7 @@
import springfox.documentation.RequestHandler;
import springfox.documentation.service.ApiKey;
/* loaded from: blade-starter-swagger-9.3.0.0-SNAPSHOT.jar:org/springblade/core/swagger/SwaggerUtil.class */
public class SwaggerUtil {
    public static Predicate<RequestHandler> basePackages(final List<String> basePackages) {
        return input -> {