package com.fzm.mall.server.front.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzm.mall.server.front.goods.model.Nft;
import com.fzm.mall.server.front.goods.mapper.NftMapper;
import com.fzm.mall.server.front.goods.service.INftService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author fzm
 * @since 2021-09-14
 */
@Service
public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements INftService {

    @Autowired
    private NftMapper nftMapper;

    @Override
    public Nft getByGoodsId(String goodsId) {
        QueryWrapper<Nft> q = new QueryWrapper<>();
        q.eq("goods_id",goodsId);
        return getOne(q);
    }

    @Override
    public int delStock(Long id, Integer number, Long updateTime, long currentTimeMillis) {
        return nftMapper.delStock(id,number,updateTime,currentTimeMillis);
    }
}
