0.1.3:根据微信公众号模板消息最新规则修改了推送信息格式

This commit is contained in:
bamanker
2023-05-06 10:41:37 +08:00
parent b25acf6a09
commit 0537e743b5
4 changed files with 22 additions and 24 deletions

View File

@@ -10,7 +10,7 @@
</parent>
<groupId>com.bamanker</groupId>
<artifactId>dailyLove</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
<name>dailyLove</name>
<description>dailyLove</description>
<properties>

View File

@@ -7,9 +7,8 @@ import org.springframework.stereotype.Component;
@Component
@RefreshScope
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 Send_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={0}";
// public static String Send_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={0}";
public static String Color_quality;
public static String Color_morning;
public static String Color_chineseDate;
@@ -26,7 +25,6 @@ public class DailyLoveConfigure {
public static String Color_dailyEn;
public static String Color_gbir;
public static String Color_bbir;
public static String Color_cbir;
public static String Color_loveDay;
public static String Color_remark;

View File

@@ -94,21 +94,21 @@ public class PushDailyController {
log.debug("cbir_day:{}", catBirthdays);
resultVo.setAttribute("cbir_day", new DataItem(catBirthdays - 1 + "", DailyLoveConfigure.Color_cbir));
String remark = "";
String words = "普通的一天";
if (DataUtils.getBirthdays(DailyLoveConfigure.Love_Day) == 1) {
remark = "明天是恋爱周年纪念日!永远爱你~mua";
words = "明天是恋爱周年纪念日!永远爱你~mua";
} else if ((DataUtils.getLoveDays(DailyLoveConfigure.Love_Day)) % 100 == 1) {
remark = "明天是恋爱百日纪念日!提前庆祝哦~";
words = "明天是恋爱百日纪念日!提前庆祝哦~";
} else if (girlBirthdays == 1) {
remark = "明天是lili大宝贝的生日啦";
words = "明天是lili大宝贝的生日啦";
} else if (boyBirthdays == 1) {
remark = "明天是songsong的生日!别忘了哦~";
words = "明天是ss的生日!别忘了哦~";
} else if (catBirthdays == 1) {
remark = "明天是小离谱的生日!别忘了给她最爱的小鱼干!";
words = "明天是小离谱的生日!别忘了小鱼干!";
}
resultVo.setAttribute("remark", new DataItem(remark, DailyLoveConfigure.Color_remark));
resultVo.setAttribute("words", new DataItem(words, DailyLoveConfigure.Color_remark));
int loveDays = DataUtils.getLoveDays(DailyLoveConfigure.Love_Day);
log.debug("love_day:{}", loveDays);
@@ -140,7 +140,7 @@ public class PushDailyController {
String weatherResp = dataRemoteClient.getWeather(param1);
Weather weather = JSONObject.parseObject(weatherResp).getJSONArray("result").getJSONObject(0).toJavaObject(Weather.class);
;
ResultVo resultVo = ResultVo.initializeResultVo(DailyLoveConfigure.Open_ID,
DailyLoveConfigure.Template_ID_Morning,
@@ -157,9 +157,9 @@ public class PushDailyController {
TianXinReqParam param2 = new TianXinReqParam();
param2.setKey(DailyLoveConfigure.TianXin_Key);
String tipsResp = dataRemoteClient.getTips(param2);
String tips = JSONObject.parseObject(tipsResp).getJSONArray("result").getJSONObject(0).getString("content");
resultVo.setAttribute("tips", new DataItem(tips, DailyLoveConfigure.Color_tips));
// String tipsResp = dataRemoteClient.getTips(param2);
// String tips = JSONObject.parseObject(tipsResp).getJSONArray("result").getJSONObject(0).getString("content");
// resultVo.setAttribute("tips", new DataItem(tips, DailyLoveConfigure.Color_tips));
String morningResp = dataRemoteClient.getMorning(param2);
String morning = JSONObject.parseObject(morningResp).getJSONArray("result").getJSONObject(0).getString("content");
@@ -195,21 +195,21 @@ public class PushDailyController {
log.debug("cbir_day:{}", catBirthdays);
resultVo.setAttribute("cbir_day", new DataItem(catBirthdays + "", DailyLoveConfigure.Color_cbir));
String remark = "";
String words = "普通的一天";
if (DataUtils.getBirthdays(DailyLoveConfigure.Love_Day) == 0) {
remark = "今天是恋爱周年纪念日!永远爱你~mua";
words = "今天是恋爱周年纪念日!永远爱你~mua";
} else if ((DataUtils.getLoveDays(DailyLoveConfigure.Love_Day)) % 100 == 0) {
remark = "今天是恋爱百日纪念日!永远爱你~";
words = "今天是恋爱百日纪念日!永远爱你~";
} else if (girlBirthdays == 0) {
remark = "今天是lili宝贝的生日!生日快乐哟~";
words = "今天是lili宝贝的生日生日快乐哟~";
} else if (boyBirthdays == 0) {
remark = "今天是songsong的生日!别忘了好好爱他~";
words = "今天是ss的生日!别忘了好好爱他~";
} else if (catBirthdays == 0) {
remark = "今天是小离谱的生日!别忘了给她最爱的小鱼干!";
words = "今天是小离谱的生日!别忘了小鱼干!";
}
resultVo.setAttribute("remark", new DataItem(remark, DailyLoveConfigure.Color_remark));
resultVo.setAttribute("words", new DataItem(words, DailyLoveConfigure.Color_remark));
int loveDays = DataUtils.getLoveDays(DailyLoveConfigure.Love_Day);
log.debug("love_day:{}", loveDays);

View File

@@ -35,8 +35,8 @@ wechat:
#ME: oo5bL6bK_4TC0tb-Wa5oiugTPVeQ
#LILI: oo5bL6QafHJa9zQNYKS0fIhFC0zM
open-id: oo5bL6QafHJa9zQNYKS0fIhFC0zM
template-id-morning: 8y1RxNHUUA37MRzo7syW4B2Cl-SChiKkpYzA6EO4hG4
template-id-night: BaOHtLQ1o4wBS8Dcjrbd3KeGUawjjg-6_aC_9ZOlL3E
template-id-morning: 1yx1fahCs923nOmMh0_KLWN0nXGKd8_pHQrfpdMblrQ
template-id-night: QG-5NBX-jip46ulGVsaE3Uhl30GUxvNmtKOxwMHFkx0
color:
now: '#99CCCC'