| | |
| | | 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; |
| | |
| | | @EnableSwagger |
| | | @Configuration |
| | | @EnablePluginRegistries({SwaggerPlugin.class}) |
| | | |
| | | |
| | | public class SwaggerConfiguration { |
| | | private final SwaggerProperties swaggerProperties; |
| | | private final OpenApiExtensionResolver openApiExtensionResolver; |
| | |
| | | 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; |
| | |
| | | |
| | | @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"); |
| | |
| | | @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; |
| | | |
| | |
| | | @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 -> { |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | @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); |
| | | } |
| | |
| | | @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), ""); |
| | | } |
| | |
| | | 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() })); |
| | |
| | | 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)); |
| | | /* |
| | |
| | | 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<>(); |
| | |
| | | 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 { |
| | | } |
| | |
| | | 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())); |
| | | } |
| | | } |
| | |
| | | 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 { |
| | | } |
| | |
| | | |
| | | #swagger公共信息 |
| | | swagger: |
| | | enable: true |
| | | title: smart 接口文档系统 |
| | | description: smart 接口文档系统 |
| | | version: 2.8.2.RELEASE |
| | |
| | | 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 -> { |