package com.ruoyi.goods.controller.business;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.goods.api.domain.LotteryEvent;
|
import com.ruoyi.goods.service.lottery.ILotteryEventService;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2025/5/8 18:13
|
*/
|
@RestController
|
@RequestMapping("/mer/lotteryEvent")
|
public class MerLotteryEventController {
|
|
@Resource
|
private ILotteryEventService lotteryEventService;
|
|
|
/**
|
* 根据开启方式获取活动列表
|
*
|
* @param activityType
|
* @return
|
*/
|
@ResponseBody
|
@PostMapping("/getLotteryEventList")
|
public R<List<LotteryEvent>> getLotteryEventList(@RequestParam("activityType") Integer activityType) {
|
List<LotteryEvent> list = lotteryEventService.list(new LambdaQueryWrapper<LotteryEvent>().eq(LotteryEvent::getActivityType, activityType)
|
.eq(LotteryEvent::getDelFlag, 0).last(" and now() between start_time and end_time"));
|
return R.ok(list);
|
}
|
|
|
}
|