记得上下班打卡 | git大法好,push需谨慎

Commit 312a77c3 authored by sunyuntian's avatar sunyuntian

添加时间

parent 793f132c
......@@ -3,6 +3,7 @@ package com.liquidnet.service.sweet.vo;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
public class SweetMaoDengVo implements Serializable, Cloneable {
......@@ -28,6 +29,10 @@ public class SweetMaoDengVo implements Serializable, Cloneable {
* 生成图url
*/
private String imgUrl;
/**
* 创建时间
*/
private LocalDateTime createdAt;
private static final SweetMaoDengVo obj = new SweetMaoDengVo();
public static SweetMaoDengVo getNew() {
......
......@@ -7,6 +7,7 @@ CREATE TABLE `sweet_wechat_maodeng` (
`text_msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '猫名字',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '图片url',
`img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '生成的图',
`created_at` datetime NULL DEFAULT NULL,
PRIMARY KEY (`mid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
......
......@@ -72,7 +72,7 @@ public class MaoDengImageHandler implements WxMpMessageHandler {
picUrl = "https://img.zhengzai.tv/".concat(dto.getData().getOssPath());
}
}catch (Exception e){
e/
e.getMessage();
}
sweetMaoDengVo.setPicUrl(picUrl);
//活动已开启 持久化 redis
......
......@@ -113,6 +113,18 @@ public class TextMsgHandler implements WxMpMessageHandler {
.build();
return build;
}
if (content.length() > 8) {
return WxMpXmlOutMessage.TEXT().content("昵称要9个字以内~")
.fromUser(wxMessage.getToUser()).toUser(openId)
.build();
}
if (!shumeiUtil.checkText(openId, content)) {
return WxMpXmlOutMessage.TEXT().content("无法识别,换个昵称吧!(请勿使用表情等特殊字符)")
.fromUser(wxMessage.getToUser()).toUser(openId)
.build();
}
SweetMaoDengVo sweetMaoDengVo = SweetMaoDengVo.getNew();
sweetMaoDengVo.setUserId(openId);
sweetMaoDengVo.setTextMsg(content);
......
package com.liquidnet.service.sweet.service.impl;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
......@@ -11,10 +12,10 @@ import com.liquidnet.service.sweet.utils.QueueUtils;
import com.liquidnet.service.sweet.utils.WechatUsersRedisUtils;
import com.liquidnet.service.sweet.vo.SweetMaoDengVo;
import com.liquidnet.service.sweet.vo.SweetWechatUsersVo;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.LinkedList;
@Service
......@@ -28,6 +29,7 @@ public class SweetWechatMaoDengServiceImpl {
WechatMaConfigure maConfigure;
public ResponseDto addBuilderImg(String userId,String imgUrl){
LocalDateTime localDateTime = DateUtil.asLocalDateTime(DateUtil.now()); //生成创建时间
String maoId = IDGenerator.nextSnowId();
SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 1);
if (null == wechatUsers) {
......@@ -39,13 +41,14 @@ public class SweetWechatMaoDengServiceImpl {
}
String textMsg = sweetMaoDeng.getTextMsg();
String picUrl = sweetMaoDeng.getPicUrl();
sweetMaoDeng.setCreatedAt(localDateTime);
redisUtils.setSweetMaoDeng(sweetMaoDeng);
if (StringUtil.isNotEmpty(textMsg) && StringUtil.isNotEmpty(picUrl)){
//redis队列入库
LinkedList<String> sqls = CollectionUtil.linkedListString();
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("sweet_wechat_maodeng.insert"));
sqlsDataA.add(new Object[]{maoId, userId, textMsg, picUrl,imgUrl});
sqlsDataA.add(new Object[]{maoId, userId, textMsg, picUrl,imgUrl,localDateTime});
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_WECHAT_MAODENG_TEXT_INSERT.getKey(), SqlMapping.gets(sqls, sqlsDataA));
return ResponseDto.failure("请求成功");
}
......
......@@ -58,8 +58,7 @@ sweet_wechat_users.delete=DELETE FROM sweet_wechat_users WHERE union_id = ? and
sweet_strawberry_poster_user=INSERT INTO sweet_strawberry_poster(open_id,poster_id,union_id,nickname,city_name,city_code,custom_text,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?)
sweet_strawberry_poster_Musician=INSERT INTO sweet_strawberry_poster_lineup(lineup_id,poster_id,lineup_num,musician_name,created_at,updated_at) VALUES (?,?,?,?,?,?)
#---------------------------猫登天空--------------------------------
sweet_wechat_maodeng.insert=INSERT INTO sweet_wechat_maodeng(mao_id,user_id,text_msg,pic_url,img_url) VALUES (?,?,?,?,?)
sweet_wechat_maodeng.insert_img=UPDATE sweet_wechat_maodeng SET img_url=? WHERE user_id=? AND mao_id=?
sweet_wechat_maodeng.insert=INSERT INTO sweet_wechat_maodeng(mao_id,user_id,text_msg,pic_url,img_url,created_at) VALUES (?,?,?,?,?,?)
sweet_wechat_maodeng.text.update=UPDATE sweet_wechat_maodeng SET text_msg=? WHERE user_id=? AND mao_id=?
sweet_wechat_maodeng.img.update=UPDATE sweet_wechat_maodeng SET pic_url=? WHERE user_id=? AND mao_id=?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment