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

Commit 3e419dfb authored by sunyuntian's avatar sunyuntian

修改bug

parent bc85ccca
......@@ -30,33 +30,34 @@ public class SweetWechatMaoDengServiceImpl {
@Autowired
WechatMaConfigure maConfigure;
public ResponseDto addBuilderImg(String userId, String imgUrl) {
public ResponseDto addBuilderImg(String userId,String imgUrl){
LocalDateTime localDateTime = DateUtil.asLocalDateTime(DateUtil.now()); //生成创建时间
try {
log.error("[userId] = {}", userId);
log.error("[imgUrl] = {}", imgUrl);
String maoId = IDGenerator.nextSnowId();
SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 1);
if (null == wechatUsers) {
return ResponseDto.failure("请求失败");
}
SweetMaoDengVo sweetMaoDeng = redisUtils.getSweetMaoDeng(wechatUsers.getOpenId());
if (sweetMaoDeng != null) {
sweetMaoDeng.setImgUrl(imgUrl);
}
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,localDateTime});
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_WECHAT_MAODENG_TEXT_INSERT.getKey(), SqlMapping.gets(sqls, sqlsDataA));
return ResponseDto.failure("请求成功");
}
String maoId = IDGenerator.nextSnowId();
SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 1);
if (null == wechatUsers) {
return ResponseDto.failure("请求失败");
}
SweetMaoDengVo sweetMaoDeng = redisUtils.getSweetMaoDeng(wechatUsers.getOpenId());
if (sweetMaoDeng != null){
sweetMaoDeng.setImgUrl(imgUrl);
}
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,localDateTime});
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_WECHAT_MAODENG_TEXT_INSERT.getKey(), SqlMapping.gets(sqls, sqlsDataA));
return ResponseDto.failure("请求成功");
}
return ResponseDto.failure("请求失败");
} catch (Exception e) {
......
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