mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 09:38:19 +08:00
🎨 小程序代码提交审核代码重构优化,删除重复定义类
This commit is contained in:
@ -39,7 +39,7 @@ public interface WxMaCodeService {
|
|||||||
* @return List<WxMaCategory>
|
* @return List<WxMaCategory>
|
||||||
* @throws WxErrorException 获取失败时返回,具体错误码请看此接口的注释文档
|
* @throws WxErrorException 获取失败时返回,具体错误码请看此接口的注释文档
|
||||||
*/
|
*/
|
||||||
List<WxMaCategory> getCategory() throws WxErrorException;
|
List<WxMaCodeSubmitAuditItem> getCategory() throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用).
|
* 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用).
|
||||||
|
|||||||
@ -67,13 +67,13 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WxMaCategory> getCategory() throws WxErrorException {
|
public List<WxMaCodeSubmitAuditItem> getCategory() throws WxErrorException {
|
||||||
String responseContent = this.service.get(GET_CATEGORY_URL, null);
|
String responseContent = this.service.get(GET_CATEGORY_URL, null);
|
||||||
JsonObject jsonObject = GsonParser.parse(responseContent);
|
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||||
boolean hasCategoryList = jsonObject.has("category_list");
|
boolean hasCategoryList = jsonObject.has("category_list");
|
||||||
if (hasCategoryList) {
|
if (hasCategoryList) {
|
||||||
return WxMaGsonBuilder.create().fromJson(jsonObject.getAsJsonArray("category_list"),
|
return WxMaGsonBuilder.create().fromJson(jsonObject.getAsJsonArray("category_list"),
|
||||||
new TypeToken<List<WxMaCategory>>() {
|
new TypeToken<List<WxMaCodeSubmitAuditItem>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class WxMaCategory implements Serializable {
|
public class WxMaCodeSubmitAuditItem implements Serializable {
|
||||||
private static final long serialVersionUID = -7663757440028175135L;
|
private static final long serialVersionUID = -7663757440028175135L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,6 +34,7 @@ public class WxMaCategory implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 一级类目名称
|
* 一级类目名称
|
||||||
|
* 类目名称,可通过“获取授权小程序帐号的可选类目”接口获得
|
||||||
*/
|
*/
|
||||||
@SerializedName("first_class")
|
@SerializedName("first_class")
|
||||||
private String firstClass;
|
private String firstClass;
|
||||||
@ -49,6 +50,7 @@ public class WxMaCategory implements Serializable {
|
|||||||
private String thirdClass;
|
private String thirdClass;
|
||||||
/**
|
/**
|
||||||
* 一级类目的ID编号
|
* 一级类目的ID编号
|
||||||
|
* 类目的ID,可通过“获取授权小程序帐号的可选类目”接口获得
|
||||||
*/
|
*/
|
||||||
@SerializedName("first_id")
|
@SerializedName("first_id")
|
||||||
private Long firstId;
|
private Long firstId;
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.code;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author binarywang
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class WxMaCodeSubmitAuditPreviewInfo 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;
|
||||||
|
}
|
||||||
@ -29,7 +29,7 @@ public class WxMaCodeSubmitAuditRequest implements Serializable {
|
|||||||
* 提交审核项的一个列表(至少填写1项,至多填写5项)
|
* 提交审核项的一个列表(至少填写1项,至多填写5项)
|
||||||
*/
|
*/
|
||||||
@SerializedName("item_list")
|
@SerializedName("item_list")
|
||||||
private List<WxMaCategory> itemList;
|
private List<WxMaCodeSubmitAuditItem> itemList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* feedback_info String 否 反馈内容,至多 200 字
|
* feedback_info String 否 反馈内容,至多 200 字
|
||||||
@ -47,75 +47,40 @@ public class WxMaCodeSubmitAuditRequest implements Serializable {
|
|||||||
* preview_info Object 否 预览信息(小程序页面截图和操作录屏)
|
* preview_info Object 否 预览信息(小程序页面截图和操作录屏)
|
||||||
*/
|
*/
|
||||||
@SerializedName("preview_info")
|
@SerializedName("preview_info")
|
||||||
private PreviewInfo previewInfo;
|
private WxMaCodeSubmitAuditPreviewInfo previewInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* version_desc String 否 小程序版本说明和功能解释
|
* version_desc
|
||||||
|
* String
|
||||||
|
* 否
|
||||||
|
* 小程序版本说明和功能解释
|
||||||
*/
|
*/
|
||||||
@SerializedName("version_desc")
|
@SerializedName("version_desc")
|
||||||
private String versionDesc;
|
private String versionDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ugc_declare Object 否 用户生成内容场景(UGC)信息安全声明
|
* ugc_declare
|
||||||
|
* Object
|
||||||
|
* 否
|
||||||
|
* 用户生成内容场景(UGC)信息安全声明
|
||||||
*/
|
*/
|
||||||
@SerializedName("ugc_declare")
|
@SerializedName("ugc_declare")
|
||||||
private UgcDeclare ugcDeclare;
|
private WxMaCodeSubmitAuditUgcDeclare ugcDeclare;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于声明是否不使用“代码中检测出但是未配置的隐私相关接口”
|
||||||
|
*/
|
||||||
|
@SerializedName("privacy_api_not_use")
|
||||||
|
private Boolean privacyApiNotUse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单中心path
|
||||||
|
*/
|
||||||
|
@SerializedName("order_path")
|
||||||
|
private String orderPath;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
package cn.binarywang.wx.miniapp.bean.code;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author binarywang
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class WxMaCodeSubmitAuditUgcDeclare 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;
|
||||||
|
}
|
||||||
@ -31,7 +31,7 @@ public class WxMaCodeServiceImplTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetCategory() throws Exception {
|
public void testGetCategory() throws Exception {
|
||||||
List<WxMaCategory> categories = wxService.getCodeService().getCategory();
|
List<WxMaCodeSubmitAuditItem> categories = wxService.getCodeService().getCategory();
|
||||||
System.out.println(String.valueOf(categories));
|
System.out.println(String.valueOf(categories));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public class WxMaCodeServiceImplTest {
|
|||||||
WxMaCodeSubmitAuditRequest auditRequest = WxMaCodeSubmitAuditRequest
|
WxMaCodeSubmitAuditRequest auditRequest = WxMaCodeSubmitAuditRequest
|
||||||
.builder()
|
.builder()
|
||||||
.itemList(Arrays.asList(
|
.itemList(Arrays.asList(
|
||||||
WxMaCategory
|
WxMaCodeSubmitAuditItem
|
||||||
.builder()
|
.builder()
|
||||||
.address("pages/logs/logs")
|
.address("pages/logs/logs")
|
||||||
.tag("工具 效率")
|
.tag("工具 效率")
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public class WxMaCodeSubmitAuditRequestTest {
|
|||||||
public void testToJson() {
|
public void testToJson() {
|
||||||
WxMaCodeSubmitAuditRequest request = WxMaCodeSubmitAuditRequest.builder()
|
WxMaCodeSubmitAuditRequest request = WxMaCodeSubmitAuditRequest.builder()
|
||||||
.itemList(Arrays.asList(
|
.itemList(Arrays.asList(
|
||||||
WxMaCategory.builder()
|
WxMaCodeSubmitAuditItem.builder()
|
||||||
.address("index")
|
.address("index")
|
||||||
.tag("学习 生活")
|
.tag("学习 生活")
|
||||||
.firstClass("文娱")
|
.firstClass("文娱")
|
||||||
@ -25,7 +25,7 @@ public class WxMaCodeSubmitAuditRequestTest {
|
|||||||
.secondId(2L)
|
.secondId(2L)
|
||||||
.title("首页")
|
.title("首页")
|
||||||
.build(),
|
.build(),
|
||||||
WxMaCategory.builder()
|
WxMaCodeSubmitAuditItem.builder()
|
||||||
.address("page/logs/logs")
|
.address("page/logs/logs")
|
||||||
.tag("学习 工作")
|
.tag("学习 工作")
|
||||||
.firstClass("教育")
|
.firstClass("教育")
|
||||||
@ -39,10 +39,10 @@ public class WxMaCodeSubmitAuditRequestTest {
|
|||||||
))
|
))
|
||||||
.feedbackInfo("blablabla")
|
.feedbackInfo("blablabla")
|
||||||
.feedbackStuff("xx|yy|zz")
|
.feedbackStuff("xx|yy|zz")
|
||||||
.previewInfo(new WxMaCodeSubmitAuditRequest.PreviewInfo().setVideoIdList(Arrays.asList("xxxx"))
|
.previewInfo(new WxMaCodeSubmitAuditPreviewInfo().setVideoIdList(Arrays.asList("xxxx"))
|
||||||
.setPicIdList(Arrays.asList("xxxx", "yyyy", "zzzz")))
|
.setPicIdList(Arrays.asList("xxxx", "yyyy", "zzzz")))
|
||||||
.versionDesc("blablabla")
|
.versionDesc("blablabla")
|
||||||
.ugcDeclare(new WxMaCodeSubmitAuditRequest.UgcDeclare()
|
.ugcDeclare(new WxMaCodeSubmitAuditUgcDeclare()
|
||||||
.setAuditDesc("blablabla")
|
.setAuditDesc("blablabla")
|
||||||
.setHasAuditTeam(1)
|
.setHasAuditTeam(1)
|
||||||
.setMethod(new Integer[]{1})
|
.setMethod(new Integer[]{1})
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
package me.chanjar.weixin.open.bean.ma;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zxfreedom
|
|
||||||
* @description
|
|
||||||
* created on 2019/12/30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class WxOpenMaPreviewInfo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录屏mediaid列表,可以通过提审素材上传接口获得
|
|
||||||
*/
|
|
||||||
@SerializedName("video_id_list")
|
|
||||||
private String[] videoIdList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 截屏mediaid列表,可以通过提审素材上传接口获得
|
|
||||||
*/
|
|
||||||
@SerializedName("pic_id_list")
|
|
||||||
private String[] picIdList;
|
|
||||||
}
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
package me.chanjar.weixin.open.bean.ma;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 三方平台提交小程序代码审核
|
|
||||||
*
|
|
||||||
* @author yqx
|
|
||||||
* created on 2018/9/13
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class WxOpenMaSubmitAudit implements Serializable {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序的页面,可通过“获取小程序的第三方提交代码的页面配置”接口获得
|
|
||||||
*/
|
|
||||||
@SerializedName("address")
|
|
||||||
private String pagePath;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序的标签,多个标签用空格分隔,标签不能多于10个,标签长度不超过20
|
|
||||||
*/
|
|
||||||
@SerializedName("tag")
|
|
||||||
private String tag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类目名称,可通过“获取授权小程序帐号的可选类目”接口获得
|
|
||||||
*/
|
|
||||||
@SerializedName("first_class")
|
|
||||||
private String firstClass;
|
|
||||||
|
|
||||||
@SerializedName("second_class")
|
|
||||||
private String secondClass;
|
|
||||||
|
|
||||||
@SerializedName("third_class")
|
|
||||||
private String thirdClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类目的ID,可通过“获取授权小程序帐号的可选类目”接口获得
|
|
||||||
*/
|
|
||||||
@SerializedName("first_id")
|
|
||||||
private Integer firstId;
|
|
||||||
|
|
||||||
@SerializedName("second_id")
|
|
||||||
private Integer secondId;
|
|
||||||
|
|
||||||
@SerializedName("third_id")
|
|
||||||
private Integer thirdId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小程序页面的标题,标题长度不超过32
|
|
||||||
*/
|
|
||||||
@SerializedName("title")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
package me.chanjar.weixin.open.bean.message;
|
package me.chanjar.weixin.open.bean.message;
|
||||||
|
|
||||||
|
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeSubmitAuditItem;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeSubmitAuditPreviewInfo;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.open.bean.ma.WxOpenMaPreviewInfo;
|
|
||||||
import me.chanjar.weixin.open.bean.ma.WxOpenMaSubmitAudit;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -22,13 +22,13 @@ public class WxOpenMaSubmitAuditMessage implements Serializable {
|
|||||||
* 提交审核项的一个列表(至少填写1项,至多填写5项)
|
* 提交审核项的一个列表(至少填写1项,至多填写5项)
|
||||||
*/
|
*/
|
||||||
@SerializedName("item_list")
|
@SerializedName("item_list")
|
||||||
private List<WxOpenMaSubmitAudit> itemList;
|
private List<WxMaCodeSubmitAuditItem> itemList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览信息(小程序页面截图和操作录屏)
|
* 预览信息(小程序页面截图和操作录屏)
|
||||||
*/
|
*/
|
||||||
@SerializedName("preview_info")
|
@SerializedName("preview_info")
|
||||||
private WxOpenMaPreviewInfo previewInfo;
|
private WxMaCodeSubmitAuditPreviewInfo previewInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序版本说明和功能解释
|
* 小程序版本说明和功能解释
|
||||||
@ -53,4 +53,10 @@ public class WxOpenMaSubmitAuditMessage implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@SerializedName("privacy_api_not_use")
|
@SerializedName("privacy_api_not_use")
|
||||||
private Boolean privacyApiNotUse;
|
private Boolean privacyApiNotUse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单中心path
|
||||||
|
*/
|
||||||
|
@SerializedName("order_path")
|
||||||
|
private String orderPath;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user