Compare commits
11 Commits
v3.0.0-nat
...
v3.0.7-nat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cb7828acf | ||
|
|
2929e0d1c0 | ||
|
|
02f9c7afdf | ||
|
|
89ebf65b7d | ||
|
|
693939af54 | ||
| 2b9ec9e2be | |||
|
|
3352d7efc1 | ||
|
|
1118fa6b26 | ||
|
|
291e46921d | ||
|
|
740bc07a2b | ||
| cf29b08d02 |
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
11
.idea/.gitignore
generated
vendored
Normal file
11
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 已忽略包含查询文件的默认文件夹
|
||||||
|
/queries/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
/.idea/
|
||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
app: $APP_NAME
|
app: $APP_NAME
|
||||||
version: $APP_TAG
|
version: $APP_TAG
|
||||||
name: $APP_NAME
|
name: $APP_NAME
|
||||||
namespace: dl-proj #一定要写名称空间
|
namespace: default #一定要写名称空间
|
||||||
spec:
|
spec:
|
||||||
progressDeadlineSeconds: 600
|
progressDeadlineSeconds: 600
|
||||||
replicas: 1
|
replicas: 1
|
||||||
@@ -33,7 +33,7 @@ spec:
|
|||||||
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
|
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /test
|
path: /test
|
||||||
port: 9090
|
port: 13145
|
||||||
initialDelaySeconds: 10 # 延迟xx秒开始执行
|
initialDelaySeconds: 10 # 延迟xx秒开始执行
|
||||||
periodSeconds: 15 # 每隔15秒执行一次
|
periodSeconds: 15 # 每隔15秒执行一次
|
||||||
timeoutSeconds: 10 # 10秒未返回结果则超时
|
timeoutSeconds: 10 # 10秒未返回结果则超时
|
||||||
@@ -57,7 +57,7 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app: $APP_NAME
|
app: $APP_NAME
|
||||||
name: $APP_NAME
|
name: $APP_NAME
|
||||||
namespace: dl-proj
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
externalTrafficPolicy: Local
|
externalTrafficPolicy: Local
|
||||||
@@ -65,6 +65,6 @@ spec:
|
|||||||
- name: http
|
- name: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
port: 13145
|
port: 13145
|
||||||
nodePort: 13145
|
nodePort: 30045
|
||||||
selector:
|
selector:
|
||||||
app: $APP_NAME
|
app: $APP_NAME
|
||||||
13
pom.xml
13
pom.xml
@@ -32,7 +32,7 @@
|
|||||||
<java.version>25</java.version>
|
<java.version>25</java.version>
|
||||||
<maven.compiler.source>25</maven.compiler.source>
|
<maven.compiler.source>25</maven.compiler.source>
|
||||||
<maven.compiler.target>25</maven.compiler.target>
|
<maven.compiler.target>25</maven.compiler.target>
|
||||||
<fastjson.version>2.0.60</fastjson.version>
|
<!-- <fastjson.version>2.0.60</fastjson.version>-->
|
||||||
<openfeign.version>5.0.0</openfeign.version>
|
<openfeign.version>5.0.0</openfeign.version>
|
||||||
<hutool.version>5.8.25</hutool.version>
|
<hutool.version>5.8.25</hutool.version>
|
||||||
<docker.private.repository>registry.cn-chengdu.aliyuncs.com/bamanker</docker.private.repository>
|
<docker.private.repository>registry.cn-chengdu.aliyuncs.com/bamanker</docker.private.repository>
|
||||||
@@ -60,11 +60,16 @@
|
|||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
<version>${openfeign.version}</version>
|
<version>${openfeign.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 如果需要显式指定 Jackson 3 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>tools.jackson.core</groupId>
|
||||||
<artifactId>fastjson2</artifactId>
|
<artifactId>jackson-core</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.alibaba.fastjson2</groupId>-->
|
||||||
|
<!-- <artifactId>fastjson2</artifactId>-->
|
||||||
|
<!-- <version>${fastjson.version}</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @descriptions
|
||||||
|
* @author bamanker
|
||||||
|
* @date 2026/1/8 12:12
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class DailyLoveConfigure {
|
public class DailyLoveConfigure {
|
||||||
// public static String Access_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}";
|
// public static String Access_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}";
|
||||||
@@ -26,6 +32,7 @@ public class DailyLoveConfigure {
|
|||||||
public static String Color_bbir;
|
public static String Color_bbir;
|
||||||
public static String Color_cbir;
|
public static String Color_cbir;
|
||||||
public static String Color_loveDay;
|
public static String Color_loveDay;
|
||||||
|
public static String Color_weddingDay;
|
||||||
public static String Color_remark;
|
public static String Color_remark;
|
||||||
|
|
||||||
@Value("${wechat.color.tomorrow:null}")
|
@Value("${wechat.color.tomorrow:null}")
|
||||||
@@ -113,6 +120,11 @@ public class DailyLoveConfigure {
|
|||||||
Color_loveDay = color_loveDay;
|
Color_loveDay = color_loveDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Value("${wechat.color.weddingDay:null}")
|
||||||
|
public void setColor_weddingDay(String color_weddingDay) {
|
||||||
|
Color_loveDay = color_weddingDay;
|
||||||
|
}
|
||||||
|
|
||||||
@Value("${wechat.color.remark:null}")
|
@Value("${wechat.color.remark:null}")
|
||||||
public void setColor_remark(String color_remark) {
|
public void setColor_remark(String color_remark) {
|
||||||
Color_remark = color_remark;
|
Color_remark = color_remark;
|
||||||
@@ -182,28 +194,35 @@ public class DailyLoveConfigure {
|
|||||||
public static String Boy_Birthday;
|
public static String Boy_Birthday;
|
||||||
|
|
||||||
@Value("${DL.boy-birthday}")
|
@Value("${DL.boy-birthday}")
|
||||||
public void setBoyBirthday(String BoyBirthday) {
|
public void setBoyBirthday(String boyBirthday) {
|
||||||
Boy_Birthday = BoyBirthday;
|
Boy_Birthday = boyBirthday;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String Girl_Birthday;
|
public static String Girl_Birthday;
|
||||||
|
|
||||||
@Value("${DL.girl-birthday}")
|
@Value("${DL.girl-birthday}")
|
||||||
public void setGirlBirthday(String GirlBirthday) {
|
public void setGirlBirthday(String girlBirthday) {
|
||||||
Girl_Birthday = GirlBirthday;
|
Girl_Birthday = girlBirthday;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String Cat_Birthday;
|
public static String Cat_Birthday;
|
||||||
|
|
||||||
@Value("${DL.cat-birthday}")
|
@Value("${DL.cat-birthday}")
|
||||||
public void setCatBirthday(String CatBirthday) {
|
public void setCatBirthday(String catBirthday) {
|
||||||
Cat_Birthday = CatBirthday;
|
Cat_Birthday = catBirthday;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String Love_Day;
|
public static String Love_Day;
|
||||||
|
|
||||||
@Value("${DL.love-day}")
|
@Value("${DL.love-day}")
|
||||||
public void setLoveDay(String LoveDay) {
|
public void setLoveDay(String loveDay) {
|
||||||
Love_Day = LoveDay;
|
Love_Day = loveDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String Wedding_Day;
|
||||||
|
|
||||||
|
@Value("${DL.wedding-day}")
|
||||||
|
public void setWeddingDay(String weddingDay) {
|
||||||
|
Wedding_Day = weddingDay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,34 +2,45 @@ package com.bamanker.dailylove.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.date.ChineseDate;
|
import cn.hutool.core.date.ChineseDate;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.bamanker.dailylove.config.DailyLoveConfigure;
|
import com.bamanker.dailylove.config.DailyLoveConfigure;
|
||||||
import com.bamanker.dailylove.domain.*;
|
import com.bamanker.dailylove.domain.*;
|
||||||
import com.bamanker.dailylove.service.DataRemoteClient;
|
import com.bamanker.dailylove.service.DataRemoteClient;
|
||||||
import com.bamanker.dailylove.service.WechatRequestClient;
|
import com.bamanker.dailylove.service.WechatRequestClient;
|
||||||
import com.bamanker.dailylove.utils.DataUtils;
|
import com.bamanker.dailylove.utils.DataUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import tools.jackson.databind.JsonNode;
|
||||||
|
import tools.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bamanker
|
||||||
|
* @descriptions
|
||||||
|
* @date 2026/1/8 12:04
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
public class PushDailyController {
|
public class PushDailyController {
|
||||||
|
|
||||||
|
final
|
||||||
|
ObjectMapper mapper;
|
||||||
|
|
||||||
final
|
final
|
||||||
DataRemoteClient dataRemoteClient;
|
DataRemoteClient dataRemoteClient;
|
||||||
|
|
||||||
final
|
final
|
||||||
WechatRequestClient wechatRequestClient;
|
WechatRequestClient wechatRequestClient;
|
||||||
|
|
||||||
public PushDailyController(DataRemoteClient dataRemoteClient, WechatRequestClient wechatRequestClient) {
|
public PushDailyController(DataRemoteClient dataRemoteClient, WechatRequestClient wechatRequestClient, ObjectMapper mapper) {
|
||||||
this.dataRemoteClient = dataRemoteClient;
|
this.dataRemoteClient = dataRemoteClient;
|
||||||
this.wechatRequestClient = wechatRequestClient;
|
this.wechatRequestClient = wechatRequestClient;
|
||||||
|
this.mapper = mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +49,7 @@ public class PushDailyController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/pushNight")
|
@GetMapping("/pushNight")
|
||||||
|
@RegisterReflectionForBinding(Weather.class)
|
||||||
public String pushNight() {
|
public String pushNight() {
|
||||||
|
|
||||||
ResultVo resultVo = ResultVo.initializeResultVo(DailyLoveConfigure.Open_ID,
|
ResultVo resultVo = ResultVo.initializeResultVo(DailyLoveConfigure.Open_ID,
|
||||||
@@ -49,9 +61,9 @@ public class PushDailyController {
|
|||||||
param1.setCity(DailyLoveConfigure.City_ID);
|
param1.setCity(DailyLoveConfigure.City_ID);
|
||||||
param1.setType("7");
|
param1.setType("7");
|
||||||
String weatherResp = dataRemoteClient.getWeather(param1);
|
String weatherResp = dataRemoteClient.getWeather(param1);
|
||||||
JSONObject weatherJson = JSONObject.parseObject(weatherResp).getJSONArray("result").getJSONObject(0).getJSONArray("list").getJSONObject(1);
|
JsonNode weatherJson = mapper.readTree(weatherResp).get("result").get("list").get(1);
|
||||||
String city = JSONObject.parseObject(weatherResp).getJSONArray("result").getJSONObject(0).getString("area");
|
String city = mapper.readTree(weatherResp).get("result").get("area").asString();
|
||||||
Weather weather = weatherJson.toJavaObject(Weather.class);
|
Weather weather = mapper.treeToValue(weatherJson, Weather.class);
|
||||||
|
|
||||||
resultVo.setAttribute("tomorrow", new DataItem(weather.getDate() + " " + weather.getWeek(), DailyLoveConfigure.Color_tomorrow));
|
resultVo.setAttribute("tomorrow", new DataItem(weather.getDate() + " " + weather.getWeek(), DailyLoveConfigure.Color_tomorrow));
|
||||||
resultVo.setAttribute("city", new DataItem(city, DailyLoveConfigure.Color_city));
|
resultVo.setAttribute("city", new DataItem(city, DailyLoveConfigure.Color_city));
|
||||||
@@ -65,15 +77,15 @@ public class PushDailyController {
|
|||||||
param2.setKey(DailyLoveConfigure.TianXin_Key);
|
param2.setKey(DailyLoveConfigure.TianXin_Key);
|
||||||
|
|
||||||
String tipsResp = dataRemoteClient.getTips(param2);
|
String tipsResp = dataRemoteClient.getTips(param2);
|
||||||
String tips = JSONObject.parseObject(tipsResp).getJSONArray("result").getJSONObject(0).getString("content");
|
String tips = mapper.readTree(tipsResp).get("result").get("content").asString();
|
||||||
resultVo.setAttribute("tips", new DataItem(tips, DailyLoveConfigure.Color_tips));
|
resultVo.setAttribute("tips", new DataItem(tips, DailyLoveConfigure.Color_tips));
|
||||||
|
|
||||||
String nightResp = dataRemoteClient.getNight(param2);
|
String nightResp = dataRemoteClient.getNight(param2);
|
||||||
String night = JSONObject.parseObject(nightResp).getJSONArray("result").getJSONObject(0).getString("content");
|
String night = mapper.readTree(nightResp).get("result").get("content").asString();
|
||||||
resultVo.setAttribute("night", new DataItem(night, DailyLoveConfigure.Color_night));
|
resultVo.setAttribute("night", new DataItem(night, DailyLoveConfigure.Color_night));
|
||||||
|
|
||||||
String rainbowResp = dataRemoteClient.getRainbow(param2);
|
String rainbowResp = dataRemoteClient.getRainbow(param2);
|
||||||
String rainbow = JSONObject.parseObject(rainbowResp).getJSONArray("result").getJSONObject(0).getString("content");
|
String rainbow = mapper.readTree(rainbowResp).get("result").get("content").asString();
|
||||||
resultVo.setAttribute("rainbow", new DataItem(rainbow, DailyLoveConfigure.Color_dailyCn));
|
resultVo.setAttribute("rainbow", new DataItem(rainbow, DailyLoveConfigure.Color_dailyCn));
|
||||||
|
|
||||||
// String englishResp = dataRemoteClient.getDailyEnglish(param2);
|
// String englishResp = dataRemoteClient.getDailyEnglish(param2);
|
||||||
@@ -89,47 +101,53 @@ public class PushDailyController {
|
|||||||
|
|
||||||
|
|
||||||
int girlBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Girl_Birthday);
|
int girlBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Girl_Birthday);
|
||||||
log.debug("gbir_day:{}", girlBirthdays);
|
log.info("gbir_days:{}", girlBirthdays);
|
||||||
resultVo.setAttribute("gbir_day", new DataItem(girlBirthdays - 1 + "", DailyLoveConfigure.Color_gbir));
|
resultVo.setAttribute("gbir_day", new DataItem(girlBirthdays - 1 + "", DailyLoveConfigure.Color_gbir));
|
||||||
|
|
||||||
int boyBirthdays = DataUtils.getChineseBirthdays(DailyLoveConfigure.Boy_Birthday);
|
int boyBirthdays = DataUtils.getChineseBirthdays(DailyLoveConfigure.Boy_Birthday);
|
||||||
log.debug("bbir_day:{}", boyBirthdays);
|
log.info("bbir_days:{}", boyBirthdays);
|
||||||
resultVo.setAttribute("bbir_day", new DataItem(boyBirthdays - 1 + "", DailyLoveConfigure.Color_bbir));
|
resultVo.setAttribute("bbir_day", new DataItem(boyBirthdays - 1 + "", DailyLoveConfigure.Color_bbir));
|
||||||
|
|
||||||
int catBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Cat_Birthday);
|
int catBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Cat_Birthday);
|
||||||
log.debug("cbir_day:{}", catBirthdays);
|
log.info("cbir_days:{}", catBirthdays);
|
||||||
resultVo.setAttribute("cbir_day", new DataItem(catBirthdays - 1 + "", DailyLoveConfigure.Color_cbir));
|
resultVo.setAttribute("cbir_day", new DataItem(catBirthdays - 1 + "", DailyLoveConfigure.Color_cbir));
|
||||||
|
|
||||||
String words = "普通的一天";
|
String words = "普通的一天";
|
||||||
|
|
||||||
if (DataUtils.getBirthdays(DailyLoveConfigure.Love_Day) == 1) {
|
if (DataUtils.getBirthdays(DailyLoveConfigure.Love_Day) == 1) {
|
||||||
words = "明天是恋爱周年纪念日!永远爱你~mua";
|
words = "明天是恋爱周年纪念日!永远爱你~mua";
|
||||||
} else if ((DataUtils.getLoveDays(DailyLoveConfigure.Love_Day)) % 100 == 99) {
|
} else if ((DataUtils.getDayDiff(DailyLoveConfigure.Love_Day)) % 100 == 99) {
|
||||||
words = "明天是恋爱百日纪念日!提前庆祝哦~";
|
words = "明天是恋爱百日纪念日!提前庆祝哦~";
|
||||||
|
} else if (DataUtils.getBirthdays(DailyLoveConfigure.Wedding_Day) == 1) {
|
||||||
|
words = "明天是结婚周年纪念日!提前庆祝哦~";
|
||||||
} else if (girlBirthdays == 1) {
|
} else if (girlBirthdays == 1) {
|
||||||
words = "明天是lili大宝贝的生日啦";
|
words = "明天是lili大宝贝的生日啦";
|
||||||
} else if (boyBirthdays == 1) {
|
} else if (boyBirthdays == 1) {
|
||||||
words = "明天是ss的生日!别忘了哦~";
|
words = "明天是菘菘的生日!别忘了哦~";
|
||||||
} else if (catBirthdays == 1) {
|
} else if (catBirthdays == 1) {
|
||||||
words = "明天是小离谱的生日!别忘了小鱼干!";
|
words = "明天是小离谱的生日!别忘了小鱼干!";
|
||||||
}
|
}
|
||||||
|
|
||||||
resultVo.setAttribute("words", new DataItem(words, DailyLoveConfigure.Color_remark));
|
resultVo.setAttribute("words", new DataItem(words, DailyLoveConfigure.Color_remark));
|
||||||
|
|
||||||
int loveDays = DataUtils.getLoveDays(DailyLoveConfigure.Love_Day);
|
int loveDays = DataUtils.getDayDiff(DailyLoveConfigure.Love_Day);
|
||||||
log.debug("love_day:{}", loveDays);
|
log.info("love_days:{}", loveDays);
|
||||||
resultVo.setAttribute("love_day", new DataItem(loveDays + 1 + "", DailyLoveConfigure.Color_loveDay));
|
resultVo.setAttribute("love_day", new DataItem(loveDays + 1 + "", DailyLoveConfigure.Color_loveDay));
|
||||||
|
|
||||||
log.debug("resultVo:{}", resultVo);
|
int weddingDays = DataUtils.getDayDiff(DailyLoveConfigure.Wedding_Day);
|
||||||
|
log.info("wedding_days:{}", weddingDays);
|
||||||
|
resultVo.setAttribute("wedding_day", new DataItem(weddingDays + 1 + "", DailyLoveConfigure.Color_weddingDay));
|
||||||
|
|
||||||
|
log.info("resultVo:{}", resultVo);
|
||||||
WechatTokenParam wechatTokenParam = new WechatTokenParam();
|
WechatTokenParam wechatTokenParam = new WechatTokenParam();
|
||||||
wechatTokenParam.setAppid(DailyLoveConfigure.App_ID);
|
wechatTokenParam.setAppid(DailyLoveConfigure.App_ID);
|
||||||
wechatTokenParam.setSecret(DailyLoveConfigure.App_Secret);
|
wechatTokenParam.setSecret(DailyLoveConfigure.App_Secret);
|
||||||
|
|
||||||
String accessTokenResp = wechatRequestClient.getAccessToken(wechatTokenParam);
|
String accessTokenResp = wechatRequestClient.getAccessToken(wechatTokenParam);
|
||||||
log.debug("accessTokenJson:{}", accessTokenResp);
|
log.info("accessTokenJson:{}", accessTokenResp);
|
||||||
String token = JSONObject.parseObject(accessTokenResp).getString("access_token");
|
String token = mapper.readTree(accessTokenResp).get("access_token").asString();
|
||||||
String responseStr = wechatRequestClient.sendMsg(resultVo, token);
|
// String token1 = JSONObject.parseObject(accessTokenResp).getString("access_token");
|
||||||
return responseStr;
|
return wechatRequestClient.sendMsg(resultVo, token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,6 +155,7 @@ public class PushDailyController {
|
|||||||
* 推送早安
|
* 推送早安
|
||||||
*/
|
*/
|
||||||
@GetMapping("/pushMorning")
|
@GetMapping("/pushMorning")
|
||||||
|
@RegisterReflectionForBinding(Weather.class)
|
||||||
public String pushMorning() {
|
public String pushMorning() {
|
||||||
|
|
||||||
TianXinReqParam param1 = new TianXinReqParam();
|
TianXinReqParam param1 = new TianXinReqParam();
|
||||||
@@ -144,9 +163,10 @@ public class PushDailyController {
|
|||||||
param1.setCity(DailyLoveConfigure.City_ID);
|
param1.setCity(DailyLoveConfigure.City_ID);
|
||||||
param1.setType("1");
|
param1.setType("1");
|
||||||
String weatherResp = dataRemoteClient.getWeather(param1);
|
String weatherResp = dataRemoteClient.getWeather(param1);
|
||||||
|
JsonNode weatherJson = mapper.readTree(weatherResp).get("result");
|
||||||
|
Weather weather = mapper.treeToValue(weatherJson, Weather.class);
|
||||||
|
|
||||||
Weather weather = JSONObject.parseObject(weatherResp).getJSONArray("result").getJSONObject(0).toJavaObject(Weather.class);
|
// Weather weather1 = JSONObject.parseObject(weatherResp).getJSONArray("result").getJSONObject(0).toJavaObject(Weather.class);
|
||||||
|
|
||||||
|
|
||||||
ResultVo resultVo = ResultVo.initializeResultVo(DailyLoveConfigure.Open_ID,
|
ResultVo resultVo = ResultVo.initializeResultVo(DailyLoveConfigure.Open_ID,
|
||||||
DailyLoveConfigure.Template_ID_Morning,
|
DailyLoveConfigure.Template_ID_Morning,
|
||||||
@@ -168,11 +188,13 @@ public class PushDailyController {
|
|||||||
// resultVo.setAttribute("tips", new DataItem(tips, DailyLoveConfigure.Color_tips));
|
// resultVo.setAttribute("tips", new DataItem(tips, DailyLoveConfigure.Color_tips));
|
||||||
|
|
||||||
String morningResp = dataRemoteClient.getMorning(param2);
|
String morningResp = dataRemoteClient.getMorning(param2);
|
||||||
String morning = JSONObject.parseObject(morningResp).getJSONArray("result").getJSONObject(0).getString("content");
|
String morning = mapper.readTree(morningResp).get("result").get("content").asString();
|
||||||
|
// String morning1 = JSONObject.parseObject(morningResp).getJSONArray("result").getJSONObject(0).getString("content");
|
||||||
resultVo.setAttribute("morning", new DataItem(morning, DailyLoveConfigure.Color_morning));
|
resultVo.setAttribute("morning", new DataItem(morning, DailyLoveConfigure.Color_morning));
|
||||||
|
|
||||||
String rainbowResp = dataRemoteClient.getRainbow(param2);
|
String rainbowResp = dataRemoteClient.getRainbow(param2);
|
||||||
String rainbow = JSONObject.parseObject(rainbowResp).getJSONArray("result").getJSONObject(0).getString("content");
|
String rainbow = mapper.readTree(rainbowResp).get("result").get("content").asString();
|
||||||
|
// String rainbow1 = JSONObject.parseObject(rainbowResp).getJSONArray("result").getJSONObject(0).getString("content");
|
||||||
resultVo.setAttribute("rainbow", new DataItem(rainbow, DailyLoveConfigure.Color_dailyCn));
|
resultVo.setAttribute("rainbow", new DataItem(rainbow, DailyLoveConfigure.Color_dailyCn));
|
||||||
|
|
||||||
// String englishResp = dataRemoteClient.getDailyEnglish(param2);
|
// String englishResp = dataRemoteClient.getDailyEnglish(param2);
|
||||||
@@ -190,37 +212,43 @@ public class PushDailyController {
|
|||||||
|
|
||||||
|
|
||||||
int girlBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Girl_Birthday);
|
int girlBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Girl_Birthday);
|
||||||
log.debug("gbir_day:{}", girlBirthdays);
|
log.info("gbir_days:{}", girlBirthdays);
|
||||||
resultVo.setAttribute("gbir_day", new DataItem(girlBirthdays + "", DailyLoveConfigure.Color_gbir));
|
resultVo.setAttribute("gbir_day", new DataItem(girlBirthdays + "", DailyLoveConfigure.Color_gbir));
|
||||||
|
|
||||||
int boyBirthdays = DataUtils.getChineseBirthdays(DailyLoveConfigure.Boy_Birthday);
|
int boyBirthdays = DataUtils.getChineseBirthdays(DailyLoveConfigure.Boy_Birthday);
|
||||||
log.debug("bbir_day:{}", boyBirthdays);
|
log.info("bbir_days:{}", boyBirthdays);
|
||||||
resultVo.setAttribute("bbir_day", new DataItem(boyBirthdays + "", DailyLoveConfigure.Color_bbir));
|
resultVo.setAttribute("bbir_day", new DataItem(boyBirthdays + "", DailyLoveConfigure.Color_bbir));
|
||||||
|
|
||||||
int catBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Cat_Birthday);
|
int catBirthdays = DataUtils.getBirthdays(DailyLoveConfigure.Cat_Birthday);
|
||||||
log.debug("cbir_day:{}", catBirthdays);
|
log.info("cbir_days:{}", catBirthdays);
|
||||||
resultVo.setAttribute("cbir_day", new DataItem(catBirthdays + "", DailyLoveConfigure.Color_cbir));
|
resultVo.setAttribute("cbir_day", new DataItem(catBirthdays + "", DailyLoveConfigure.Color_cbir));
|
||||||
|
|
||||||
String words = "普通的一天";
|
String words = "普通的一天";
|
||||||
|
|
||||||
if (DataUtils.getBirthdays(DailyLoveConfigure.Love_Day) == 0) {
|
if (DataUtils.getBirthdays(DailyLoveConfigure.Love_Day) == 0) {
|
||||||
words = "今天是恋爱周年纪念日!永远爱你~mua";
|
words = "今天是恋爱周年纪念日!永远爱你~mua";
|
||||||
} else if ((DataUtils.getLoveDays(DailyLoveConfigure.Love_Day)) % 100 == 0) {
|
} else if ((DataUtils.getDayDiff(DailyLoveConfigure.Love_Day)) % 100 == 0) {
|
||||||
words = "今天是恋爱百日纪念日!永远爱你~";
|
words = "今天是恋爱百日纪念日!永远爱你~";
|
||||||
|
} else if (DataUtils.getBirthdays(DailyLoveConfigure.Wedding_Day) == 0) {
|
||||||
|
words = "今天是结婚周年纪念日!永远爱你~";
|
||||||
} else if (girlBirthdays == 0) {
|
} else if (girlBirthdays == 0) {
|
||||||
words = "今天是lili宝贝的生日!生日快乐哟~";
|
words = "今天是lili宝贝的生日!生日快乐哟~";
|
||||||
} else if (boyBirthdays == 0) {
|
} else if (boyBirthdays == 0) {
|
||||||
words = "今天是ss的生日!别忘了好好爱他~";
|
words = "今天是菘菘的生日!别忘了好好爱他~";
|
||||||
} else if (catBirthdays == 0) {
|
} else if (catBirthdays == 0) {
|
||||||
words = "今天是小离谱的生日!别忘了小鱼干!";
|
words = "今天是小离谱的生日!别忘了小鱼干!";
|
||||||
}
|
}
|
||||||
|
|
||||||
resultVo.setAttribute("words", new DataItem(words, DailyLoveConfigure.Color_remark));
|
resultVo.setAttribute("words", new DataItem(words, DailyLoveConfigure.Color_remark));
|
||||||
|
|
||||||
int loveDays = DataUtils.getLoveDays(DailyLoveConfigure.Love_Day);
|
int loveDays = DataUtils.getDayDiff(DailyLoveConfigure.Love_Day);
|
||||||
log.debug("love_day:{}", loveDays);
|
log.info("love_days:{}", loveDays);
|
||||||
resultVo.setAttribute("love_day", new DataItem(loveDays + "", DailyLoveConfigure.Color_loveDay));
|
resultVo.setAttribute("love_day", new DataItem(loveDays + "", DailyLoveConfigure.Color_loveDay));
|
||||||
|
|
||||||
|
int weddingDays = DataUtils.getDayDiff(DailyLoveConfigure.Wedding_Day);
|
||||||
|
log.info("wedding_days:{}", weddingDays);
|
||||||
|
resultVo.setAttribute("wedding_day", new DataItem(weddingDays + "", DailyLoveConfigure.Color_weddingDay));
|
||||||
|
|
||||||
log.debug("resultVo:{}", resultVo);
|
log.debug("resultVo:{}", resultVo);
|
||||||
WechatTokenParam wechatTokenParam = new WechatTokenParam();
|
WechatTokenParam wechatTokenParam = new WechatTokenParam();
|
||||||
wechatTokenParam.setAppid(DailyLoveConfigure.App_ID);
|
wechatTokenParam.setAppid(DailyLoveConfigure.App_ID);
|
||||||
@@ -228,9 +256,9 @@ public class PushDailyController {
|
|||||||
|
|
||||||
String accessTokenResp = wechatRequestClient.getAccessToken(wechatTokenParam);
|
String accessTokenResp = wechatRequestClient.getAccessToken(wechatTokenParam);
|
||||||
log.debug("accessTokenJson:{}", accessTokenResp);
|
log.debug("accessTokenJson:{}", accessTokenResp);
|
||||||
String token = JSONObject.parseObject(accessTokenResp).getString("access_token");
|
String token = mapper.readTree(accessTokenResp).get("access_token").asString();
|
||||||
String responseStr = wechatRequestClient.sendMsg(resultVo, token);
|
// String token1 = JSONObject.parseObject(accessTokenResp).getString("access_token");
|
||||||
return responseStr;
|
return wechatRequestClient.sendMsg(resultVo, token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,9 +268,12 @@ public class PushDailyController {
|
|||||||
* @param responseStr
|
* @param responseStr
|
||||||
*/
|
*/
|
||||||
private void printPushLog(String responseStr) {
|
private void printPushLog(String responseStr) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(responseStr);
|
JsonNode jsonNode = mapper.readTree(responseStr);
|
||||||
String msgCode = jsonObject.getString("errcode");
|
String msgCode = jsonNode.get("errcode").asString();
|
||||||
String msgContent = jsonObject.getString("errmsg");
|
String msgContent = jsonNode.get("errmsg").asString();
|
||||||
|
// JSONObject jsonObject = JSONObject.parseObject(responseStr);
|
||||||
|
// String msgCode1 = jsonObject.getString("errcode");
|
||||||
|
// String msgContent1 = jsonObject.getString("errmsg");
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
System.out.println("[ " + dateFormat.format(new Date()) + " ] : messageCode=" + msgCode + ",messageContent=" + msgContent);
|
System.out.println("[ " + dateFormat.format(new Date()) + " ] : messageCode=" + msgCode + ",messageContent=" + msgContent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import org.bouncycastle.util.Strings;
|
|||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.time.temporal.Temporal;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@ public class DataUtils {
|
|||||||
Calendar dateToday = Calendar.getInstance();
|
Calendar dateToday = Calendar.getInstance();
|
||||||
int todayYear = dateToday.get(Calendar.YEAR);
|
int todayYear = dateToday.get(Calendar.YEAR);
|
||||||
//把生日的年改为今年,方便计算
|
//把生日的年改为今年,方便计算
|
||||||
ChineseDate chineseDate = new ChineseDate(todayYear, chineseMonth, chineseDay,false);
|
ChineseDate chineseDate = new ChineseDate(todayYear, chineseMonth, chineseDay, false);
|
||||||
//农历日期对应的阳历日期
|
//农历日期对应的阳历日期
|
||||||
int gregorianDay = chineseDate.getGregorianDay();
|
int gregorianDay = chineseDate.getGregorianDay();
|
||||||
//计算时间差
|
//计算时间差
|
||||||
@@ -121,22 +124,36 @@ public class DataUtils {
|
|||||||
return days;
|
return days;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 计算恋爱天数 days
|
// * 计算恋爱天数 days
|
||||||
*
|
// *
|
||||||
* @param loveday
|
// * @param loveDay
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public static int getLoveDays(String loveday) {
|
// public static int getLoveDays(String loveDay) {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
int days = 0;
|
// int days = 0;
|
||||||
try {
|
// try {
|
||||||
long time = System.currentTimeMillis() - dateFormat.parse(loveday).getTime();
|
// long time = System.currentTimeMillis() - dateFormat.parse(loveDay).getTime();
|
||||||
days = (int) (time / (24 * 60 * 60 * 1000));
|
// days = (int) (time / (24 * 60 * 60 * 1000));
|
||||||
|
//
|
||||||
|
// } catch (ParseException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// return days;
|
||||||
|
// }
|
||||||
|
|
||||||
} catch (ParseException e) {
|
/**
|
||||||
e.printStackTrace();
|
* @param startDay
|
||||||
}
|
* @return int
|
||||||
return days;
|
* @descriptions 计算日期茶 days
|
||||||
|
* @author bamanker
|
||||||
|
* @date 2026/1/8 12:38
|
||||||
|
*/
|
||||||
|
public static int getDayDiff(String startDay) {
|
||||||
|
|
||||||
|
LocalDate dateNow = LocalDate.now();
|
||||||
|
LocalDate dateStart = LocalDate.parse(startDay);
|
||||||
|
return (int) ChronoUnit.DAYS.between(dateStart, dateNow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,15 +15,16 @@ DL:
|
|||||||
boy-birthday: 1995-3-30
|
boy-birthday: 1995-3-30
|
||||||
love-day: 2022-07-16
|
love-day: 2022-07-16
|
||||||
cat-birthday: 2022-10-23
|
cat-birthday: 2022-10-23
|
||||||
|
wedding-day: 2025-10-08
|
||||||
|
|
||||||
wechat:
|
wechat:
|
||||||
app-id: wxba68702957f8b93e
|
app-id: wxba68702957f8b93e
|
||||||
app-secret: 834078bb149409bfca4fe693ea7c4c1c
|
app-secret: 834078bb149409bfca4fe693ea7c4c1c
|
||||||
#ME: oo5bL6bK_4TC0tb-Wa5oiugTPVeQ
|
# ME: oo5bL6bK_4TC0tb-Wa5oiugTPVeQ
|
||||||
#LILI: oo5bL6QafHJa9zQNYKS0fIhFC0zM
|
#LILI: oo5bL6QafHJa9zQNYKS0fIhFC0zM
|
||||||
open-id: oo5bL6QafHJa9zQNYKS0fIhFC0zM
|
open-id: oo5bL6QafHJa9zQNYKS0fIhFC0zM
|
||||||
template-id-morning: 1yx1fahCs923nOmMh0_KLWN0nXGKd8_pHQrfpdMblrQ
|
template-id-morning: dWNAL-ZOzpBhnByFoTamt9DlJQYLB5z3ldKLvQstyU4
|
||||||
template-id-night: QG-5NBX-jip46ulGVsaE3Uhl30GUxvNmtKOxwMHFkx0
|
template-id-night: oraLiXC-8740stYc1a7mpzUFHiAIRaM3JikqibZ2grE
|
||||||
|
|
||||||
color:
|
color:
|
||||||
now: '#99CCCC'
|
now: '#99CCCC'
|
||||||
@@ -39,6 +40,7 @@ wechat:
|
|||||||
bbir: '#FF3399'
|
bbir: '#FF3399'
|
||||||
cbir: '#FF3399'
|
cbir: '#FF3399'
|
||||||
loveDay: '#FF3399'
|
loveDay: '#FF3399'
|
||||||
|
weddingDay: '#FF3399'
|
||||||
remark: '#FF6666'
|
remark: '#FF6666'
|
||||||
city: ""
|
city: ""
|
||||||
tips: ""
|
tips: ""
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
package com.bamanker.dailylove;
|
package com.bamanker.dailylove;
|
||||||
|
|
||||||
import cn.hutool.core.date.ChineseDate;
|
|
||||||
import cn.hutool.core.date.DateUnit;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.bamanker.dailylove.config.DailyLoveConfigure;
|
import com.bamanker.dailylove.config.DailyLoveConfigure;
|
||||||
|
import com.bamanker.dailylove.domain.DataItem;
|
||||||
import com.bamanker.dailylove.domain.TianXinReqParam;
|
import com.bamanker.dailylove.domain.TianXinReqParam;
|
||||||
import com.bamanker.dailylove.domain.Weather;
|
import com.bamanker.dailylove.domain.Weather;
|
||||||
import com.bamanker.dailylove.service.DataRemoteClient;
|
import com.bamanker.dailylove.service.DataRemoteClient;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import com.bamanker.dailylove.utils.DataUtils;
|
||||||
import org.bouncycastle.util.Strings;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import java.text.ParseException;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import java.text.SimpleDateFormat;
|
import org.junit.jupiter.api.Test;
|
||||||
import java.util.Calendar;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import java.util.Date;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import tools.jackson.databind.JsonNode;
|
||||||
import static com.bamanker.dailylove.utils.DataUtils.getBirthdays;
|
import tools.jackson.databind.ObjectMapper;
|
||||||
|
import com.bamanker.dailylove.domain.*;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -28,6 +22,10 @@ class DailyLoveApplicationTests {
|
|||||||
// @Resource
|
// @Resource
|
||||||
// DataRemoteClient dataRemoteClient;
|
// DataRemoteClient dataRemoteClient;
|
||||||
//
|
//
|
||||||
|
// @Autowired
|
||||||
|
// ObjectMapper mapper;
|
||||||
|
|
||||||
|
//
|
||||||
// String remark = "❤";
|
// String remark = "❤";
|
||||||
//
|
//
|
||||||
// @Test
|
// @Test
|
||||||
@@ -106,30 +104,67 @@ class DailyLoveApplicationTests {
|
|||||||
//
|
//
|
||||||
// @Test
|
// @Test
|
||||||
// void test2() {
|
// void test2() {
|
||||||
|
|
||||||
|
// ResultVo resultVo = ResultVo.initializeResultVo(DailyLoveConfigure.Open_ID,
|
||||||
|
// DailyLoveConfigure.Template_ID_Night,
|
||||||
|
// DailyLoveConfigure.Color_Top);
|
||||||
//
|
//
|
||||||
// TianXinReqParam param1 = new TianXinReqParam();
|
// TianXinReqParam param1 = new TianXinReqParam();
|
||||||
// param1.setKey(DailyLoveConfigure.TianXin_Key);
|
// param1.setKey(DailyLoveConfigure.TianXin_Key);
|
||||||
// param1.setCity(DailyLoveConfigure.City_ID);
|
// param1.setCity(DailyLoveConfigure.City_ID);
|
||||||
// param1.setType("7");
|
// param1.setType("7");
|
||||||
// String weatherJson = dataRemoteClient.getWeather(param1);
|
// String weatherResp = dataRemoteClient.getWeather(param1);
|
||||||
// log.info("weather:{}", weatherJson);
|
//// log.info("weather:{}", weatherResp);
|
||||||
// JSONObject resWeather = JSONObject.parseObject(weatherJson);
|
// JsonNode weatherJson = mapper.readTree(weatherResp).get("result").get("list").get(1);
|
||||||
// JSONObject result = resWeather.getJSONArray("result").getJSONObject(0).getJSONArray("list").getJSONObject(2);
|
// System.out.println("-----------------------------");
|
||||||
|
// System.out.println(weatherJson);
|
||||||
|
// String city = mapper.readTree(weatherResp).get("result").get("area").asString();
|
||||||
|
// System.out.println("-----------------------------");
|
||||||
|
// System.out.println(city);
|
||||||
|
// Weather weather = mapper.treeToValue(weatherJson, Weather.class);
|
||||||
|
// System.out.println("-----------------------------");
|
||||||
|
// System.out.println(weather);
|
||||||
|
//
|
||||||
|
// resultVo.setAttribute("tomorrow", new DataItem(weather.getDate() + " " + weather.getWeek(), DailyLoveConfigure.Color_tomorrow));
|
||||||
|
// resultVo.setAttribute("city", new DataItem(city, DailyLoveConfigure.Color_city));
|
||||||
|
// resultVo.setAttribute("weather", new DataItem(weather.getWeather(), DailyLoveConfigure.Color_weather));
|
||||||
|
// resultVo.setAttribute("min_temperature", new DataItem(weather.getLowest(), DailyLoveConfigure.Color_minTem));
|
||||||
|
// resultVo.setAttribute("max_temperature", new DataItem(weather.getHighest(), DailyLoveConfigure.Color_maxTem));
|
||||||
|
// resultVo.setAttribute("quality", new DataItem(weather.getVis(), DailyLoveConfigure.Color_quality));
|
||||||
|
//
|
||||||
|
// System.out.println("-----------------------------");
|
||||||
|
// System.out.println(resultVo);
|
||||||
|
|
||||||
|
// TianXinReqParam param2 = new TianXinReqParam();
|
||||||
|
// param2.setKey(DailyLoveConfigure.TianXin_Key);
|
||||||
|
//
|
||||||
|
// String tipsResp = dataRemoteClient.getTips(param2);
|
||||||
|
// String tips = mapper.readTree(tipsResp).get("result").get("content").asString();
|
||||||
|
//
|
||||||
|
// System.out.println("-----------------------------");
|
||||||
|
// System.out.println(tips);
|
||||||
|
//
|
||||||
|
// TianXinReqParam param1 = new TianXinReqParam();
|
||||||
|
// param1.setKey(DailyLoveConfigure.TianXin_Key);
|
||||||
|
// param1.setCity(DailyLoveConfigure.City_ID);
|
||||||
|
// param1.setType("1");
|
||||||
|
// String weatherResp = dataRemoteClient.getWeather(param1);
|
||||||
|
// JsonNode weatherJson = mapper.readTree(weatherResp).get("result");
|
||||||
|
// Weather weather = mapper.treeToValue(weatherJson, Weather.class);
|
||||||
|
//
|
||||||
|
// System.out.println("-----------------------------");
|
||||||
|
// System.out.println(weather);
|
||||||
|
|
||||||
// log.info("----result----:{}", result);
|
// log.info("----result----:{}", result);
|
||||||
// Weather weather = result.toJavaObject(Weather.class);
|
|
||||||
// log.info("weather:{}", weather);
|
|
||||||
// ChineseDate chineseDate = new ChineseDate(DateUtil.parseDate(weather.getDate()));
|
//}
|
||||||
// System.out.println("--------------55555----------"+weather.getDate());
|
|
||||||
// System.out.println("------------------------"+chineseDate);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// @Test
|
// @Test
|
||||||
// void test1() {
|
// void test1() {
|
||||||
// int loveDays = getBirthdays("2023-05-14");
|
// int weddingDays = DataUtils.getWeddingDays("2025-10-08");
|
||||||
// log.info("-------------------------------{}", loveDays);
|
// log.info("wedding_days:{}", weddingDays);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static int getLoveDays(String loveday) {
|
// public static int getLoveDays(String loveday) {
|
||||||
|
|||||||
Reference in New Issue
Block a user