package com.hzs.system.home.controller.api;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.system.home.HoBackground;
import com.hzs.system.home.service.IHoBackgroundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 首页背景 前端控制器
 * </p>
 *
 * @author hzs
 * @since 2022-11-18
 */
@RestController
@RequestMapping("/api/ho-background")
public class ApiHoBackgroundController extends BaseController {

    @Autowired
    private IHoBackgroundService backgroundService;

    /**
     * @description: 查询首页背景列表
     * @author: zhang jing
     * @date: 2022/8/30 10:20
     * @param: [background]
     * @return: com.hzs.common.core.web.page.TableDataInfo
     **/
    @GetMapping("/list")
    public TableDataInfo list() {
        QueryWrapper<HoBackground> queryWrapper = new QueryWrapper();
        queryWrapper.lt("EFFECTIVE_DATE",new Date());
        List<HoBackground> list = backgroundService.list(queryWrapper);
        return getDataTable(list);
    }

}
