package com.kxs.system.biz.controller.kxsapp;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kxs.common.core.util.R;
import com.kxs.system.api.model.KxsMorning;
import com.kxs.system.biz.service.KxsMorningService;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页(Morning)控制层
 *
 * @author 系统
 * @since 2023-12-15 12:16:33
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("morning")
public class MorningController {

    /**
     * 服务对象
     */
    private final KxsMorningService kxsMorningService;

    /**
     * 商学院-晨会列表
     *
     * @param page 分页对象
     * @return 商学院-晨会列表
     */
    @GetMapping("/page")
    public R page(@ParameterObject Page<KxsMorning> page) {

        return R.ok(kxsMorningService.page(page,
                Wrappers.<KxsMorning>lambdaQuery().orderByDesc(KxsMorning::getCreateTime)));
    }


}

