master
chaiyapeng 2024-08-30 09:55:56 +08:00
parent 3417b5a39e
commit 2bc6d35edf
2 changed files with 10 additions and 9 deletions

View File

@ -16,10 +16,9 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
public class Birthday {
private String year;
private String month;
private String day;
private String hour;
private String years;
private String months;
private String days;
private String animal;
private String imonthcn;
private String idaycn;

View File

@ -39,6 +39,7 @@ public class BirthdayHelper {
map.put("day", birthdayRes.getDay());
map.put("hour", birthdayRes.getHour());
String urlencode = urlencode(map);
Birthday birthday1 = new Birthday();
String s = doGet(API_URL, urlencode);
try {
@ -47,9 +48,10 @@ public class BirthdayHelper {
if (error_code == 0){
System.out.println("调用接口成功");
JSONObject result = jsonObject.getJSONObject("result");
birthday1.setYear(result.getString("year"));
birthday1.setMonth(result.getString("month"));
birthday1.setDay(result.getString("day"));
birthday1.setYears(result.getString("year"));
birthday1.setMonths(result.getString("month"));
birthday1.setDays(result.getString("day"));
birthday1.setAnimal(result.getString("Animal"));
birthday1.setImonthcn(result.getString("ImonthCn"));
birthday1.setIdaycn(result.getString("IDayCn"));