package com.ruoyi.cai.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.cai.domain.Gift;
import com.ruoyi.cai.mapper.GiftMapper;
import com.ruoyi.cai.service.GiftService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 礼物Service业务层处理
 *
 * @author 77
 * @date 2023-12-23
 */
@RequiredArgsConstructor
@Service
public class GiftServiceImpl extends ServiceImpl<GiftMapper, Gift> implements GiftService {

    @Override
    public List<Gift> all() {
        return this.list(Wrappers.lambdaQuery(Gift.class).eq(Gift::getStatus,0)
                .orderByAsc(Gift::getSort)
                .select(Gift::getId, Gift::getName, Gift::getPrice, Gift::getImg, Gift::getSvga));
    }
}
