🎨 小程序代码提交审核代码重构优化,删除重复定义类

This commit is contained in:
Binary Wang
2022-12-17 15:05:35 +08:00
parent e0a39c8d68
commit 901fceba27
11 changed files with 141 additions and 157 deletions

View File

@@ -39,7 +39,7 @@ public interface WxMaCodeService {
* @return List<WxMaCategory>
* @throws WxErrorException 获取失败时返回,具体错误码请看此接口的注释文档
*/
List<WxMaCategory> getCategory() throws WxErrorException;
List<WxMaCodeSubmitAuditItem> getCategory() throws WxErrorException;
/**
* 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用).

View File

@@ -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;