fix
This commit is contained in:
@@ -54,7 +54,7 @@ public interface IPlayGiftInfoService extends IService<PlayGiftInfoEntity> {
|
||||
* @author admin
|
||||
* @since 2024/4/25 15:56
|
||||
**/
|
||||
List<PlayClerkGiftReturnVo> customListByAll(String customId,String obtained,String history);
|
||||
List<PlayClerkGiftReturnVo> customListByAll(String customId,String obtained);
|
||||
|
||||
/**
|
||||
* 查询礼物列表
|
||||
|
||||
@@ -57,12 +57,11 @@ public class PlayGiftInfoServiceImpl extends ServiceImpl<PlayGiftInfoMapper, Pla
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayClerkGiftReturnVo> customListByAll(String customId, String obtained, String history) {
|
||||
public List<PlayClerkGiftReturnVo> customListByAll(String customId, String obtained) {
|
||||
if ("0".equals(obtained)) {
|
||||
//查询所有礼物,然后减去已获得礼物
|
||||
MPJLambdaWrapper<PlayGiftInfoEntity> lambdaWrapper = new MPJLambdaWrapper<>();
|
||||
lambdaWrapper.selectAll(PlayGiftInfoEntity.class);
|
||||
lambdaWrapper.eq(PlayGiftInfoEntity::getHistory, history);
|
||||
List<PlayClerkGiftReturnVo> list = this.baseMapper.selectJoinList(PlayClerkGiftReturnVo.class, lambdaWrapper);
|
||||
List<PlayCustomGiftInfoEntity> giftInfoEntities = customGiftInfoService.selectBtyCustomId(customId);
|
||||
// 使用迭代器安全地移除元素
|
||||
|
||||
@@ -9,12 +9,13 @@ import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayGiftInfoDto;
|
||||
import com.starry.admin.modules.weichat.entity.gift.PlayClerkGiftReturnVo;
|
||||
import com.starry.admin.modules.weichat.entity.gift.PlayCustomGiftQueryVo;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -67,9 +68,15 @@ public class WxGiftController {
|
||||
* @return 礼物列表
|
||||
*/
|
||||
@CustomUserLogin
|
||||
@PostMapping("/custom/listByAll")
|
||||
public R customListByAll(@Validated @RequestBody PlayCustomGiftQueryVo vo) {
|
||||
List<PlayClerkGiftReturnVo> list = giftInfoService.customListByAll(ThreadLocalRequestDetail.getCustomUserInfo().getId(), vo.getObtained(), vo.getHistory());
|
||||
@GetMapping("/custom/listByAll")
|
||||
public R customListByAll(@RequestParam("obtained") String obtained) {
|
||||
if (StrUtil.isBlankIfStr(obtained)) {
|
||||
throw new CustomException("obtained参数异常");
|
||||
}
|
||||
if (!"0".equals(obtained) && !"1".equals(obtained)) {
|
||||
throw new CustomException("obtained参数异常");
|
||||
}
|
||||
List<PlayClerkGiftReturnVo> list = giftInfoService.customListByAll(ThreadLocalRequestDetail.getCustomUserInfo().getId(), obtained);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user