This commit is contained in:
admin
2024-06-05 20:27:17 +08:00
parent 5e538a1b1e
commit ff981ffffb
3 changed files with 15 additions and 9 deletions

View File

@@ -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);
}