mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
fix:oss组件封装
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
<groupId>com.abin.mallchat</groupId>
|
||||
<artifactId>mallchat-transaction</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.abin.mallchat</groupId>
|
||||
<artifactId>mallchat-oss-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.knuddels</groupId>
|
||||
<artifactId>jtokkit</artifactId>
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.abin.mallchat.common.user.controller;
|
||||
|
||||
import com.abin.mallchat.common.common.domain.vo.response.ApiResult;
|
||||
import com.abin.mallchat.common.common.utils.RequestHolder;
|
||||
import com.abin.mallchat.common.common.utils.oss.domain.OssResp;
|
||||
import com.abin.mallchat.common.user.domain.vo.request.oss.UploadUrlReq;
|
||||
import com.abin.mallchat.common.user.service.OssService;
|
||||
import com.abin.mallchat.oss.domain.OssResp;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.abin.mallchat.common.user.service;
|
||||
|
||||
import com.abin.mallchat.common.common.utils.oss.domain.OssResp;
|
||||
import com.abin.mallchat.common.user.domain.vo.request.oss.UploadUrlReq;
|
||||
import com.abin.mallchat.oss.domain.OssResp;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.abin.mallchat.common.user.service.impl;
|
||||
|
||||
import com.abin.mallchat.common.common.utils.AssertUtil;
|
||||
import com.abin.mallchat.common.common.utils.oss.MinIOTemplate;
|
||||
import com.abin.mallchat.common.common.utils.oss.domain.OssReq;
|
||||
import com.abin.mallchat.common.common.utils.oss.domain.OssResp;
|
||||
import com.abin.mallchat.common.user.domain.enums.OssSceneEnum;
|
||||
import com.abin.mallchat.common.user.domain.vo.request.oss.UploadUrlReq;
|
||||
import com.abin.mallchat.common.user.service.OssService;
|
||||
import com.abin.mallchat.oss.MinIOTemplate;
|
||||
import com.abin.mallchat.oss.domain.OssReq;
|
||||
import com.abin.mallchat.oss.domain.OssResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ mybatis-plus:
|
||||
spring:
|
||||
profiles:
|
||||
#运行的环境
|
||||
active: my-test
|
||||
active: my-prod
|
||||
application:
|
||||
name: mallchat
|
||||
datasource:
|
||||
|
||||
@@ -104,10 +104,6 @@
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
</dependency>
|
||||
<!-- Used for unit testing -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
||||
24
mallchat-tools/mallchat-oss-starter/pom.xml
Normal file
24
mallchat-tools/mallchat-oss-starter/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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>mallchat-tools</artifactId>
|
||||
<groupId>com.abin.mallchat</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>mallchat-oss-starter</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.abin.mallchat</groupId>
|
||||
<artifactId>mallchat-common-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.abin.mallchat.common.common.config;
|
||||
package com.abin.mallchat.oss;
|
||||
|
||||
import com.abin.mallchat.common.common.utils.oss.MinIOTemplate;
|
||||
import com.abin.mallchat.common.common.utils.oss.OssProperties;
|
||||
import io.minio.MinioClient;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.boot.autoconfigure.condition.*;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.abin.mallchat.common.common.utils.oss;
|
||||
package com.abin.mallchat.oss;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.file.FileNameUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.abin.mallchat.common.common.utils.oss.domain.OssReq;
|
||||
import com.abin.mallchat.common.common.utils.oss.domain.OssResp;
|
||||
import com.abin.mallchat.oss.domain.OssReq;
|
||||
import com.abin.mallchat.oss.domain.OssResp;
|
||||
import io.minio.*;
|
||||
import io.minio.http.Method;
|
||||
import io.minio.messages.Bucket;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.abin.mallchat.common.common.utils.oss;
|
||||
package com.abin.mallchat.oss;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.abin.mallchat.common.common.utils.oss;
|
||||
package com.abin.mallchat.oss;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.abin.mallchat.common.common.utils.oss;
|
||||
package com.abin.mallchat.oss;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.abin.mallchat.common.common.utils.oss.domain;
|
||||
package com.abin.mallchat.oss.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.abin.mallchat.common.common.utils.oss.domain;
|
||||
package com.abin.mallchat.oss.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -0,0 +1,3 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.abin.mallchat.oss.MinIOConfiguration
|
||||
@@ -11,11 +11,11 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<module>mallchat-transaction</module>
|
||||
<module>mallchat-common-starter</module>
|
||||
<module>mallchat-frequency-control</module>
|
||||
<module>mallchat-oss-starter</module>
|
||||
</modules>
|
||||
|
||||
|
||||
|
||||
5
pom.xml
5
pom.xml
@@ -54,6 +54,11 @@
|
||||
<artifactId>mallchat-common-starter</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.abin.mallchat</groupId>
|
||||
<artifactId>mallchat-oss-starter</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.abin.mallchat</groupId>
|
||||
<artifactId>mallchat-transaction</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user