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

Commit 2f411b10 authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents a7470379 d333e013
......@@ -37,10 +37,10 @@ liquidnet:
port: 6380
password: PO@B!Iud32
mongodb:
host: s-2zef656730e5a1d4-pub.mongodb.rds.aliyuncs.com:3717,s-2ze49872ed6aeb14-pub.mongodb.rds.aliyuncs.com:3717
port: 3717
host: 39.106.122.201:27017
port: 27017
user: root
pwd: $hAh4SGcDQ
pwd: S&y$6d*JwJ
service:
adam:
url-pay:
......
......@@ -30,20 +30,22 @@ public class RedisRefundReceiver implements StreamListener<String, MapRecord<Str
System.out.println("message id " + message.getId());
System.out.println("stream " + message.getStream());
System.out.println("body " + message.getValue());
consumerSqlDaoHandler(message.getValue().get("message"));
log.error("consumer success delete message messageId:{} ",message.getId());
try {
boolean result = this.consumerSqlDaoHandler(message.getValue().get("message"));
if(result){
log.error("consumer success delete message messageId:{} ",message.getId());
try {
// stringRedisTemplate.multi();
stringRedisTemplate.opsForStream().delete(DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode(), message.getId());
stringRedisTemplate.opsForStream().delete(DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode(), message.getId());
// stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
// stringRedisTemplate.exec();
} catch (Exception e) {
log.error("delete redis queue message Exception error: {} ",e);
log.error("delete redis queue message error messageId:{} errMsg:{}",message.getId(),e.getMessage());
} catch (Exception e) {
log.error("delete redis queue message Exception error: {} ",e);
log.error("delete redis queue message error messageId:{} errMsg:{}",message.getId(),e.getMessage());
}
}
}
private void consumerSqlDaoHandler(String msg) {
private boolean consumerSqlDaoHandler(String msg) {
try {
SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(msg, SqlMapping.SqlMessage.class);
log.debug("CONSUMER SQL ==> Preparing:{}", JsonUtils.toJson(sqlMessage.getSqls()));
......@@ -51,13 +53,13 @@ public class RedisRefundReceiver implements StreamListener<String, MapRecord<Str
Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
log.debug("CONSUMER SQL result of execution:{}", rstBatchSqls);
if (rstBatchSqls) {
//应答
} else {
sendMySqlRedis(msg);
return true;
}
} catch (Exception e) {
e.printStackTrace();
log.error("CONSUMER SQL Exception error:{}", e);
}
return false;
}
/**
......
......@@ -12,6 +12,7 @@ public class SweetConstant {
public final static String REDIS_KEY_SWEET_MANUAL_SORT = "sweet:manual:sort:manual:";
public final static String REDIS_KEY_SWEET_ARTISTS_RELATION = "sweet:artists:relation:uid:";
public final static String REDIS_KEY_SWEET_ARTISTS_DETAILS = "sweet:artists:details:";
public final static String REDIS_KEY_SWEET_SHOP = "sweet:artists:shop:manual:";
......
......@@ -5,6 +5,7 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.sweet.dto.SweetManualAppletDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.entity.SweetArtists;
import com.liquidnet.service.sweet.entity.SweetManualNotify;
import com.liquidnet.service.sweet.entity.SweetManualShop;
import com.liquidnet.service.sweet.entity.SweetRichtext;
......@@ -213,6 +214,48 @@ public class SweetAppletController {
return ResponseDto.success();
}
@GetMapping("artistsDetails")
@ApiOperation("艺人-详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "artistsId", value = "艺人id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true)
})
public ResponseDto<SweetManualArtistListDto> artistsDetails(@RequestParam String artistsId,
@RequestParam String manualId,
@RequestParam String uid) {
SweetManualArtistList2Dto data = redisDataUtils.getTimeList(manualId);
List<SweetManualArtistListDto> dataList = data.getData();
SweetArtistsRelationVo relationData = redisDataUtils.getArtistsRelationRedisVo(uid);
SweetManualArtistListDto vo = SweetManualArtistListDto.getNew();
for (SweetManualArtistListDto item : dataList) {
if (item.getArtistId().equalsIgnoreCase(artistsId)) {
item.setIsWatch(0);
item.setIsSign(0);
if (relationData.getWatchList() != null) {
for (String artistsIds : relationData.getWatchList()) {
if (artistsId.equalsIgnoreCase(artistsIds)) {
item.setIsWatch(1);
break;
}
}
}
if (relationData.getSignList() != null) {
for (String artistsIds : relationData.getSignList()) {
if (artistsId.equalsIgnoreCase(artistsIds)) {
item.setIsSign(1);
break;
}
}
}
vo = item;
break;
}
}
return ResponseDto.success(vo);
}
@GetMapping("manualShop")
@ApiOperation("吃喝玩乐")
@ApiImplicitParams({
......
......@@ -37,6 +37,8 @@ public class RedisDataUtils {
private SweetManualNotifyMapper sweetManualNotifyMapper;
@Autowired
private SweetManualShopMapper sweetManualShopMapper;
@Autowired
private SweetArtistsMapper sweetArtistsMapper;
public List<SweetManualAppletDto> setPushList() {
......@@ -289,4 +291,21 @@ public class RedisDataUtils {
return (SweetWechatUser) redisUtil.get(redisKey);
}
// 艺人详情
public SweetArtists setArtistsDetails(String artistsId){
String redisKey = SweetConstant.REDIS_KEY_SWEET_ARTISTS_DETAILS.concat(artistsId);
SweetArtists sweetArtists = sweetArtistsMapper.selectOne(Wrappers.lambdaQuery(SweetArtists.class).eq(SweetArtists::getArtistsId,artistsId).eq(SweetArtists::getStatus,1));
redisUtil.set(redisKey,sweetArtists);
return sweetArtists;
}
public SweetArtists getArtistsDetails(String artistsId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_ARTISTS_DETAILS.concat(artistsId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setArtistsDetails(artistsId);
} else {
return (SweetArtists) obj;
}
}
}
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