package com.willalp.canteen.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.willalp.canteen.domain.HsGift;

import java.util.List;

/**
 * 礼品登记Service接口
 *
 * @author songyu
 * @date 2022-03-03
 */
public interface IHsGiftService extends IService<HsGift> {
    /**
     * 查询礼品登记列表
     *
     * @param hsGift 礼品登记
     * @return 礼品登记集合
     */
    List<HsGift> selectHsGiftList(HsGift hsGift);

    /**
     * 查询礼品登记列表
     *
     * @param hsGift 礼品登记
     * @return 礼品登记集合
     */
    List<HsGift> bindingList(HsGift hsGift);
    /**
     *
     * @param type
     * @param code
     * @return
     */
    List<HsGift> appSelectedHsGiftList(int type, String code);

    /**
     * 积分兑换检查库存并实时抵扣
     *
     * @param num
     * @param giftId
     * @return
     */
    int checkAndReduceGiftInventory(int num, String giftId);
}
