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

Commit a7860f8d authored by 胡佳晨's avatar 胡佳晨

sweet

parent 878b8e0a
......@@ -12,6 +12,8 @@ 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_SHOP = "sweet:artists:shop:manual:";
public final static String REDIS_KEY_SWEET_REMIND="sweet:remind:unionId:";
public static final String REDIS_KEY_SWEET_REMIND_ALL = "sweet:remind:unionId*";
......
package com.liquidnet.service.sweet.controller;
import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.CurrentUtil;
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.SweetManualNotify;
import com.liquidnet.service.sweet.entity.SweetManualShop;
import com.liquidnet.service.sweet.entity.SweetRichtext;
import com.liquidnet.service.sweet.entity.SweetStage;
import com.liquidnet.service.sweet.utils.RedisDataUtils;
import com.liquidnet.service.sweet.vo.SweetArtistsRelationVo;
import com.liquidnet.service.sweet.vo.SweetManualShopAllVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -69,7 +69,7 @@ public class SweetAppletController {
@ApiImplicitParam(type = "query", dataType = "Integer", name = "page", value = "页数", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "size", value = "数量", required = true),
})
public ResponseDto<SweetManualArtistList2Dto> timeList(@RequestParam( )String manualId,
public ResponseDto<SweetManualArtistList2Dto> timeList(@RequestParam() String manualId,
@RequestParam() String dateTime,
@RequestParam() String stage,
@RequestParam() Integer isSign,
......@@ -119,15 +119,15 @@ public class SweetAppletController {
item.setIsWatch(0);
item.setIsSign(0);
for (String artistsId: relationData.getWatchList()) {
if(artistsId.equalsIgnoreCase(item.getArtistId())){
for (String artistsId : relationData.getWatchList()) {
if (artistsId.equalsIgnoreCase(item.getArtistId())) {
item.setIsWatch(1);
break;
}
}
for (String artistsId: relationData.getSignList()) {
if(artistsId.equalsIgnoreCase(item.getArtistId())){
for (String artistsId : relationData.getSignList()) {
if (artistsId.equalsIgnoreCase(item.getArtistId())) {
item.setIsSign(1);
break;
}
......@@ -153,7 +153,7 @@ public class SweetAppletController {
return ResponseDto.success(redisDataUtils.getRichTextRedisData(manualId, type));
}
@GetMapping("artistsWatch")
@PostMapping("artistsWatch")
@ApiOperation("艺人-想看")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true),
......@@ -165,7 +165,7 @@ public class SweetAppletController {
return ResponseDto.success();
}
@GetMapping("artistsSign")
@PostMapping("artistsSign")
@ApiOperation("艺人-签售")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true),
......@@ -176,4 +176,37 @@ public class SweetAppletController {
redisDataUtils.setArtistsRelationRedisVo(uid, artistsId, "watch");
return ResponseDto.success();
}
@GetMapping("manualShop")
@ApiOperation("吃喝玩乐")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "artistsId", value = "艺人id", required = true)
})
public ResponseDto<SweetManualShopAllVo> manualShop(@RequestParam String manualId) {
List<SweetManualShop> shopList = redisDataUtils.getManualShopRedisData(manualId);
List<SweetManualShop> recommend = new ArrayList<>();
List<SweetManualShop> eat = new ArrayList<>();
List<SweetManualShop> play = new ArrayList<>();
SweetManualShopAllVo vo = SweetManualShopAllVo.getNew();
for (SweetManualShop item : shopList) {
if(item.getIsRecommend().equals(1)){
recommend.add(item);
}
if(item.getType().equals(1)){
eat.add(item);
}
if(item.getType().equals(2)){
play.add(item);
}
}
vo.setRecommend(recommend);
vo.setEat(eat);
vo.setPlay(play);
return ResponseDto.success(vo);
}
}
......@@ -11,6 +11,7 @@ import com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistStageListDto;
import com.liquidnet.service.sweet.entity.SweetManualNotify;
import com.liquidnet.service.sweet.entity.SweetManualShop;
import com.liquidnet.service.sweet.entity.SweetManualSort;
import com.liquidnet.service.sweet.entity.SweetRichtext;
import com.liquidnet.service.sweet.mapper.*;
......@@ -36,6 +37,8 @@ public class RedisDataUtils {
private SweetManualSortMapper sweetManualSortMapper;
@Autowired
private SweetManualNotifyMapper sweetManualNotifyMapper;
@Autowired
private SweetManualShopMapper sweetManualShopMapper;
public List<SweetManualAppletDto> setPushList() {
......@@ -193,20 +196,20 @@ public class RedisDataUtils {
redisUtil.del(SweetConstant.REDIS_KEY_SWEET_MANUAL_SORT.concat(manualId));//列表
}
public void setArtistsRelationRedisVo(String uid, String artistsId ,String type) {
public void setArtistsRelationRedisVo(String uid, String artistsId, String type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_ARTISTS_RELATION.concat(uid);
SweetArtistsRelationVo vo = getArtistsRelationRedisVo(uid);
vo.setUid(uid);
if(type.equalsIgnoreCase("sign")){
if(vo.getSignList().contains(artistsId)){
if (type.equalsIgnoreCase("sign")) {
if (vo.getSignList().contains(artistsId)) {
vo.getSignList().remove(artistsId);
}else{
} else {
vo.getSignList().add(artistsId);
}
}else if(type.equalsIgnoreCase("watch")){
if(vo.getWatchList().contains(artistsId)){
} else if (type.equalsIgnoreCase("watch")) {
if (vo.getWatchList().contains(artistsId)) {
vo.getWatchList().remove(artistsId);
}else{
} else {
vo.getWatchList().add(artistsId);
}
}
......@@ -225,6 +228,24 @@ public class RedisDataUtils {
}
}
//获取 商铺
public List<SweetManualShop> setManualShopRedisData(String manualId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_SHOP.concat(manualId);
List<SweetManualShop> list = sweetManualShopMapper.selectList(Wrappers.lambdaQuery(SweetManualShop.class).eq(SweetManualShop::getManualId, manualId).orderBy(true,false,SweetManualShop::getSort));
redisUtil.set(redisKey, list);
return list;
}
public List<SweetManualShop> getManualShopRedisData(String manualId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_SHOP.concat(manualId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setManualShopRedisData(manualId);
} else {
return (List<SweetManualShop>) obj;
}
}
// // 小程序演出提醒
// public void setSweetRemind(String openId, String unionId, String performancesId, KylinPerformanceVo performanceInfo) {
// String redisKey = SweetConstant.REDIS_KEY_SWEET_REMIND.concat(unionId);
......
package com.liquidnet.service.sweet.vo;
import com.liquidnet.service.sweet.entity.SweetManualShop;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel
public class SweetManualShopAllVo implements Serializable ,Cloneable {
@ApiModelProperty("推荐")
private List<SweetManualShop> recommend;
@ApiModelProperty("吃喝")
private List<SweetManualShop> eat;
@ApiModelProperty("玩乐")
private List<SweetManualShop> play;
private static final SweetManualShopAllVo obj = new SweetManualShopAllVo();
public static SweetManualShopAllVo getNew() {
try {
return (SweetManualShopAllVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new SweetManualShopAllVo();
}
}
}
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