package com.playlet.web.service.app.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.playlet.system.domain.PlayletBanner;
import com.playlet.system.domain.PlayletMessage;
import com.playlet.system.service.IPlayletMessageService;
import com.playlet.web.service.app.PlayletMessageAppService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>公告小程序类</p>
 * @author clunt
 */
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletMessageAppServiceImpl implements PlayletMessageAppService {

    private final IPlayletMessageService iPlayletMessageService;

    @Override
    public List<PlayletMessage> getMessageList(PlayletMessage playletMessage) {
        return iPlayletMessageService.selectPlayletMessageList(playletMessage);
    }

    @Override
    public PageInfo<PlayletMessage> getMessagePage(PlayletMessage playletMessage, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PlayletMessage> list = iPlayletMessageService.selectPlayletMessageList(playletMessage);
        return PageInfo.of(list);
    }

}
