package com.backendsys.modules.material.service.impl;

import com.backendsys.modules.material.dao.MaterialLoraDao;
import com.backendsys.modules.material.entity.MaterialLora;
import com.backendsys.modules.material.service.MaterialLoraService;
import com.backendsys.utils.response.PageEntity;
import com.backendsys.utils.response.PageInfoResult;
import com.backendsys.utils.v2.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MaterialLoraServiceImpl implements MaterialLoraService {

    @Autowired
    private MaterialLoraDao materialLoraDao;

    /**
     * 获取素材风格列表
     */
    @Override
    public PageEntity selectMaterialLoraList(MaterialLora materialLora) {
        PageUtils.startPage();  // 分页
        List<MaterialLora> list = materialLoraDao.selectMaterialLoraList(materialLora);
        return new PageInfoResult(list).toEntity();
    }

    /**
     * 获取素材风格列表 (下拉)
     */
    @Override
    public List<MaterialLora> selectMaterialLoraPopover(MaterialLora materialLora) {
        List<MaterialLora> list = materialLoraDao.selectMaterialLoraList(materialLora);
        return list;
    }
}
