修改项目名为maku-boot
This commit is contained in:
parent
2f653ec7f0
commit
98fe3ca78d
34
README.md
34
README.md
|
|
@ -1,46 +1,42 @@
|
||||||
## 项目说明
|
## 项目说明
|
||||||
- FastBoot是采用SpringBoot、SpringSecurity、Mybatis-Plus等框架,开发的一套SpringBoot快速开发系统,使用门槛极低,且采用MIT开源协议,完全免费开源,可免费用于**商业项目**等场景。
|
- MakuBoot是采用SpringBoot、SpringSecurity、Mybatis-Plus等框架,开发的一套SpringBoot快速开发系统,使用门槛极低,且采用MIT开源协议,完全免费开源,可免费用于**商业项目**等场景。
|
||||||
- 采用组件模式,扩展不同的业务功能,可以很方便的实现各种业务需求,且不会导致系统臃肿,若想使用某个组件,按需引入即可,反之亦然。
|
- 采用组件模式,扩展不同的业务功能,可以很方便的实现各种业务需求,且不会导致系统臃肿,若想使用某个组件,按需引入即可,反之亦然。
|
||||||
- 开发文档:[https://maku.net/docs/fast-boot](https://maku.net/docs/fast-boot)
|
- 开发文档:[https://maku.net/docs/maku-boot](https://maku.net/docs/maku-boot)
|
||||||
- 演示环境:https://demo.maku.net/fast-boot
|
- 演示环境:https://demo.maku.net/maku-boot
|
||||||
|
|
||||||
|
|
||||||
## 前端工程
|
## 前端工程
|
||||||
- Github仓库:https://github.com/makunet/fast-admin
|
- Github仓库:https://github.com/makunet/maku-admin
|
||||||
- Gitee仓库:https://gitee.com/makunet/fast-admin
|
- Gitee仓库:https://gitee.com/makunet/maku-admin
|
||||||
|
|
||||||
|
|
||||||
## 代码生成器
|
## 代码生成器
|
||||||
- Github仓库:https://github.com/makunet/fast-generator
|
- Github仓库:https://github.com/makunet/maku-generator
|
||||||
- Gitee仓库:https://gitee.com/makunet/fast-generator
|
- Gitee仓库:https://gitee.com/makunet/maku-generator
|
||||||
|
|
||||||
|
|
||||||
## 交流和反馈
|
## 交流和反馈
|
||||||
- 官方社区:https://maku.net
|
- 官方社区:https://maku.net
|
||||||
- Github仓库:https://github.com/makunet/fast-boot
|
- Github仓库:https://github.com/makunet/maku-boot
|
||||||
- Gitee仓库:https://gitee.com/makunet/fast-boot
|
- Gitee仓库:https://gitee.com/makunet/maku-boot
|
||||||
- 技术解答、交流、反馈、建议等,请移步到官方社区,我们会及时回复,也方便今后的小伙伴寻找答案,感谢理解!
|
- 技术解答、交流、反馈、建议等,请移步到官方社区,我们会及时回复,也方便今后的小伙伴寻找答案,感谢理解!
|
||||||
|
|
||||||
|
|
||||||
## 微信交流群
|
## 微信交流群
|
||||||
为了更好的交流,我们新提供了微信交流群,需扫描下面的二维码,关注公众号,回复【加群】,根据提示信息,作者会拉你进群的,感谢配合!
|
为了更好的交流,我们新提供了微信交流群,需扫描下面的二维码,关注公众号,回复【加群】,根据提示信息,作者会拉你进群的,感谢配合!
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## 支持
|
## 支持
|
||||||
如果觉得框架还不错,或者已经在使用了,希望你可以去 [Github](https://github.com/makunet/fast-boot) 或 [Gitee](https://gitee.com/makunet/fast-boot) 帮作者点个 ⭐ Star,这将是对作者极大的鼓励与支持。
|
如果觉得框架还不错,或者已经在使用了,希望你可以去 [Github](https://github.com/makunet/maku-boot) 或 [Gitee](https://gitee.com/makunet/maku-boot) 帮作者点个 ⭐ Star,这将是对作者极大的鼓励与支持。
|
||||||
|
|
||||||
|
|
||||||
## 效果图
|
## 效果图
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 199 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 158 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 266 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 177 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 222 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 311 KiB |
|
|
@ -1,14 +0,0 @@
|
||||||
package net.maku;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
public class FastTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test(){
|
|
||||||
System.out.println("测试用例!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<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">
|
<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>
|
<parent>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot</artifactId>
|
<artifactId>maku-boot</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>fast-boot-api</artifactId>
|
<artifactId>maku-boot-api</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
## 说明
|
## 说明
|
||||||
fast-boot 是采用组件模式,扩展不同的业务功能,可以很方便的实现各种业务需求,且不会导致系统臃肿,若想使用某个组件,按需引入即可,反之亦然。
|
maku-boot 是采用组件模式,扩展不同的业务功能,可以很方便的实现各种业务需求,且不会导致系统臃肿,若想使用某个组件,按需引入即可,反之亦然。
|
||||||
|
|
||||||
## 引入
|
## 引入
|
||||||
如果需要使用对应的组件,如:`fast-boot-quartz`,则需要在`fast-boot/fast-server/pom.xml`里面引入,如下所示:
|
如果需要使用对应的组件,如:`maku-boot-quartz`,则需要在`maku-boot/maku-server/pom.xml`里面引入,如下所示:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot-quartz</artifactId>
|
<artifactId>maku-boot-quartz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
@ -17,5 +17,5 @@ fast-boot 是采用组件模式,扩展不同的业务功能,可以很方便
|
||||||
如果使用的是MySQL数据库,则需要执行以下SQL文件:
|
如果使用的是MySQL数据库,则需要执行以下SQL文件:
|
||||||
|
|
||||||
```
|
```
|
||||||
fast-boot/db/mysql/module/fast-boot-quartz.sql
|
maku-boot/db/mysql/module/maku-boot-quartz.sql
|
||||||
```
|
```
|
||||||
|
|
@ -2,22 +2,22 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot-module</artifactId>
|
<artifactId>maku-boot-module</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>fast-boot-message</artifactId>
|
<artifactId>maku-boot-message</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-framework</artifactId>
|
<artifactId>maku-framework</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot-api</artifactId>
|
<artifactId>maku-boot-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -7,7 +7,7 @@ import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
||||||
import com.aliyun.teaopenapi.models.Config;
|
import com.aliyun.teaopenapi.models.Config;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.maku.framework.common.constant.Constant;
|
import net.maku.framework.common.constant.Constant;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.framework.common.utils.JsonUtils;
|
import net.maku.framework.common.utils.JsonUtils;
|
||||||
import net.maku.message.sms.config.SmsConfig;
|
import net.maku.message.sms.config.SmsConfig;
|
||||||
|
|
||||||
|
|
@ -55,10 +55,10 @@ public class AliyunSmsStrategy implements SmsStrategy {
|
||||||
|
|
||||||
// 发送失败
|
// 发送失败
|
||||||
if (!Constant.OK.equalsIgnoreCase(response.getBody().getCode())) {
|
if (!Constant.OK.equalsIgnoreCase(response.getBody().getCode())) {
|
||||||
throw new FastException(response.getBody().getMessage());
|
throw new ServerException(response.getBody().getMessage());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException(e.getMessage());
|
throw new ServerException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.CharsetUtil;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.framework.common.utils.JsonUtils;
|
import net.maku.framework.common.utils.JsonUtils;
|
||||||
import net.maku.message.sms.config.SmsConfig;
|
import net.maku.message.sms.config.SmsConfig;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -47,13 +47,13 @@ public class HuaweiSmsStrategy implements SmsStrategy {
|
||||||
// 请求Body,不携带签名名称时,signature请填null
|
// 请求Body,不携带签名名称时,signature请填null
|
||||||
String body = buildRequestBody(smsConfig.getSenderId(), "+86" + mobile, smsConfig.getTemplateId(), templateParas, null, smsConfig.getSignName());
|
String body = buildRequestBody(smsConfig.getSenderId(), "+86" + mobile, smsConfig.getTemplateId(), templateParas, null, smsConfig.getSignName());
|
||||||
if (StringUtils.isBlank(body)) {
|
if (StringUtils.isBlank(body)) {
|
||||||
throw new FastException("body is null.");
|
throw new ServerException("body is null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求Headers中的X-WSSE参数值
|
// 请求Headers中的X-WSSE参数值
|
||||||
String wsseHeader = buildWsseHeader(smsConfig.getAccessKey(), smsConfig.getSecretKey());
|
String wsseHeader = buildWsseHeader(smsConfig.getAccessKey(), smsConfig.getSecretKey());
|
||||||
if (StringUtils.isBlank(wsseHeader)) {
|
if (StringUtils.isBlank(wsseHeader)) {
|
||||||
throw new FastException("wsse header is null.");
|
throw new ServerException("wsse header is null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -83,13 +83,13 @@ public class HuaweiSmsStrategy implements SmsStrategy {
|
||||||
// 短信是否发送成功
|
// 短信是否发送成功
|
||||||
assert result != null;
|
assert result != null;
|
||||||
if (!"000000".equals(result.code)) {
|
if (!"000000".equals(result.code)) {
|
||||||
throw new FastException(result.description);
|
throw new ServerException(result.description);
|
||||||
}
|
}
|
||||||
} else { //400 401
|
} else { //400 401
|
||||||
throw new FastException(IoUtil.read(connection.getErrorStream(), CharsetUtil.CHARSET_UTF_8));
|
throw new ServerException(IoUtil.read(connection.getErrorStream(), CharsetUtil.CHARSET_UTF_8));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException(e.getMessage());
|
throw new ServerException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ public class HuaweiSmsStrategy implements SmsStrategy {
|
||||||
String statusCallBack, String signature) {
|
String statusCallBack, String signature) {
|
||||||
if (null == sender || null == receiver || null == templateId || sender.isEmpty() || receiver.isEmpty()
|
if (null == sender || null == receiver || null == templateId || sender.isEmpty() || receiver.isEmpty()
|
||||||
|| templateId.isEmpty()) {
|
|| templateId.isEmpty()) {
|
||||||
throw new FastException("buildRequestBody(): sender, receiver or templateId is null.");
|
throw new ServerException("buildRequestBody(): sender, receiver or templateId is null.");
|
||||||
}
|
}
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ public class HuaweiSmsStrategy implements SmsStrategy {
|
||||||
*/
|
*/
|
||||||
static String buildWsseHeader(String appKey, String appSecret) {
|
static String buildWsseHeader(String appKey, String appSecret) {
|
||||||
if (null == appKey || null == appSecret || appKey.isEmpty() || appSecret.isEmpty()) {
|
if (null == appKey || null == appSecret || appKey.isEmpty() || appSecret.isEmpty()) {
|
||||||
throw new FastException("buildWsseHeader(): appKey or appSecret is null.");
|
throw new ServerException("buildWsseHeader(): appKey or appSecret is null.");
|
||||||
}
|
}
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||||
String time = sdf.format(new Date());
|
String time = sdf.format(new Date());
|
||||||
|
|
@ -3,7 +3,7 @@ package net.maku.message.sms;
|
||||||
import com.qiniu.http.Response;
|
import com.qiniu.http.Response;
|
||||||
import com.qiniu.sms.SmsManager;
|
import com.qiniu.sms.SmsManager;
|
||||||
import com.qiniu.util.Auth;
|
import com.qiniu.util.Auth;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.message.sms.config.SmsConfig;
|
import net.maku.message.sms.config.SmsConfig;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -31,10 +31,10 @@ public class QiniuSmsStrategy implements SmsStrategy {
|
||||||
|
|
||||||
// 是否发送成功
|
// 是否发送成功
|
||||||
if (!response.isOK()) {
|
if (!response.isOK()) {
|
||||||
throw new FastException(response.error);
|
throw new ServerException(response.error);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException(e.getMessage());
|
throw new ServerException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package net.maku.message.sms;
|
package net.maku.message.sms;
|
||||||
|
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.message.enums.SmsPlatformEnum;
|
import net.maku.message.enums.SmsPlatformEnum;
|
||||||
import net.maku.message.sms.config.SmsConfig;
|
import net.maku.message.sms.config.SmsConfig;
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ public class SmsContext {
|
||||||
} else if (config.getPlatform() == SmsPlatformEnum.HUAWEI.getValue()) {
|
} else if (config.getPlatform() == SmsPlatformEnum.HUAWEI.getValue()) {
|
||||||
this.smsStrategy = new HuaweiSmsStrategy(config);
|
this.smsStrategy = new HuaweiSmsStrategy(config);
|
||||||
} else {
|
} else {
|
||||||
throw new FastException("未知的短信平台");
|
throw new ServerException("未知的短信平台");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
|
||||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
||||||
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
||||||
import net.maku.framework.common.constant.Constant;
|
import net.maku.framework.common.constant.Constant;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.message.sms.config.SmsConfig;
|
import net.maku.message.sms.config.SmsConfig;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -67,10 +67,10 @@ public class TencentSmsStrategy implements SmsStrategy {
|
||||||
|
|
||||||
// 发送失败
|
// 发送失败
|
||||||
if (!Constant.OK.equalsIgnoreCase(sendStatus.getCode())) {
|
if (!Constant.OK.equalsIgnoreCase(sendStatus.getCode())) {
|
||||||
throw new FastException(sendStatus.getMessage());
|
throw new ServerException(sendStatus.getMessage());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException(e.getMessage());
|
throw new ServerException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ import cn.hutool.core.map.MapUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.maku.framework.common.constant.Constant;
|
import net.maku.framework.common.constant.Constant;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.framework.common.utils.ExceptionUtils;
|
import net.maku.framework.common.utils.ExceptionUtils;
|
||||||
import net.maku.framework.common.utils.JsonUtils;
|
import net.maku.framework.common.utils.JsonUtils;
|
||||||
import net.maku.message.entity.SmsLogEntity;
|
import net.maku.message.entity.SmsLogEntity;
|
||||||
|
|
@ -95,7 +95,7 @@ public class SmsService {
|
||||||
// 是否有可用的短信平台
|
// 是否有可用的短信平台
|
||||||
int count = platformList.size();
|
int count = platformList.size();
|
||||||
if(count == 0) {
|
if(count == 0) {
|
||||||
throw new FastException("没有可用的短信平台,请先添加");
|
throw new ServerException("没有可用的短信平台,请先添加");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 采用轮询算法,发送短信
|
// 采用轮询算法,发送短信
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
<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">
|
<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>
|
<parent>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot-module</artifactId>
|
<artifactId>maku-boot-module</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>fast-boot-quartz</artifactId>
|
<artifactId>maku-boot-quartz</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-framework</artifactId>
|
<artifactId>maku-framework</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package net.maku.quartz.utils;
|
package net.maku.quartz.utils;
|
||||||
|
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.quartz.entity.ScheduleJobEntity;
|
import net.maku.quartz.entity.ScheduleJobEntity;
|
||||||
import net.maku.quartz.enums.ScheduleConcurrentEnum;
|
import net.maku.quartz.enums.ScheduleConcurrentEnum;
|
||||||
import net.maku.quartz.enums.ScheduleStatusEnum;
|
import net.maku.quartz.enums.ScheduleStatusEnum;
|
||||||
|
|
@ -83,7 +83,7 @@ public class ScheduleUtils {
|
||||||
scheduler.pauseJob(jobKey);
|
scheduler.pauseJob(jobKey);
|
||||||
}
|
}
|
||||||
} catch (SchedulerException e) {
|
} catch (SchedulerException e) {
|
||||||
throw new FastException("创建定时任务失败", e);
|
throw new ServerException("创建定时任务失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ public class ScheduleUtils {
|
||||||
scheduler.triggerJob(jobKey, dataMap);
|
scheduler.triggerJob(jobKey, dataMap);
|
||||||
}
|
}
|
||||||
} catch (SchedulerException e) {
|
} catch (SchedulerException e) {
|
||||||
throw new FastException("执行定时任务失败", e);
|
throw new ServerException("执行定时任务失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@ public class ScheduleUtils {
|
||||||
try {
|
try {
|
||||||
scheduler.pauseJob(getJobKey(scheduleJob));
|
scheduler.pauseJob(getJobKey(scheduleJob));
|
||||||
} catch (SchedulerException e) {
|
} catch (SchedulerException e) {
|
||||||
throw new FastException("暂停定时任务失败", e);
|
throw new ServerException("暂停定时任务失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@ public class ScheduleUtils {
|
||||||
try {
|
try {
|
||||||
scheduler.resumeJob(getJobKey(scheduleJob));
|
scheduler.resumeJob(getJobKey(scheduleJob));
|
||||||
} catch (SchedulerException e) {
|
} catch (SchedulerException e) {
|
||||||
throw new FastException("恢复定时任务失败", e);
|
throw new ServerException("恢复定时任务失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,7 +142,7 @@ public class ScheduleUtils {
|
||||||
scheduler.deleteJob(jobKey);
|
scheduler.deleteJob(jobKey);
|
||||||
}
|
}
|
||||||
}catch (SchedulerException e){
|
}catch (SchedulerException e){
|
||||||
throw new FastException("更新定时任务失败", e);
|
throw new ServerException("更新定时任务失败", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
|
ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
|
||||||
|
|
@ -155,7 +155,7 @@ public class ScheduleUtils {
|
||||||
try {
|
try {
|
||||||
scheduler.deleteJob(getJobKey(scheduleJob));
|
scheduler.deleteJob(getJobKey(scheduleJob));
|
||||||
} catch (SchedulerException e) {
|
} catch (SchedulerException e) {
|
||||||
throw new FastException("删除定时任务失败", e);
|
throw new ServerException("删除定时任务失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<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">
|
<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>
|
<parent>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot</artifactId>
|
<artifactId>maku-boot</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>fast-boot-module</artifactId>
|
<artifactId>maku-boot-module</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>fast-boot-quartz</module>
|
<module>maku-boot-quartz</module>
|
||||||
<module>fast-boot-message</module>
|
<module>maku-boot-message</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
<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">
|
<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>
|
<parent>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot</artifactId>
|
<artifactId>maku-boot</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>fast-boot-new</artifactId>
|
<artifactId>maku-boot-new</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-framework</artifactId>
|
<artifactId>maku-framework</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
@ -2,22 +2,22 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot</artifactId>
|
<artifactId>maku-boot</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>fast-boot-system</artifactId>
|
<artifactId>maku-boot-system</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-framework</artifactId>
|
<artifactId>maku-framework</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.maku</groupId>
|
<groupId>net.maku</groupId>
|
||||||
<artifactId>fast-boot-api</artifactId>
|
<artifactId>maku-boot-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -2,7 +2,7 @@ package net.maku.storage.service;
|
||||||
|
|
||||||
import com.aliyun.oss.OSS;
|
import com.aliyun.oss.OSS;
|
||||||
import com.aliyun.oss.OSSClientBuilder;
|
import com.aliyun.oss.OSSClientBuilder;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.storage.properties.StorageProperties;
|
import net.maku.storage.properties.StorageProperties;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
@ -31,7 +31,7 @@ public class AliyunStorageService extends StorageService {
|
||||||
try {
|
try {
|
||||||
client.putObject(properties.getAliyun().getBucketName(), path, inputStream);
|
client.putObject(properties.getAliyun().getBucketName(), path, inputStream);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
client.shutdown();
|
client.shutdown();
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package net.maku.storage.service;
|
package net.maku.storage.service;
|
||||||
|
|
||||||
import com.obs.services.ObsClient;
|
import com.obs.services.ObsClient;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.storage.properties.StorageProperties;
|
import net.maku.storage.properties.StorageProperties;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
@ -31,7 +31,7 @@ public class HuaweiStorageService extends StorageService {
|
||||||
client.putObject(properties.getHuawei().getBucketName(), path, inputStream);
|
client.putObject(properties.getHuawei().getBucketName(), path, inputStream);
|
||||||
client.close();
|
client.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties.getConfig().getDomain() + "/" + path;
|
return properties.getConfig().getDomain() + "/" + path;
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package net.maku.storage.service;
|
package net.maku.storage.service;
|
||||||
|
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.storage.properties.StorageProperties;
|
import net.maku.storage.properties.StorageProperties;
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class LocalStorageService extends StorageService {
|
||||||
|
|
||||||
FileCopyUtils.copy(inputStream, Files.newOutputStream(file.toPath()));
|
FileCopyUtils.copy(inputStream, Files.newOutputStream(file.toPath()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties.getConfig().getDomain() + "/" + properties.getLocal().getUrl() + "/" + path;
|
return properties.getConfig().getDomain() + "/" + properties.getLocal().getUrl() + "/" + path;
|
||||||
|
|
@ -4,7 +4,7 @@ import io.minio.BucketExistsArgs;
|
||||||
import io.minio.MakeBucketArgs;
|
import io.minio.MakeBucketArgs;
|
||||||
import io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectArgs;
|
import io.minio.PutObjectArgs;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.storage.properties.StorageProperties;
|
import net.maku.storage.properties.StorageProperties;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
@ -48,7 +48,7 @@ public class MinioStorageService extends StorageService {
|
||||||
);
|
);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties.getMinio().getEndPoint() + "/" + properties.getMinio().getBucketName() + "/" + path;
|
return properties.getMinio().getEndPoint() + "/" + properties.getMinio().getBucketName() + "/" + path;
|
||||||
|
|
@ -6,7 +6,7 @@ import com.qiniu.storage.Region;
|
||||||
import com.qiniu.storage.UploadManager;
|
import com.qiniu.storage.UploadManager;
|
||||||
import com.qiniu.util.Auth;
|
import com.qiniu.util.Auth;
|
||||||
import com.qiniu.util.IOUtils;
|
import com.qiniu.util.IOUtils;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.storage.properties.StorageProperties;
|
import net.maku.storage.properties.StorageProperties;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -34,12 +34,12 @@ public class QiniuStorageService extends StorageService {
|
||||||
try {
|
try {
|
||||||
Response res = uploadManager.put(data, path, token);
|
Response res = uploadManager.put(data, path, token);
|
||||||
if (!res.isOK()) {
|
if (!res.isOK()) {
|
||||||
throw new FastException(res.toString());
|
throw new ServerException(res.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties.getConfig().getDomain() + "/" + path;
|
return properties.getConfig().getDomain() + "/" + path;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class QiniuStorageService extends StorageService {
|
||||||
byte[] data = IOUtils.toByteArray(inputStream);
|
byte[] data = IOUtils.toByteArray(inputStream);
|
||||||
return this.upload(data, path);
|
return this.upload(data, path);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ import com.qcloud.cos.model.ObjectMetadata;
|
||||||
import com.qcloud.cos.model.PutObjectRequest;
|
import com.qcloud.cos.model.PutObjectRequest;
|
||||||
import com.qcloud.cos.model.PutObjectResult;
|
import com.qcloud.cos.model.PutObjectResult;
|
||||||
import com.qcloud.cos.region.Region;
|
import com.qcloud.cos.region.Region;
|
||||||
import net.maku.framework.common.exception.FastException;
|
import net.maku.framework.common.exception.ServerException;
|
||||||
import net.maku.storage.properties.StorageProperties;
|
import net.maku.storage.properties.StorageProperties;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
@ -54,10 +54,10 @@ public class TencentStorageService extends StorageService {
|
||||||
|
|
||||||
cosClient.shutdown();
|
cosClient.shutdown();
|
||||||
if (result.getETag() == null) {
|
if (result.getETag() == null) {
|
||||||
throw new FastException("上传文件失败,请检查配置信息");
|
throw new ServerException("上传文件失败,请检查配置信息");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new FastException("上传文件失败:", e);
|
throw new ServerException("上传文件失败:", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties.getConfig().getDomain() + "/" + path;
|
return properties.getConfig().getDomain() + "/" + path;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user