我正在努力让我的裸体领域工作。目前,它正在显示
@Test
public void test() {
String json = "{\n" + " \"List\":[\n" + " {\n" + " \"id\":1,\n" + " \"categoryName"
+ "\":\"Categories1\",\n"
+ " \"subCategories\":[\n" + " {\n" + " \"id\":1,\n"
+ " \"subCategoriesName\":\"lkjasdf\"\n" + " }\n" + " ]\n" + " },\n" + " {\n"
+ " \"id\":2,\n" + " \"categoryName\":\"Categories2\",\n" + " \"subCategories\":[\n"
+ " {\n" + " \"id\":2,\n" + " \"subCategoriesName\":\"lkjasdasdfasf\"\n"
+ " }\n" + " ]\n" + " }\n" + " ]\n" + "}";
Gson gson = new Gson();
CategoriesResponse gsonResponse = gson.fromJson(json, CategoriesResponse.class);
assertEquals(2, gsonResponse.categories.size());
}
public class Approach {
@SerializedName("categoryName") @Expose private String categoryName;
@SerializedName("subCategories") @Expose private List<SubCategories> subCategories;
public Approach(String categoryName, List<SubCategories> subCategories) {
this.categoryName = categoryName;
this.subCategories = subCategories;
}
}
public class SubCategories {
@SerializedName("id") @Expose private int id;
@SerializedName("subCategoriesName") @Expose private String subCategoriesName;
}
public class CategoriesResponse {
@SerializedName("List") @Expose private List<Approach> categories;
}
我阅读了this的答案以及答案。答案使我相信,如果我使用的是GoDaddy和Heroku,则我不能使用我的裸域。从裸域到全域的转发仅在HTTP网站上有效。我的意思是,谁还在使用HTTP?
解决此问题的最简单方法是什么?将我的域从GoDaddy移植到支持ANAME的另一台主机上?是否有不需要大量工作的选项?