package com.bonus.common.biz.service;

import com.bonus.common.biz.domain.BmStorageLog;
import com.bonus.common.biz.service.factory.RemoteStoreLogFallbackFactory;
import com.bonus.common.core.constant.SecurityConstants;
import com.bonus.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 物资库存日志服务
 * 
 * @author syruan
 */
@FeignClient(contextId = "remoteStoreLogService", value = "bonus-material", fallbackFactory = RemoteStoreLogFallbackFactory.class)
public interface RemoteStoreLogService {

    /**
     * 保存物资记录日志
     * @param bmStorageLogList 物资信息
     * @param source 请求来源
     * @return 结果
     * @throws Exception 异常信息
     */
    @PostMapping("/bm_storage_log")
    R<Boolean> batchInsert(@RequestBody List<BmStorageLog> bmStorageLogList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;


}
