Skip to content

Commit 01729e8

Browse files
committed
sync: cherry-pick changes from feature/3.0.x
1 parent 8a00485 commit 01729e8

81 files changed

Lines changed: 4564 additions & 956 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/com/faceplusplus/spring/boot/FaceppApiAddress.java

Lines changed: 154 additions & 133 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
package com.faceplusplus.spring.boot;
22

33
/**
4-
* 声网相关的常量
4+
* Constants used across the Face++ SDK for API endpoints, recording identifiers,
5+
* and storage path configuration.
6+
*
7+
* @author [@Loong Wan](https://github.com/loong10k)
8+
* @since 3.0.0
9+
* @see FaceppApiAddress
510
*/
611
public interface FaceppConstant {
712

8-
// 获取频道内的所有用户
9-
// https://api.agora.io/dev/v1/channel/user/{appid}/{channelName}
13+
/**
14+
* URL template for retrieving all users within a channel.
15+
* Placeholders: {0} = appId, {1} = channelName.
16+
*/
1017
String URL_CHANNEL_USER = "https://api.agora.io/dev/v1/channel/user/{0}/{1}";
1118

12-
// 用户禁封
13-
// https://api.agora.io/dev/v1/kicking-rule
19+
/**
20+
* URL for user-ban rule management.
21+
*/
1422
String URL_RULE = "https://api.agora.io/dev/v1/kicking-rule";
1523

16-
// 录制请求的uid
24+
/**
25+
* Default UID used for recording requests.
26+
*/
1727
String RECORDING_UID = "10";
1828

19-
// 存储位置 /video/{{yyyy-MM-dd}}
29+
/**
30+
* Root directory for video file storage (pattern: video/{yyyy-MM-dd}).
31+
*/
2032
String VEIDO_PAHT = "video";
2133
}

src/main/java/com/faceplusplus/spring/boot/FaceppFaceAsyncOperations.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,22 @@
1515
*/
1616
package com.faceplusplus.spring.boot;
1717

