package com.ruoyi.demo.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.demo.entity.bo.PlanBo;
import com.ruoyi.demo.service.DlUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/dluser")
public class DlUserController {
    @Autowired
    DlUserService dlUserService;

    @PostMapping("/list")
    public R list(@RequestBody PlanBo bo){
        if (bo.getStartTime() != null && bo.getEndTime() != null)
            if (bo.getStartTime().compareTo(bo.getEndTime()) > 0)
                return R.fail("起始时间不能大于结束时间");
        return R.ok(dlUserService.getList(bo));
    }
}
