-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEV:文件服务] 上线测试服务器1<Auto> -e:test -m:file-service -type:single -v:1.4…
… -rp:8089 -de:<-e ACTIVE=dev -e UNIQUE_ID=0 -e SERVER_PORT=8089>
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ public class OSSFileVO extends CommonFileVO{ | |
|
||
@NotBlank(message = "bucket不能为空") | ||
private String bucket; | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/example/filesystem/util/ConcurrentUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.example.filesystem.util; | ||
|
||
import com.example.filesystem.common.BaseException; | ||
|
||
import java.util.concurrent.Callable; | ||
import java.util.concurrent.ExecutionException; | ||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.Future; | ||
|
||
/** | ||
* @Description | ||
* @Author welsir | ||
* @Date 2023/12/23 20:03 | ||
*/ | ||
public class ConcurrentUtil { | ||
|
||
public static <T> Future<T> doJob(ExecutorService executorService, Callable<T> callable) { | ||
return executorService.submit(callable); | ||
} | ||
|
||
public static <T> T futureGet(Future<T> future) { | ||
try { | ||
return future.get(); | ||
} catch (InterruptedException | ExecutionException e) { | ||
throw new BaseException(e.toString()); | ||
} | ||
} | ||
|
||
} |