2424import java .util .Map ;
2525import 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+ */
2736public 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