فهرست منبع

清除多余文件

tsurumure 7 ماه پیش
والد
کامیت
c8f82f15f7

+ 0 - 9
src/main/java/com/backendsys/controller/Other/MeituController.java

@@ -1,9 +0,0 @@
-package com.backendsys.controller.Other;
-
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class MeituController {
-
-
-}

+ 0 - 22
src/main/java/com/backendsys/modules/TestController.java

@@ -7,7 +7,6 @@ import cn.hutool.json.JSONUtil;
 
 import com.backendsys.aspect.RateLimiting;
 import com.backendsys.aspect.QueuingPoll;
-//import com.backendsys.service.SDKService.SDKTinypng.SDKTinypngService;
 import com.backendsys.service.TestService;
 import com.backendsys.utils.ResourceUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
@@ -191,8 +190,6 @@ public class TestController {
     // @Autowired
     // private HttpExchangeService httpExchangeService;
 
-//    @Autowired
-//    private HttpTodoService httpTodoService;
 
 //    @PostMapping("testWebHook")
 //    public Result testWebHook(@RequestBody Map<String, Object> requestBody, HttpServletRequest request) {
@@ -263,14 +260,6 @@ public class TestController {
 
 
 
-//    @Autowired
-//    private SDKTinypngService sdkTinypngService;
-//
-//    @PostMapping("testCompressing")
-//    public Result testCompressing(@RequestBody UploadOriginDTO uploadOriginDTO) throws IOException {
-//        return Result.success(sdkTinypngService.runCompressing(uploadOriginDTO));
-//    }
-
 
 //    @Autowired
 //    private SDKTencentCOSService sdkTencentCOSService;
@@ -855,15 +844,4 @@ public class TestController {
         return "ok";
     }
 
-
-//    @GetMapping("testHttpExchangeList")
-//    public List<Map<String, Object>> testHttpExchangeList() {
-//        return httpTodoService.getTodos();
-//    }
-//
-//    @GetMapping("testHttpExchange")
-//    public Map<String, Object> testHttpExchange() {
-//        return httpTodoService.getTodoById(1);
-//    }
-
 }

+ 0 - 62
src/main/java/com/backendsys/service/HttpTodo/HttpTodoConfig.java

@@ -1,62 +0,0 @@
-//package com.backendsys.service.HttpTodo;
-//
-//import io.netty.channel.ChannelOption;
-//import io.netty.handler.timeout.ReadTimeoutHandler;
-//import io.netty.handler.timeout.WriteTimeoutHandler;
-//import lombok.SneakyThrows;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.http.HttpStatusCode;
-//import org.springframework.web.reactive.function.client.WebClient;
-//import org.springframework.web.reactive.function.client.support.WebClientAdapter;
-//import org.springframework.web.service.invoker.HttpServiceProxyFactory;
-//import reactor.core.publisher.Mono;
-//import reactor.netty.http.client.HttpClient;
-//
-// // 全局配置,仅可用于同一个域的配置
-//
-//@Configuration
-//public class HttpTodoConfig {
-//
-//    // 引用配置变量
-//    @Value("${HTTP_ACTUATOR_URI}")
-//    private String baseUrl;
-//
-//    // 定制Http服务
-//    @Bean
-//    public WebClient webClient() {
-//
-//        System.out.println("========= webClient ===========");
-//
-//        HttpClient httpClient = HttpClient.create()
-//                .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 30 * 1000) // 连接时间 3W 毫秒
-//                .doOnConnected(conn -> {
-//                    conn.addHandlerLast(new ReadTimeoutHandler(10)); // 读超时 10秒
-//                    conn.addHandlerLast(new WriteTimeoutHandler(10)); // 写超时 10秒
-//                });
-//
-//
-//        return WebClient.builder()
-//            .baseUrl(baseUrl)
-//            .defaultStatusHandler(HttpStatusCode::isError, clientResponse -> {
-//                System.out.println("WebClient defaultStatusHandler:");
-//                System.out.println(clientResponse.statusCode());
-//                return Mono.error(new RuntimeException(clientResponse.statusCode().toString()));
-//            })
-//            //.defaultStatusHandler(HttpStatusCode::is4xxClientError,
-//            //        error -> Mono.error(new RuntimeException("API not found")))
-//            //.defaultStatusHandler(HttpStatusCode::is5xxServerError,
-//            //        error -> Mono.error(new RuntimeException("Server is not responding")))
-//            .build();
-//    }
-//
-//    // 创建代理
-//    @SneakyThrows
-//    @Bean
-//    public HttpTodoService requestTodoService(WebClient webClient) {
-//        HttpServiceProxyFactory httpServiceProxyFactory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
-//        return httpServiceProxyFactory.createClient(HttpTodoService.class);
-//    }
-//
-//}

+ 0 - 26
src/main/java/com/backendsys/service/HttpTodo/HttpTodoService.java

@@ -1,26 +0,0 @@
-//package com.backendsys.service.HttpTodo;
-//
-//import org.springframework.http.MediaType;
-//import org.springframework.web.bind.annotation.PathVariable;
-//import org.springframework.web.bind.annotation.RequestBody;
-//import org.springframework.web.service.annotation.GetExchange;
-//import org.springframework.web.service.annotation.HttpExchange;
-//import org.springframework.web.service.annotation.PostExchange;
-//import org.springframework.web.service.annotation.PutExchange;
-//
-//import java.util.List;
-//import java.util.Map;
-//
-///**
-// * Http Exchange Service 层
-// */
-//@HttpExchange(accept = "application/json;charset=UTF-8", contentType = "application/json;charset=UTF-8")
-//public interface HttpTodoService {
-//
-//    @GetExchange("/todos/{id}")
-//    Map<String, Object> getTodoById(@PathVariable("id") Integer id);
-//
-//    @GetExchange("/todos")
-//    List<Map<String, Object>> getTodos();
-//
-//}

+ 0 - 12
src/main/java/com/backendsys/service/SDKService/SDKTinypng/SDKTinypngService.java

@@ -1,12 +0,0 @@
-//package com.backendsys.service.SDKService.SDKTinypng;
-//
-//import com.backendsys.entity.Tencent.TencentCos.UploadOriginDTO;
-//
-//import java.io.IOException;
-//import java.util.Map;
-//
-//public interface SDKTinypngService {
-//
-//    Map<String, Object> runCompressing(UploadOriginDTO uploadOriginDTO) throws IOException;
-//
-//}

+ 0 - 73
src/main/java/com/backendsys/service/SDKService/SDKTinypng/SDKTinypngServiceImpl.java

@@ -1,73 +0,0 @@
-//package com.backendsys.service.SDKService.SDKTinypng;
-//
-//import com.backendsys.entity.Tencent.TencentCos.UploadOriginDTO;
-//import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
-//import com.backendsys.utils.CommonUtil;
-//import com.tinify.Source;
-//import com.tinify.Tinify;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.stereotype.Service;
-//
-//import java.awt.image.DataBuffer;
-//import java.awt.image.DataBufferByte;
-//import java.io.ByteArrayInputStream;
-//import java.io.File;
-//import java.io.IOException;
-//import java.io.InputStream;
-//import java.nio.ByteBuffer;
-//import java.text.SimpleDateFormat;
-//import java.util.Date;
-//import java.util.Map;
-//
-//@Service
-//public class SDKTinypngServiceImpl implements SDKTinypngService {
-//
-//    @Value("${file.upload.directory}") // 配置保存文件的目录
-//    private String uploadDirectory;
-//
-//    @Value("${file.upload.url-prefix}") // 指定文件访问的 URL前缀
-//    private String uploadUrlPrefix;
-//
-//    @Value("${HTTP_BASE_STATIC}")
-//    private String HTTP_BASE_STATIC;
-//
-//    @Autowired
-//    private SDKTencentCOSService sdkTencentCOSService;
-//
-//    /**
-//     * 每月 500 张免费压缩
-//     * https://tinypng.com/developers/reference/java
-//     */
-//    @Override
-//    public Map<String, Object> runCompressing(UploadOriginDTO uploadOriginDTO) throws IOException {
-//
-//        Tinify.setKey("XY6uHk_D1-HOQeVZ6Gh9QUUkT3cydsbD");
-//        String url = uploadOriginDTO.getUrl();
-//        Source source = Tinify.fromUrl(url);
-//
-//        // 生成后缀名
-//        String suffix = url.substring(url.lastIndexOf("."));
-//
-//        // 生成文件夹别名 (如果没有就创建)
-//        String alias = "tinypng/";
-//        File dateDirectory = new File(uploadDirectory + alias);
-//        if (!dateDirectory.exists()) { dateDirectory.mkdirs(); }
-//
-//        // 生成新的文件名
-//        String fileName = CommonUtil.generateFilename(suffix);
-//
-//        // 上传到服务器本地路径
-//        source.toFile(uploadDirectory + alias + fileName);
-//
-//        // 输出相对路径: { "path": "/uploads/20240428102306.png" }
-//        return Map.of("path", HTTP_BASE_STATIC + uploadUrlPrefix + alias + fileName);
-//
-////        // 上传到对象储存
-////        String dir = "temp/tinypng/";
-////        byte[] fileBytes = source.toBuffer();
-////        InputStream inputStream = new ByteArrayInputStream(fileBytes);
-////        sdkTencentCOSService.uploadWithStream(inputStream, dir + newFileName);
-//
-//    }
-//}