mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 02:28:25 +08:00 
			
		
		
		
	🎨 #2534 【小程序】代码提交审核接口新增部分参数
This commit is contained in:
		| @ -5,6 +5,7 @@ import lombok.AllArgsConstructor; | |||||||
| import lombok.Builder; | import lombok.Builder; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  |  | ||||||
| import java.io.Serializable; | import java.io.Serializable; | ||||||
|  |  | ||||||
| @ -18,8 +19,19 @@ import java.io.Serializable; | |||||||
| @Builder | @Builder | ||||||
| @NoArgsConstructor | @NoArgsConstructor | ||||||
| @AllArgsConstructor | @AllArgsConstructor | ||||||
|  | @Accessors(chain = true) | ||||||
| public class WxMaCategory implements Serializable { | public class WxMaCategory implements Serializable { | ||||||
|   private static final long serialVersionUID = -7663757440028175135L; |   private static final long serialVersionUID = -7663757440028175135L; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 小程序的页面,可通过“获取小程序的第三方提交代码的页面配置”接口获得 | ||||||
|  |    */ | ||||||
|  |   private String address; | ||||||
|  |   /** | ||||||
|  |    * 小程序的标签,多个标签用空格分隔,标签不能多于10个,标签长度不超过20 | ||||||
|  |    */ | ||||||
|  |   private String tag; | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * 一级类目名称 |    * 一级类目名称 | ||||||
|    */ |    */ | ||||||
| @ -51,14 +63,6 @@ public class WxMaCategory implements Serializable { | |||||||
|   @SerializedName("third_id") |   @SerializedName("third_id") | ||||||
|   private Long thirdId; |   private Long thirdId; | ||||||
|  |  | ||||||
|   /** |  | ||||||
|    * 小程序的页面,可通过“获取小程序的第三方提交代码的页面配置”接口获得 |  | ||||||
|    */ |  | ||||||
|   private String address; |  | ||||||
|   /** |  | ||||||
|    * 小程序的标签,多个标签用空格分隔,标签不能多于10个,标签长度不超过20 |  | ||||||
|    */ |  | ||||||
|   private String tag; |  | ||||||
|   /** |   /** | ||||||
|    * 小程序页面的标题,标题长度不超过32 |    * 小程序页面的标题,标题长度不超过32 | ||||||
|    */ |    */ | ||||||
|  | |||||||
| @ -6,6 +6,7 @@ import lombok.AllArgsConstructor; | |||||||
| import lombok.Builder; | import lombok.Builder; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  |  | ||||||
| import java.io.Serializable; | import java.io.Serializable; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -20,15 +21,101 @@ import java.util.List; | |||||||
| @Builder | @Builder | ||||||
| @NoArgsConstructor | @NoArgsConstructor | ||||||
| @AllArgsConstructor | @AllArgsConstructor | ||||||
|  | @Accessors(chain = true) | ||||||
| public class WxMaCodeSubmitAuditRequest implements Serializable { | public class WxMaCodeSubmitAuditRequest implements Serializable { | ||||||
|   private static final long serialVersionUID = 8854979405505241314L; |   private static final long serialVersionUID = 8854979405505241314L; | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * 提交审核项的一个列表(至少填写1项,至多填写5项) |    * 提交审核项的一个列表(至少填写1项,至多填写5项) | ||||||
|    */ |    */ | ||||||
|   @SerializedName("item_list") |   @SerializedName("item_list") | ||||||
|   private List<WxMaCategory> itemList; |   private List<WxMaCategory> itemList; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * feedback_info	String	否	反馈内容,至多 200 字 | ||||||
|  |    */ | ||||||
|  |   @SerializedName("feedback_info") | ||||||
|  |   private String feedbackInfo; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * feedback_stuff	String	否	用 | 分割的 media_id 列表,至多 5 张图片, 可以通过新增临时素材接口上传而得到 | ||||||
|  |    */ | ||||||
|  |   @SerializedName("feedback_stuff") | ||||||
|  |   private String feedbackStuff; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * preview_info	Object	否	预览信息(小程序页面截图和操作录屏) | ||||||
|  |    */ | ||||||
|  |   @SerializedName("preview_info") | ||||||
|  |   private PreviewInfo previewInfo; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * version_desc	String	否	小程序版本说明和功能解释 | ||||||
|  |    */ | ||||||
|  |   @SerializedName("version_desc") | ||||||
|  |   private String versionDesc; | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * ugc_declare	Object	否	用户生成内容场景(UGC)信息安全声明 | ||||||
|  |    */ | ||||||
|  |   @SerializedName("ugc_declare") | ||||||
|  |   private UgcDeclare ugcDeclare; | ||||||
|  |  | ||||||
|   public String toJson() { |   public String toJson() { | ||||||
|     return WxMaGsonBuilder.create().toJson(this); |     return WxMaGsonBuilder.create().toJson(this); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   @Data | ||||||
|  |   @Accessors(chain = true) | ||||||
|  |   public static class PreviewInfo implements Serializable { | ||||||
|  |     private static final long serialVersionUID = -3391652096859063951L; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * video_id_list	String Array	否	录屏mediaid列表,可以通过提审素材上传接口获得 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("video_id_list") | ||||||
|  |     private List<String> videoIdList; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * pic_id_list	String Array	否	截屏mediaid列表,可以通过提审素材上传接口获得 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("pic_id_list") | ||||||
|  |     private List<String> picIdList; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Data | ||||||
|  |   @Accessors(chain = true) | ||||||
|  |   public static class UgcDeclare implements Serializable { | ||||||
|  |     private static final long serialVersionUID = 201470564426848261L; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * scene	Number Array	否	UGC场景 0,不涉及用户生成内容, 1.用户资料,2.图片,3.视频,4.文本,5其他, 可多选,当scene填0时无需填写下列字段 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("scene") | ||||||
|  |     private Integer[] scene; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * other_scene_desc	String	否	当scene选其他时的说明,不超时256字 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("other_scene_desc") | ||||||
|  |     private String otherSceneDesc; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * method	Number Array	否	内容安全机制 1.使用平台建议的内容安全API,2.使用其他的内容审核产品,3.通过人工审核把关,4.未做内容审核把关 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("method") | ||||||
|  |     private Integer[] method; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * has_audit_team	Number	否	是否有审核团队, 0.无,1.有,默认0 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("has_audit_team") | ||||||
|  |     private Integer hasAuditTeam; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * audit_desc	String	否	说明当前对UGC内容的审核机制,不超过256字 | ||||||
|  |      */ | ||||||
|  |     @SerializedName("audit_desc") | ||||||
|  |     private String auditDesc; | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,9 +1,12 @@ | |||||||
| package cn.binarywang.wx.miniapp.bean.code; | package cn.binarywang.wx.miniapp.bean.code; | ||||||
|  |  | ||||||
|  | import me.chanjar.weixin.common.util.json.GsonParser; | ||||||
| import org.testng.annotations.Test; | import org.testng.annotations.Test; | ||||||
|  |  | ||||||
| import java.util.Arrays; | import java.util.Arrays; | ||||||
|  |  | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * @author <a href="https://github.com/charmingoh">Charming</a> |  * @author <a href="https://github.com/charmingoh">Charming</a> | ||||||
|  * @since 2018-04-26 19:55 |  * @since 2018-04-26 19:55 | ||||||
| @ -11,20 +14,84 @@ import java.util.Arrays; | |||||||
| public class WxMaCodeSubmitAuditRequestTest { | public class WxMaCodeSubmitAuditRequestTest { | ||||||
|   @Test |   @Test | ||||||
|   public void testToJson() { |   public void testToJson() { | ||||||
|     WxMaCodeSubmitAuditRequest request = WxMaCodeSubmitAuditRequest |     WxMaCodeSubmitAuditRequest request = WxMaCodeSubmitAuditRequest.builder() | ||||||
|       .builder() |  | ||||||
|       .itemList(Arrays.asList( |       .itemList(Arrays.asList( | ||||||
|         WxMaCategory |         WxMaCategory.builder() | ||||||
|           .builder() |           .address("index") | ||||||
|           .address("pages/logs/logs") |           .tag("学习 生活") | ||||||
|           .tag("工具 效率") |           .firstClass("文娱") | ||||||
|           .firstClass("工具") |           .firstId(1L) | ||||||
|           .firstId(287L) |           .secondClass("资讯") | ||||||
|           .secondClass("效率") |           .secondId(2L) | ||||||
|           .secondId(616L) |           .title("首页") | ||||||
|  |           .build(), | ||||||
|  |         WxMaCategory.builder() | ||||||
|  |           .address("page/logs/logs") | ||||||
|  |           .tag("学习 工作") | ||||||
|  |           .firstClass("教育") | ||||||
|  |           .firstId(3L) | ||||||
|  |           .secondClass("学历教育") | ||||||
|  |           .secondId(4L) | ||||||
|  |           .thirdClass("高等") | ||||||
|  |           .thirdId(5L) | ||||||
|           .title("日志") |           .title("日志") | ||||||
|           .build() |           .build() | ||||||
|       )).build(); |       )) | ||||||
|     System.out.println(request.toJson()); |       .feedbackInfo("blablabla") | ||||||
|  |       .feedbackStuff("xx|yy|zz") | ||||||
|  |       .previewInfo(new WxMaCodeSubmitAuditRequest.PreviewInfo().setVideoIdList(Arrays.asList("xxxx")) | ||||||
|  |         .setPicIdList(Arrays.asList("xxxx", "yyyy", "zzzz"))) | ||||||
|  |       .versionDesc("blablabla") | ||||||
|  |       .ugcDeclare(new WxMaCodeSubmitAuditRequest.UgcDeclare() | ||||||
|  |         .setAuditDesc("blablabla") | ||||||
|  |         .setHasAuditTeam(1) | ||||||
|  |         .setMethod(new Integer[]{1}) | ||||||
|  |         .setScene(new Integer[]{1, 2}) | ||||||
|  |       ).build(); | ||||||
|  |  | ||||||
|  |     String expectedJson = "{\n" + | ||||||
|  |       "\t\"item_list\": [\n" + | ||||||
|  |       "\t{\n" + | ||||||
|  |       "\t\t\"address\":\"index\",\n" + | ||||||
|  |       "\t\t\"tag\":\"学习 生活\",\n" + | ||||||
|  |       "\t\t\"first_class\": \"文娱\",\n" + | ||||||
|  |       "\t\t\"second_class\": \"资讯\",\n" + | ||||||
|  |       "\t\t\"first_id\":1,\n" + | ||||||
|  |       "\t\t\"second_id\":2,\n" + | ||||||
|  |       "\t\t\"title\": \"首页\"\n" + | ||||||
|  |       "\t},\n" + | ||||||
|  |       "\t{\n" + | ||||||
|  |       "\t\t\"address\":\"page/logs/logs\",\n" + | ||||||
|  |       "\t\t\"tag\":\"学习 工作\",\n" + | ||||||
|  |       "\t\t\"first_class\": \"教育\",\n" + | ||||||
|  |       "\t\t\"second_class\": \"学历教育\",\n" + | ||||||
|  |       "\t\t\"third_class\": \"高等\",\n" + | ||||||
|  |       "\t\t\"first_id\":3,\n" + | ||||||
|  |       "\t\t\"second_id\":4,\n" + | ||||||
|  |       "\t\t\"third_id\":5,\n" + | ||||||
|  |       "\t\t\"title\": \"日志\"\n" + | ||||||
|  |       "\t}\n" + | ||||||
|  |       "\t],\n" + | ||||||
|  |       "\t\"feedback_info\": \"blablabla\",\n" + | ||||||
|  |       "    \"feedback_stuff\": \"xx|yy|zz\",\n" + | ||||||
|  |       "    \"preview_info\" : {\n" + | ||||||
|  |       "        \"video_id_list\": [\"xxxx\"],\n" + | ||||||
|  |       "        \"pic_id_list\": [\"xxxx\", \"yyyy\", \"zzzz\" ]\n" + | ||||||
|  |       "    },\n" + | ||||||
|  |       "    \"version_desc\":\"blablabla\",\n" + | ||||||
|  |       "    \"ugc_declare\": {\n" + | ||||||
|  |       "        \"scene\": [\n" + | ||||||
|  |       "            1,\n" + | ||||||
|  |       "            2\n" + | ||||||
|  |       "        ],\n" + | ||||||
|  |       "        \"method\": [\n" + | ||||||
|  |       "            1\n" + | ||||||
|  |       "        ],\n" + | ||||||
|  |       "        \"has_audit_team\": 1,\n" + | ||||||
|  |       "        \"audit_desc\": \"blablabla\"\n" + | ||||||
|  |       "    }\n" + | ||||||
|  |       "}\n" + | ||||||
|  |       ""; | ||||||
|  |     assertThat(request.toJson().replace("\n", "")).isEqualTo(GsonParser.parse(expectedJson).toString()); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang