@@ -219,16 +219,59 @@ public static RoyaltyCollection list(Map<String, Object> params)
219219 *
220220 * @param params
221221 * @return RoyaltyCollection
222- * @throws AuthenticationException
223- * @throws InvalidRequestException
224- * @throws APIConnectionException
225- * @throws APIException
226- * @throws ChannelException
227- * @throws RateLimitException
222+ * @throws AuthenticationException 认证异常
223+ * @throws InvalidRequestException 错误请求
224+ * @throws APIConnectionException 连接异常
225+ * @throws APIException 系统异常
226+ * @throws ChannelException 渠道异常
227+ * @throws RateLimitException 请求超限
228228 */
229229 public static RoyaltyCollection batchUpdate (Map <String , Object > params )
230230 throws AuthenticationException , InvalidRequestException ,
231231 APIConnectionException , APIException , ChannelException , RateLimitException {
232232 return request (APIResource .RequestMethod .PUT , classURL (Royalty .class ), params , RoyaltyCollection .class );
233233 }
234+
235+ /**
236+ * 创建分润
237+ *
238+ * @param orderId 订单 ID
239+ * @param params 分润信息参数
240+ * @return RoyaltyDataResult
241+ * @throws AuthenticationException 认证异常
242+ * @throws InvalidRequestException 错误请求
243+ * @throws APIConnectionException 连接异常
244+ * @throws APIException 系统异常
245+ * @throws ChannelException 渠道异常
246+ * @throws RateLimitException 请求超限
247+ */
248+ public static RoyaltyDataResult createData (String orderId , Map <String , Object > params )
249+ throws AuthenticationException , InvalidRequestException ,
250+ APIConnectionException , APIException , ChannelException , RateLimitException {
251+ return createData (orderId , params , null );
252+ }
253+
254+ /**
255+ * 创建分润
256+ *
257+ * @param orderId 订单 ID
258+ * @param params 分润信息参数
259+ * @param apiKey API Key
260+ * @return RoyaltyDataResult
261+ * @throws AuthenticationException 认证异常
262+ * @throws InvalidRequestException 错误请求
263+ * @throws APIConnectionException 连接异常
264+ * @throws APIException 系统异常
265+ * @throws ChannelException 渠道异常
266+ * @throws RateLimitException 请求超限
267+ */
268+ public static RoyaltyDataResult createData (String orderId , Map <String , Object > params , String apiKey )
269+ throws AuthenticationException , InvalidRequestException ,
270+ APIConnectionException , APIException , ChannelException , RateLimitException {
271+ return request (APIResource .RequestMethod .POST ,
272+ String .format ("%s/royalty_datas" , instanceURL (Order .class , orderId )),
273+ apiKey ,
274+ params ,
275+ RoyaltyDataResult .class );
276+ }
234277}
0 commit comments