liuyanming.lym il y a 1 mois
Parent
commit
a9b1d361bb

+ 1 - 1
pom.xml

@@ -45,7 +45,7 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid-spring-boot-starter</artifactId>
-            <version>1.2.21</version>
+            <version>1.2.22</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 3 - 2
src/main/java/org/lym/pom/controller/ImageController.java

@@ -5,6 +5,7 @@ import org.lym.pom.service.ImageStorageService;
 import org.shoulder.core.dto.response.BaseResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -39,8 +40,8 @@ public class ImageController {
         storageService.downloadImage(imageId, response);
     }
 
-    @GetMapping("{resourceIdOrPath}")
-    public BaseResult<Boolean> downloadImage(@PathVariable("resourceIdOrPath") String imageId) throws IOException {
+    @DeleteMapping("{resourceIdOrPath}")
+    public BaseResult<Boolean> deleteImage(@PathVariable("resourceIdOrPath") String imageId) throws IOException {
         return BaseResult.success(storageService.deleteImage(imageId));
     }
 

+ 1 - 2
src/main/java/org/lym/pom/service/impl/GithubImageStorageService.java

@@ -9,7 +9,6 @@ import org.lym.pom.util.github.dto.GithubFileAndCommit;
 import org.lym.pom.util.github.dto.GithubFileInfo;
 import org.shoulder.core.context.AppContext;
 import org.shoulder.core.context.AppInfo;
-import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.net.URLEncoder;
@@ -17,7 +16,7 @@ import java.util.Base64;
 import java.util.Objects;
 import java.util.UUID;
 
-@Service
+//@Service
 public class GithubImageStorageService implements ImageStorageService {
     private static final String prefix = GitHubFileUtil.GITHUB_REPOSITORY_API_URL + GitHubFileUtil.APP_NAME + "/";