package com.ghy.goods.service.impl;

import com.ghy.goods.domain.GoodsArea;
import com.ghy.goods.mapper.GoodsAreaMapper;
import com.ghy.goods.service.GoodsAreaService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 商品服务区域impl
 * @author clunt
 */

@Slf4j
@Service
public class GoodsAreaServiceImpl implements GoodsAreaService {

    @Resource
    private GoodsAreaMapper goodsAreaMapper;

    @Override
    public List<GoodsArea> selectByGoodsId(@NotNull Long goodsId) {
        return goodsAreaMapper.selectByGoodsId(goodsId);
    }

    @Override
    public int batchInsert(List<GoodsArea> areas) {
        return goodsAreaMapper.batchInsert(areas);
    }

    @Override
    public void deleteByGoodsId(Long goodsId) {
        goodsAreaMapper.deleteByGoodsId(goodsId);
    }
}
