File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
weixin-java-open/src/main/java/me/chanjar/weixin/open/api Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -401,14 +401,27 @@ public interface WxOpenComponentService {
401
401
List <WxOpenMaCodeTemplate > getTemplateList () throws WxErrorException ;
402
402
403
403
/**
404
+ * 请参考并使用 {@link #addToTemplate(long,int)}.
404
405
* 将草稿箱的草稿选为小程序代码模版.
405
406
*
406
407
* @param draftId 草稿ID,本字段可通过“获取草稿箱内的所有临时代码草稿”接口获得
407
408
* @throws WxErrorException 操作失败时抛出,具体错误码请看此接口的注释文档
408
409
* @see #getTemplateDraftList #getTemplateDraftList
409
410
*/
411
+ @ Deprecated
410
412
void addToTemplate (long draftId ) throws WxErrorException ;
411
413
414
+ /**
415
+ * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/code_template/addtotemplate.html
416
+ * 将草稿添加到代码模板库.
417
+ *
418
+ * @param draftId 草稿ID,本字段可通过“获取草稿箱内的所有临时代码草稿”接口获得
419
+ * @param templateType 代码模版类型,【普通模板:0, 标准模板:1】
420
+ * @throws WxErrorException 操作失败时抛出,具体错误码请看此接口的注释文档
421
+ * @see #getTemplateDraftList #getTemplateDraftList
422
+ */
423
+ void addToTemplate (long draftId , int templateType ) throws WxErrorException ;
424
+
412
425
/**
413
426
* 删除指定小程序代码模版.
414
427
*
Original file line number Diff line number Diff line change @@ -484,6 +484,14 @@ public void addToTemplate(long draftId) throws WxErrorException {
484
484
post (ADD_TO_TEMPLATE_URL , param .toString (), "access_token" );
485
485
}
486
486
487
+ @ Override
488
+ public void addToTemplate (long draftId ,int templateType ) throws WxErrorException {
489
+ JsonObject param = new JsonObject ();
490
+ param .addProperty ("draft_id" , draftId );
491
+ param .addProperty ("template_type" , templateType );
492
+ post (ADD_TO_TEMPLATE_URL , param .toString (), "access_token" );
493
+ }
494
+
487
495
@ Override
488
496
public void deleteTemplate (long templateId ) throws WxErrorException {
489
497
JsonObject param = new JsonObject ();
You can’t perform that action at this time.
0 commit comments