/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.mall.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.mall.entity.GoodsInfo;
import org.springblade.modules.mall.vo.GoodsInfoVO;

import javax.validation.Valid;
import java.io.InputStream;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 商品表 服务类
 *
 * @author BladeX
 * @since 2022-05-07
 */
public interface IGoodsInfoService extends IService<GoodsInfo> {


	GoodsInfo get(Serializable id);

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param goodsInfo
	 * @return
	 */
	IPage<GoodsInfoVO> selectGoodsInfoPage(IPage<GoodsInfoVO> page, GoodsInfoVO goodsInfo);

	void submit(@Valid GoodsInfo goodsInfo);

	void update(@Valid GoodsInfo goodsInfo);

	GoodsInfo detail(Long id);

	GoodsInfo getByGoodsNo(String goodsNo);

	void modifyState(List<Long> toLongList, Integer state);

	void modifyCategory(List<Long> toLongList, String categoryIds);



	/**
	 * 修改专区类型
	 * @param ids 商品id集合
	 * @param zoneType 专区类型
	 * @param activityDate
	 */
    void modifyZoneType(List<Long> ids, Integer zoneType, Date activityDate);

	List<GoodsInfo> activityGoods(IPage<Object> page, String activityDate);

	/**
	 * 增加商品浏览量
	 * @param goodsInfoId
	 */
	void addTotalView(Long goodsInfoId);

	/**
	 * 审核
	 * @param id
	 * @param remark
	 */
	void audit(String id, Integer auditStatus, String remark);

	void batchImport(InputStream inputStream, Long storeId);

	/**
	 * 缓存商品库存
	 */
	Object[] getStockList(Integer goodsStock);

	int getGodsStock(Long goodsId);

	void copy(Long goodsId);
}
