Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
76e0389c
Commit
76e0389c
authored
Jul 12, 2021
by
terrfly
Browse files
注释掉无用的MQ;
parent
40959e8f
Changes
8
Hide whitespace changes
Inline
Side-by-side
conf/devCommons/config/application.yml
View file @
76e0389c
...
@@ -63,18 +63,18 @@ spring:
...
@@ -63,18 +63,18 @@ spring:
broker-url
:
tcp://localhost:61616
#连接地址
broker-url
:
tcp://localhost:61616
#连接地址
#rabbitmq配置
#rabbitmq配置
rabbitmq
:
#
rabbitmq:
addresses
:
127.0.0.1:5672
#
addresses: 127.0.0.1:5672
username
:
guest
#
username: guest
password
:
guest
#
password: guest
dynamic
:
true
#
dynamic: true
virtual-host
:
/
#
virtual-host: /
#rocketmq配置
#rocketmq配置
rocketmq
:
#
rocketmq:
name-server
:
127.0.0.1:9876
#
name-server: 127.0.0.1:9876
producer
:
#
producer:
group
:
rocket-group
#
group: rocket-group
#日志配置参数。
#日志配置参数。
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
...
@@ -96,7 +96,7 @@ isys:
...
@@ -96,7 +96,7 @@ isys:
file-private-path
:
${isys.oss.file-root-path}/private
#私有化本地访问,不允许url方式公共读取 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 )
file-private-path
:
${isys.oss.file-root-path}/private
#私有化本地访问,不允许url方式公共读取 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 )
# [local]: 本地存储,所有的文件将存在放本地,可通过nfs, rsync工具实现多机共享;
# [local]: 本地存储,所有的文件将存在放本地,可通过nfs, rsync工具实现多机共享;
# [aliyun-oss]: 将文件统一上传到阿里云oss服务器;
# [aliyun-oss]: 将文件统一上传到阿里云oss服务器;
注意:需调整jeepay-oss/pom.xml中的aliyun-sdk-oss组件依赖方式
service-type
:
local
service-type
:
local
# 阿里云OSS服务配置信息
# 阿里云OSS服务配置信息
...
...
jeepay-core/src/main/java/com/jeequan/jeepay/core/service/ISysConfigService.java
View file @
76e0389c
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <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
com.jeequan.jeepay.core.service
;
package
com.jeequan.jeepay.core.service
;
import
com.jeequan.jeepay.core.model.DBApplicationConfig
;
import
com.jeequan.jeepay.core.model.DBApplicationConfig
;
...
...
jeepay-oss/src/main/java/com/jeequan/jeepay/oss/config/AliyunOssYmlConfig.java
View file @
76e0389c
...
@@ -20,12 +20,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -20,12 +20,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
/**
/**
* 系统Yml配置参数定义Bean
* aliyun oss 的yml配置参数
*
*
* @author terrfly
* @author terrfly
* @site https://www.jeepay.vip
* @site https://www.jeepay.vip
* @date 2021
-04-27 15:50
* @date 2021
/7/12 18:18
*/
*/
@Data
@Data
@Component
@Component
@ConfigurationProperties
(
prefix
=
"isys.oss.aliyun-oss"
)
@ConfigurationProperties
(
prefix
=
"isys.oss.aliyun-oss"
)
...
...
jeepay-oss/src/main/java/com/jeequan/jeepay/oss/constant/OssSavePlaceEnum.java
View file @
76e0389c
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <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
com.jeequan.jeepay.oss.constant
;
package
com.jeequan.jeepay.oss.constant
;
/*
/*
...
...
jeepay-oss/src/main/java/com/jeequan/jeepay/oss/constant/OssServiceTypeEnum.java
View file @
76e0389c
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <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
com.jeequan.jeepay.oss.constant
;
package
com.jeequan.jeepay.oss.constant
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Getter
;
/*
/*
...
...
jeepay-oss/src/main/java/com/jeequan/jeepay/oss/service/AliyunOssService.java
View file @
76e0389c
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <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
com.jeequan.jeepay.oss.service
;
package
com.jeequan.jeepay.oss.service
;
import
com.aliyun.oss.OSS
;
import
com.aliyun.oss.OSS
;
...
@@ -11,8 +26,16 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
...
@@ -11,8 +26,16 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.PostConstruct
;
import
java.io.File
;
import
java.io.File
;
/**
* 阿里云OSS 实现类
*
* @author terrfly
* @site https://www.jeepay.vip
* @date 2021/7/12 18:20
*/
@Service
@Service
@Slf4j
@Slf4j
@ConditionalOnProperty
(
name
=
"isys.oss.service-type"
,
havingValue
=
"aliyun-oss"
)
@ConditionalOnProperty
(
name
=
"isys.oss.service-type"
,
havingValue
=
"aliyun-oss"
)
...
@@ -20,13 +43,20 @@ public class AliyunOssService implements IOssService{
...
@@ -20,13 +43,20 @@ public class AliyunOssService implements IOssService{
@Autowired
private
AliyunOssYmlConfig
aliyunOssYmlConfig
;
@Autowired
private
AliyunOssYmlConfig
aliyunOssYmlConfig
;
// ossClient 初始化
private
OSS
ossClient
=
null
;
@PostConstruct
public
void
init
(){
ossClient
=
new
OSSClientBuilder
().
build
(
aliyunOssYmlConfig
.
getEndpoint
(),
aliyunOssYmlConfig
.
getAccessKeyId
(),
aliyunOssYmlConfig
.
getAccessKeySecret
());
}
@Override
@Override
public
String
upload2PreviewUrl
(
OssSavePlaceEnum
ossSavePlaceEnum
,
MultipartFile
multipartFile
,
String
saveDirAndFileName
)
{
public
String
upload2PreviewUrl
(
OssSavePlaceEnum
ossSavePlaceEnum
,
MultipartFile
multipartFile
,
String
saveDirAndFileName
)
{
try
{
try
{
// 创建OSSClient实例。
OSS
client
=
new
OSSClientBuilder
().
build
(
aliyunOssYmlConfig
.
getEndpoint
(),
aliyunOssYmlConfig
.
getAccessKeyId
(),
aliyunOssYmlConfig
.
getAccessKeySecret
());
this
.
ossClient
.
putObject
(
aliyunOssYmlConfig
.
getPublicBucketName
(),
saveDirAndFileName
,
multipartFile
.
getInputStream
());
client
.
putObject
(
aliyunOssYmlConfig
.
getPublicBucketName
(),
saveDirAndFileName
,
multipartFile
.
getInputStream
());
if
(
ossSavePlaceEnum
==
OssSavePlaceEnum
.
PUBLIC
){
if
(
ossSavePlaceEnum
==
OssSavePlaceEnum
.
PUBLIC
){
// 文档:https://www.alibabacloud.com/help/zh/doc-detail/39607.htm example: https://BucketName.Endpoint/ObjectName
// 文档:https://www.alibabacloud.com/help/zh/doc-detail/39607.htm example: https://BucketName.Endpoint/ObjectName
...
@@ -45,12 +75,9 @@ public class AliyunOssService implements IOssService{
...
@@ -45,12 +75,9 @@ public class AliyunOssService implements IOssService{
public
boolean
downloadFile
(
OssSavePlaceEnum
ossSavePlaceEnum
,
String
source
,
String
target
)
{
public
boolean
downloadFile
(
OssSavePlaceEnum
ossSavePlaceEnum
,
String
source
,
String
target
)
{
try
{
try
{
// 创建OSSClient实例。
OSS
client
=
new
OSSClientBuilder
().
build
(
aliyunOssYmlConfig
.
getEndpoint
(),
aliyunOssYmlConfig
.
getAccessKeyId
(),
aliyunOssYmlConfig
.
getAccessKeySecret
());
String
bucket
=
ossSavePlaceEnum
==
OssSavePlaceEnum
.
PRIVATE
?
aliyunOssYmlConfig
.
getPrivateBucketName
()
:
aliyunOssYmlConfig
.
getPublicBucketName
();
String
bucket
=
ossSavePlaceEnum
==
OssSavePlaceEnum
.
PRIVATE
?
aliyunOssYmlConfig
.
getPrivateBucketName
()
:
aliyunOssYmlConfig
.
getPublicBucketName
();
this
.
ossClient
.
getObject
(
new
GetObjectRequest
(
bucket
,
source
),
new
File
(
target
));
client
.
getObject
(
new
GetObjectRequest
(
bucket
,
source
),
new
File
(
target
));
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
jeepay-oss/src/main/java/com/jeequan/jeepay/oss/service/IOssService.java
View file @
76e0389c
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <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
com.jeequan.jeepay.oss.service
;
package
com.jeequan.jeepay.oss.service
;
import
com.jeequan.jeepay.oss.constant.OssSavePlaceEnum
;
import
com.jeequan.jeepay.oss.constant.OssSavePlaceEnum
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* OSSService 接口
*
* @author terrfly
* @site https://www.jeepay.vip
* @date 2021/7/12 18:18
*/
public
interface
IOssService
{
public
interface
IOssService
{
/** 上传文件 & 生成下载/预览URL **/
/** 上传文件 & 生成下载/预览URL **/
...
...
jeepay-oss/src/main/java/com/jeequan/jeepay/oss/service/LocalFileService.java
View file @
76e0389c
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <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
com.jeequan.jeepay.oss.service
;
package
com.jeequan.jeepay.oss.service
;
import
com.jeequan.jeepay.core.service.ISysConfigService
;
import
com.jeequan.jeepay.core.service.ISysConfigService
;
...
@@ -11,6 +26,13 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -11,6 +26,13 @@ import org.springframework.web.multipart.MultipartFile;
import
java.io.File
;
import
java.io.File
;
/**
* 本地存储 实现类
*
* @author terrfly
* @site https://www.jeepay.vip
* @date 2021/7/12 18:19
*/
@Service
@Service
@Slf4j
@Slf4j
@ConditionalOnProperty
(
name
=
"isys.oss.service-type"
,
havingValue
=
"local"
)
@ConditionalOnProperty
(
name
=
"isys.oss.service-type"
,
havingValue
=
"local"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment