🎉 2.3.2.RELEASE

This commit is contained in:
smallchill 2019-06-17 00:29:28 +08:00
parent 812d42f3f3
commit 30bb595fce
30 changed files with 409 additions and 26 deletions

View File

@ -1,7 +1,7 @@
<p align="center"> <p align="center">
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status"> <img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR1-blue.svg" alt="Coverage Status"> <img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR1-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.1.4.RELEASE-blue.svg" alt="Downloads"> <img src="https://img.shields.io/badge/Spring%20Boot-2.1.5.RELEASE-blue.svg" alt="Downloads">
</p> </p>
## SpringBlade微服务开发平台 ## SpringBlade微服务开发平台

View File

@ -8,7 +8,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<artifactId>blade-auth</artifactId> <artifactId>blade-auth</artifactId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -0,0 +1,10 @@
${AnsiColor.BRIGHT_CYAN} _____ _ ${AnsiColor.BLUE} ______ _ _
${AnsiColor.BRIGHT_CYAN}/ ___| (_) ${AnsiColor.BLUE} | ___ \| | | |
${AnsiColor.BRIGHT_CYAN}\ `--. _ __ _ __ _ _ __ __ _ ${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___
${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \ / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || | | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/
${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_| |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
${AnsiColor.BRIGHT_CYAN} | | __/ |
${AnsiColor.BRIGHT_CYAN} |_| |___/
${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-ops</artifactId> <artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-ops</artifactId> <artifactId>blade-ops</artifactId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -0,0 +1,15 @@
FROM anapsix/alpine-java:8_server-jre_unlimited
MAINTAINER smallchill@163.com
RUN mkdir -p /blade/resource
WORKDIR /blade/resource
EXPOSE 8010
ADD ./target/blade-resource.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
CMD ["--spring.profiles.active=test"]

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId>
<version>2.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>blade-resource</artifactId>
<name>${project.artifactId}</name>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>
<version>${blade.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-tool</artifactId>
<version>${blade.tool.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-cloud</artifactId>
<version>${blade.tool.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-oss</artifactId>
<version>${blade.tool.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,35 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springblade.resource;
import org.springblade.core.launch.BladeApplication;
import org.springblade.core.launch.constant.AppConstant;
import org.springframework.cloud.client.SpringCloudApplication;
/**
* 资源启动器
*
* @author Chill
*/
@SpringCloudApplication
public class ResourceApplication {
public static void main(String[] args) {
BladeApplication.run(AppConstant.APPLICATION_RESOURCE_NAME, ResourceApplication.class, args);
}
}

View File

@ -0,0 +1,173 @@
/**
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springblade.resource.endpoint;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.springblade.core.oss.QiniuTemplate;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.oss.model.OssFile;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* 对象存储端点
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@RequestMapping("/oss/endpoint")
@Api(value = "对象存储端点", tags = "对象存储端点")
public class OssEndpoint {
private QiniuTemplate qiniuTemplate;
/**
* 创建存储桶
*
* @param bucketName 存储桶名称
* @return Bucket
*/
@SneakyThrows
@PostMapping("/make-bucket")
public R makeBucket(@RequestParam String bucketName) {
qiniuTemplate.makeBucket(bucketName);
return R.success("创建成功");
}
/**
* 创建存储桶
*
* @param bucketName 存储桶名称
* @return R
*/
@SneakyThrows
@PostMapping("/remove-bucket")
public R removeBucket(@RequestParam String bucketName) {
qiniuTemplate.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) {
qiniuTemplate.copyFile(fileName, destBucketName, destFileName);
return R.success("操作成功");
}
/**
* 获取文件信息
*
* @param fileName 存储桶对象名称
* @return InputStream
*/
@SneakyThrows
@GetMapping("/stat-file")
public R<OssFile> statFile(@RequestParam String fileName) {
return R.data(qiniuTemplate.statFile(fileName));
}
/**
* 获取文件相对路径
*
* @param fileName 存储桶对象名称
* @return String
*/
@SneakyThrows
@GetMapping("/file-path")
public R<String> filePath(@RequestParam String fileName) {
return R.data(qiniuTemplate.filePath(fileName));
}
/**
* 获取文件外链
*
* @param fileName 存储桶对象名称
* @return String
*/
@SneakyThrows
@GetMapping("/file-link")
public R<String> fileLink(@RequestParam String fileName) {
return R.data(qiniuTemplate.fileLink(fileName));
}
/**
* 上传文件
*
* @param file 文件
* @return ObjectStat
*/
@SneakyThrows
@PostMapping("/put-file")
public R<BladeFile> putFile(@RequestParam MultipartFile file) {
BladeFile bladeFile = qiniuTemplate.putFile(file.getOriginalFilename(), file.getInputStream());
return R.data(bladeFile);
}
/**
* 上传文件
*
* @param fileName 存储桶对象名称
* @param file 文件
* @return ObjectStat
*/
@SneakyThrows
@PostMapping("/put-file-by-name")
public R<BladeFile> putFile(@RequestParam String fileName, @RequestParam MultipartFile file) {
BladeFile bladeFile = qiniuTemplate.putFile(fileName, file.getInputStream());
return R.data(bladeFile);
}
/**
* 删除文件
*
* @param fileName 存储桶对象名称
* @return R
*/
@SneakyThrows
@PostMapping("/remove-file")
public R removeFile(@RequestParam String fileName) {
qiniuTemplate.removeFile(fileName);
return R.success("操作成功");
}
/**
* 批量删除文件
*
* @param fileNames 存储桶对象名称集合
* @return R
*/
@SneakyThrows
@PostMapping("/remove-files")
public R removeFiles(@RequestParam String fileNames) {
qiniuTemplate.removeFiles(Func.toStrList(fileNames));
return R.success("操作成功");
}
}

View File

@ -0,0 +1,12 @@
#服务器端口
server:
port: 8010
oss:
enable: true
name: qiniu
tenant-mode: true
endpoint: prt1thnw3.bkt.clouddn.com
access-key: N_Loh1ngBqcJovwiAJqR91Ifj2vgOWHOf8AwBA_h
secret-key: AuzuA1KHAbkIndCU0dB3Zfii2O3crHNODDmpxHRS
bucket-name: blade

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -14,6 +14,7 @@
<modules> <modules>
<module>blade-admin</module> <module>blade-admin</module>
<module>blade-develop</module> <module>blade-develop</module>
<module>blade-resource</module>
</modules> </modules>
</project> </project>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,13 +5,13 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<version>2.3.1</version> <version>2.3.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>SpringBlade 微服务API集合</description> <description>SpringBlade 微服务API集合</description>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -37,6 +37,12 @@
<artifactId>blade-dict-api</artifactId> <artifactId>blade-dict-api</artifactId>
<version>${blade.project.version}</version> <version>${blade.project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-test</artifactId>
<version>${blade.tool.version}</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -0,0 +1,29 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springblade.core.test.BladeBootTest;
import org.springblade.core.test.BladeSpringRunner;
import org.springblade.desk.DeskApplication;
import org.springblade.desk.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
/**
* Blade单元测试
*
* @author Chill
*/
@RunWith(BladeSpringRunner.class)
@SpringBootTest(classes = DeskApplication.class)
@BladeBootTest(appName = "blade-desk", profile = "test", enableLoader = true)
public class BladeDemoTest {
@Autowired
private INoticeService noticeService;
@Test
public void contextLoads() {
int count = noticeService.count();
System.out.println("notice数量[" + count + "] 个");
}
}

View File

@ -0,0 +1,44 @@
/*
* 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.desk.test.launcher;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springframework.boot.builder.SpringApplicationBuilder;
import java.util.Properties;
/**
* 启动参数拓展
*
* @author Chill
*/
public class DemoTestLauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
Properties props = System.getProperties();
props.setProperty("spring.cloud.nacos.discovery.server-addr", CommonConstant.NACOS_DEV_ADDR);
props.setProperty("spring.cloud.nacos.config.server-addr", CommonConstant.NACOS_DEV_ADDR);
props.setProperty("spring.cloud.sentinel.transport.dashboard", CommonConstant.SENTINEL_DEV_ADDR);
}
@Override
public int getOrder() {
return 10;
}
}

View File

@ -0,0 +1 @@
org.springblade.desk.test.launcher.DemoTestLauncherServiceImpl

View File

@ -0,0 +1,10 @@
#服务器端口
server:
port: 8200
#数据源配置
spring:
datasource:
url: ${blade.datasource.test.url}
username: ${blade.datasource.test.username}
password: ${blade.datasource.test.password}

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -7,12 +7,12 @@
<parent> <parent>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<version>2.3.1</version> <version>2.3.2</version>
</parent> </parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<version>2.3.1</version> <version>2.3.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>SpringBlade 微服务集合</description> <description>SpringBlade 微服务集合</description>

10
pom.xml
View File

@ -5,21 +5,21 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<version>2.3.1</version> <version>2.3.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<blade.tool.version>2.3.1</blade.tool.version> <blade.tool.version>2.3.2</blade.tool.version>
<blade.project.version>2.3.1</blade.project.version> <blade.project.version>2.3.2</blade.project.version>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<swagger.version>2.9.2</swagger.version> <swagger.version>2.9.2</swagger.version>
<swagger.models.version>1.5.21</swagger.models.version> <swagger.models.version>1.5.21</swagger.models.version>
<swagger.bootstrapui.version>1.9.3</swagger.bootstrapui.version> <swagger.bootstrapui.version>1.9.4</swagger.bootstrapui.version>
<mybatis.plus.version>3.1.0</mybatis.plus.version> <mybatis.plus.version>3.1.0</mybatis.plus.version>
<curator.framework.version>4.0.1</curator.framework.version> <curator.framework.version>4.0.1</curator.framework.version>
<protostuff.version>1.6.0</protostuff.version> <protostuff.version>1.6.0</protostuff.version>
<mica.auto.version>1.0.1</mica.auto.version> <mica.auto.version>1.1.0</mica.auto.version>
<alibaba.cloud.version>0.9.0.RELEASE</alibaba.cloud.version> <alibaba.cloud.version>0.9.0.RELEASE</alibaba.cloud.version>
<spring.boot.admin.version>2.1.4</spring.boot.admin.version> <spring.boot.admin.version>2.1.4</spring.boot.admin.version>

View File

@ -1,2 +1,2 @@
REGISTER=192.168.0.157/blade REGISTER=192.168.0.157/blade
TAG=2.0.0.RC8 TAG=2.3.2

View File

@ -30,7 +30,7 @@ services:
ports: ports:
- 88:88 - 88:88
volumes: volumes:
- /docker/nginx/gateway/nginx.conf:/etc/nginx/nginx.conf - /docker/nginx/api/nginx.conf:/etc/nginx/nginx.conf
privileged: true privileged: true
restart: always restart: always
networks: networks:
@ -131,6 +131,13 @@ services:
networks: networks:
- blade_net - blade_net
blade-resource:
image: "${REGISTER}/blade/blade-resource:${TAG}"
privileged: true
restart: always
networks:
- blade_net
networks: networks:
blade_net: blade_net:
driver: bridge driver: bridge