mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-02 11:48:54 +08:00
🎨 小程序代码提交审核代码重构优化,删除重复定义类
This commit is contained in:
parent
e0a39c8d68
commit
901fceba27
@ -39,7 +39,7 @@ public interface WxMaCodeService {
|
||||
* @return List<WxMaCategory>
|
||||
* @throws WxErrorException 获取失败时返回,具体错误码请看此接口的注释文档
|
||||
*/
|
||||
List<WxMaCategory> getCategory() throws WxErrorException;
|
||||
List<WxMaCodeSubmitAuditItem> getCategory() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用).
|
||||
|
@ -67,13 +67,13 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxMaCategory> getCategory() throws WxErrorException {
|
||||
public List<WxMaCodeSubmitAuditItem> getCategory() throws WxErrorException {
|
||||
String responseContent = this.service.get(GET_CATEGORY_URL, null);
|
||||
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||
boolean hasCategoryList = jsonObject.has("category_list");
|
||||
if (hasCategoryList) {
|
||||
return WxMaGsonBuilder.create().fromJson(jsonObject.getAsJsonArray("category_list"),
|
||||
new TypeToken<List<WxMaCategory>>() {
|
||||
new TypeToken<List<WxMaCodeSubmitAuditItem>>() {
|
||||
}.getType());
|
||||
} else {
|
||||
return null;
|
||||
|
@ -20,7 +20,7 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxMaCategory implements Serializable {
|
||||
public class WxMaCodeSubmitAuditItem implements Serializable {
|
||||
private static final long serialVersionUID = -7663757440028175135L;
|
||||
|
||||
/**
|
||||
@ -34,6 +34,7 @@ public class WxMaCategory implements Serializable {
|
||||
|
||||
/**
|
||||
* 一级类目名称
|
||||
* 类目名称,可通过“获取授权小程序帐号的可选类目”接口获得
|
||||
*/
|
||||
@SerializedName("first_class")
|
||||
private String firstClass;
|
||||
@ -49,6 +50,7 @@ public class WxMaCategory implements Serializable {
|
||||
private String thirdClass;
|
||||
/**
|
||||
* 一级类目的ID编号
|
||||
* 类目的ID,可通过“获取授权小程序帐号的可选类目”接口获得
|
||||
*/
|
||||
@SerializedName("first_id")
|
||||
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项)
|
||||
*/
|
||||
@SerializedName("item_list")
|
||||
private List<WxMaCategory> itemList;
|
||||
private List<WxMaCodeSubmitAuditItem> itemList;
|
||||
|
||||
/**
|
||||
* feedback_info String 否 反馈内容,至多 200 字
|
||||
@ -47,75 +47,40 @@ public class WxMaCodeSubmitAuditRequest implements Serializable {
|
||||
* preview_info Object 否 预览信息(小程序页面截图和操作录屏)
|
||||
*/
|
||||
@SerializedName("preview_info")
|
||||
private PreviewInfo previewInfo;
|
||||
private WxMaCodeSubmitAuditPreviewInfo previewInfo;
|
||||
|
||||
/**
|
||||
* version_desc String 否 小程序版本说明和功能解释
|
||||
* version_desc
|
||||
* String
|
||||
* 否
|
||||
* 小程序版本说明和功能解释
|
||||
*/
|
||||
@SerializedName("version_desc")
|
||||
private String versionDesc;
|
||||
|
||||
/**
|
||||
* ugc_declare Object 否 用户生成内容场景(UGC)信息安全声明
|
||||
* ugc_declare
|
||||
* Object
|
||||
* 否
|
||||
* 用户生成内容场景(UGC)信息安全声明
|
||||
*/
|
||||
@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() {
|
||||
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
|
||||
public void testGetCategory() throws Exception {
|
||||
List<WxMaCategory> categories = wxService.getCodeService().getCategory();
|
||||
List<WxMaCodeSubmitAuditItem> categories = wxService.getCodeService().getCategory();
|
||||
System.out.println(String.valueOf(categories));
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class WxMaCodeServiceImplTest {
|
||||
WxMaCodeSubmitAuditRequest auditRequest = WxMaCodeSubmitAuditRequest
|
||||
.builder()
|
||||
.itemList(Arrays.asList(
|
||||
WxMaCategory
|
||||
WxMaCodeSubmitAuditItem
|
||||
.builder()
|
||||
.address("pages/logs/logs")
|
||||
.tag("工具 效率")
|
||||
|
@ -16,7 +16,7 @@ public class WxMaCodeSubmitAuditRequestTest {
|
||||
public void testToJson() {
|
||||
WxMaCodeSubmitAuditRequest request = WxMaCodeSubmitAuditRequest.builder()
|
||||
.itemList(Arrays.asList(
|
||||
WxMaCategory.builder()
|
||||
WxMaCodeSubmitAuditItem.builder()
|
||||
.address("index")
|
||||
.tag("学习 生活")
|
||||
.firstClass("文娱")
|
||||
@ -25,7 +25,7 @@ public class WxMaCodeSubmitAuditRequestTest {
|
||||
.secondId(2L)
|
||||
.title("首页")
|
||||
.build(),
|
||||
WxMaCategory.builder()
|
||||
WxMaCodeSubmitAuditItem.builder()
|
||||
.address("page/logs/logs")
|
||||
.tag("学习 工作")
|
||||
.firstClass("教育")
|
||||
@ -39,10 +39,10 @@ public class WxMaCodeSubmitAuditRequestTest {
|
||||
))
|
||||
.feedbackInfo("blablabla")
|
||||
.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")))
|
||||
.versionDesc("blablabla")
|
||||
.ugcDeclare(new WxMaCodeSubmitAuditRequest.UgcDeclare()
|
||||
.ugcDeclare(new WxMaCodeSubmitAuditUgcDeclare()
|
||||
.setAuditDesc("blablabla")
|
||||
.setHasAuditTeam(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;
|
||||
|
||||
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeSubmitAuditItem;
|
||||
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeSubmitAuditPreviewInfo;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
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.util.List;
|
||||
@ -22,13 +22,13 @@ public class WxOpenMaSubmitAuditMessage implements Serializable {
|
||||
* 提交审核项的一个列表(至少填写1项,至多填写5项)
|
||||
*/
|
||||
@SerializedName("item_list")
|
||||
private List<WxOpenMaSubmitAudit> itemList;
|
||||
private List<WxMaCodeSubmitAuditItem> itemList;
|
||||
|
||||
/**
|
||||
* 预览信息(小程序页面截图和操作录屏)
|
||||
*/
|
||||
@SerializedName("preview_info")
|
||||
private WxOpenMaPreviewInfo previewInfo;
|
||||
private WxMaCodeSubmitAuditPreviewInfo previewInfo;
|
||||
|
||||
/**
|
||||
* 小程序版本说明和功能解释
|
||||
@ -53,4 +53,10 @@ public class WxOpenMaSubmitAuditMessage implements Serializable {
|
||||
*/
|
||||
@SerializedName("privacy_api_not_use")
|
||||
private Boolean privacyApiNotUse;
|
||||
|
||||
/**
|
||||
* 订单中心path
|
||||
*/
|
||||
@SerializedName("order_path")
|
||||
private String orderPath;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user