18+
/**
19+
* Async-capable operations for face detection, analysis, comparison, search, and skin analysis.
20+
* Extends {@link FaceppFaceOperations} inheriting all synchronous face operation methods.
21+
*
22+
* @author [@Loong Wan](https://github.com/loong10k)
23+
* @since 3.0.0
24+
* @see FaceppFaceOperations
25+
* @see FaceppTemplate
26+
*/
1827
public class FaceppFaceAsyncOperations extends FaceppFaceOperations {
1928

29+
/**
30+
* Constructs a new {@code FaceppFaceAsyncOperations} bound to the given template.
31+
*
32+
* @param faceppTemplate the template providing access to SDK configuration and HTTP client
33+
*/
2034
public FaceppFaceAsyncOperations(FaceppTemplate faceppTemplate) {
2135
super(faceppTemplate);
2236
}

src/main/java/com/faceplusplus/spring/boot/FaceppFaceOperations.java

Lines changed: 123 additions & 105 deletions
Large diffs are not rendered by default.

src/main/java/com/faceplusplus/spring/boot/FaceppFacesetAsyncOperations.java

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,34 @@
2424
import java.util.Map;
2525
import java.util.function.Consumer;
2626

27+
/**
28+
* Async-capable operations for FaceSet management, including asynchronous
29+
* add/remove face operations and task status queries.
30+
*
31+
* @author [@Loong Wan](https://github.com/loong10k)
32+
* @since 3.0.0
33+
* @see FaceppFacesetOperations
34+
* @see FaceppTemplate
35+
*/
2736
public class FaceppFacesetAsyncOperations extends FaceppFacesetOperations {
2837

38+
/**
39+
* Constructs a new {@code FaceppFacesetAsyncOperations} bound to the given template.
40+
*
41+
* @param faceppTemplate the template providing access to SDK configuration and HTTP client
42+
*/
2943
public FaceppFacesetAsyncOperations(FaceppTemplate faceppTemplate) {
3044
super(faceppTemplate);
3145
}
3246

3347
/**
34-
* 1、人脸库管理相关接口 > 添加人脸(异步) API
35-
* 为一个已经创建的 FaceSet 添加人脸标识 face_token。一个 FaceSet 最多存储1,000个 face_token。
36-
* 注意:2017年8月16日后,一个 FaceSet 能够存储的 face_token 数量将从 1000 提升至 10000。
37-
* API:https://console.faceplusplus.com.cn/documents/40622166
38-
* @param facesetToken FaceSet的标识
39-
* @param faceTokens 人脸标识 face_token 组成的字符串,可以是一个或者多个,用逗号分隔。最多不超过5个face_token
40-
* @return 操作结果
48+
* Asynchronously adds face tokens to a FaceSet identified by its token.
49+
*
50+
* @param facesetToken the FaceSet identifier
51+
* @param faceTokens array of face tokens to add (max 5)
52+
* @param consumer callback to receive the response
53+
* @throws IOException if the HTTP request fails
54+
* @see FaceppApiAddress#FACE_ADD_ASYNC
4155
*/
4256
public void asyncAddFaceWithToken(String facesetToken, String[] faceTokens, Consumer<FaceAddResponse> consumer) throws IOException {
4357
String reqUrl = FaceppApiAddress.FACE_ADD_ASYNC.getUrl();
@@ -51,13 +65,13 @@ public void asyncAddFaceWithToken(String facesetToken, String[] faceTokens, Cons
5165
}
5266

5367
/**
54-
* 2、人脸库管理相关接口 > 添加人脸(异步) API
55-
* 为一个已经创建的 FaceSet 添加人脸标识 face_token。一个 FaceSet 最多存储1,000个 face_token。
56-
* 注意:2017年8月16日后,一个 FaceSet 能够存储的 face_token 数量将从 1000 提升至 10000。
57-
* API:https://console.faceplusplus.com.cn/documents/40622166
58-
* @param outerId 用户提供的FaceSet标识
59-
* @param faceTokens 人脸标识 face_token 组成的字符串,可以是一个或者多个,用逗号分隔。最多不超过5个face_token
60-
* @return 操作结果
68+
* Asynchronously adds face tokens to a FaceSet identified by its outer_id.
69+
*
70+
* @param outerId the user-defined FaceSet identifier
71+
* @param faceTokens array of face tokens to add (max 5)
72+
* @param consumer callback to receive the response
73+
* @throws IOException if the HTTP request fails
74+
* @see FaceppApiAddress#FACE_ADD_ASYNC
6175
*/
6276
public void asyncAddFaceWithOuterId(String outerId, String[] faceTokens, Consumer<FaceAddResponse> consumer) throws IOException {
6377
String reqUrl = FaceppApiAddress.FACE_ADD_ASYNC.getUrl();
@@ -71,13 +85,13 @@ public void asyncAddFaceWithOuterId(String outerId, String[] faceTokens, Consume
7185
}
7286

7387
/**
74-
* 3、人脸库管理相关接口 > 删除人脸(异步) API
75-
* 移除一个FaceSet中的某些或者全部face_token
76-
* API:https://console.faceplusplus.com.cn/documents/4888399
77-
* @param facesetToken FaceSet的标识
78-
* @param faceTokens 需要移除的人脸标识字符串,可以是一个或者多个face_token组成,用逗号分隔。最多不能超过1,000个face_token
79-
* 注:face_tokens字符串传入“RemoveAllFaceTokens”则会移除FaceSet内所有的face_token
80-
* @return 操作结果
88+
* Asynchronously removes face tokens from a FaceSet identified by its token.
89+
*
90+
* @param facesetToken the FaceSet identifier
91+
* @param faceTokens array of face tokens to remove
92+
* @param consumer callback to receive the response
93+
* @throws IOException if the HTTP request fails
94+
* @see FaceppApiAddress#FACE_REMOVE_ASYNC
8195
*/
8296
public void asyncRemoveFaceByToken(String facesetToken, String[] faceTokens, Consumer<FaceRemoveResponse> consumer) throws IOException {
8397
String reqUrl = FaceppApiAddress.FACE_REMOVE_ASYNC.getUrl();
@@ -91,13 +105,13 @@ public void asyncRemoveFaceByToken(String facesetToken, String[] faceTokens, Con
91105
}
92106

93107
/**
94-
* 4、人脸库管理相关接口 > 删除人脸(异步) API
95-
* 移除一个FaceSet中的某些或者全部face_token
96-
* API:https://console.faceplusplus.com.cn/documents/40622169
97-
* @param outerId 用户提供的FaceSet标识
98-
* @param faceTokens 需要移除的人脸标识字符串,可以是一个或者多个face_token组成,用逗号分隔。最多不能超过1,000个face_token
99-
* 注:face_tokens字符串传入“RemoveAllFaceTokens”则会移除FaceSet内所有的face_token
100-
* @return 操作结果
108+
* Asynchronously removes face tokens from a FaceSet identified by its outer_id.
109+
*
110+
* @param outerId the user-defined FaceSet identifier
111+
* @param faceTokens array of face tokens to remove
112+
* @param consumer callback to receive the response
113+
* @throws IOException if the HTTP request fails
114+
* @see FaceppApiAddress#FACE_REMOVE_ASYNC
101115
*/
102116
public void asyncRemoveFaceByOuterId(String outerId, String[] faceTokens, Consumer<FaceRemoveResponse> consumer) throws IOException {
103117
String reqUrl = FaceppApiAddress.FACE_REMOVE_ASYNC.getUrl();
@@ -111,12 +125,12 @@ public void asyncRemoveFaceByOuterId(String outerId, String[] faceTokens, Consum
111125
}
112126

113127
/**
114-
* 5、人脸库管理相关接口 > 添加/删除人脸结果查询 API
115-
* 查询之前调用的异步添加/删除人脸请求,异步任务当前的状态
116-
* 注意:2017年8月16日后,一个 FaceSet 能够存储的 face_token 数量将从 1000 提升至 10000。
117-
* API:https://console.faceplusplus.com.cn/documents/40622157
118-
* @param taskId 异步任务的唯一标识
119-
* @return 操作结果
128+
* Queries the status of an asynchronous add/remove face task.
129+
*
130+
* @param taskId the unique identifier of the async task
131+
* @return the task status response
132+
* @throws IOException if the HTTP request fails
133+
* @see FaceppApiAddress#FACE_STATUS_ASYNC
120134
*/
121135
public FaceStatusResponse getFaceStatusByTaskId(String taskId) throws IOException {
122136
String reqUrl = FaceppApiAddress.FACE_STATUS_ASYNC.getUrl();

0 commit comments

Comments
 (0)