Pu Zhibing
6 天以前 ea1a62ba6484d6c6cb1ca67dcea938a95ba18fc6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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);
    }
    
    
}