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

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.playlet.system.domain.PlayletItemType;
import com.playlet.system.service.IPlayletItemTypeService;
import com.playlet.web.service.app.PlayletItemTypeAppService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletItemTypeAppServiceImpl implements PlayletItemTypeAppService {

    private final IPlayletItemTypeService iPlayletItemTypeService;

    @Override
    public PageInfo<PlayletItemType> getTypePage(PlayletItemType playletItemType, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PlayletItemType> list = iPlayletItemTypeService.selectPlayletItemTypeList(playletItemType);
        return PageInfo.of(list);
    }

    @Override
    public List<PlayletItemType> getTypeList(PlayletItemType playletItemType) {
        return iPlayletItemTypeService.selectPlayletItemTypeList(playletItemType);
    }

}
