package com.sqx.modules.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.dao.VipDetailsDao;
import com.sqx.modules.app.entity.VipDetails;
import com.sqx.modules.app.service.VipDetailsService;
import com.sqx.modules.tbCoupon.entity.TbCoupon;
import com.sqx.modules.tbCoupon.service.TbCouponService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class VipDetailsServiceImpl extends ServiceImpl<VipDetailsDao, VipDetails> implements VipDetailsService {

    @Override
    public Result selectVipDetails() {
        List<VipDetails> vipDetails = baseMapper.selectList(null);
        return Result.success().put("data", vipDetails);
    }

    @Override
    public Result insertVipDetails(VipDetails vipDetails) {
        int cpunt = baseMapper.insert(vipDetails);
        if (cpunt > 0) {
            return Result.success("添加成功！");
        } else {
            return Result.error("添加失败");
        }
    }
}
