package com.hwrj.cloud.admin.client;

import com.hwrj.cloud.admin.common.CmsPrefrenceAreaProductRelationInput;
import com.hwrj.cloud.common.api.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 邱波
 * @desc
 */
@FeignClient(name = "forest-admin", path = "prefrenceArea")
public interface CmsPrefrenceAreaProductRelationClient {

    /**
     * 批量关联商品
     *
     * @param productRelationInput
     * @return
     */
    @RequestMapping(value = "/relateAndInsertList", method = RequestMethod.POST)
    CommonResult relateAndInsertList(@RequestBody List<CmsPrefrenceAreaProductRelationInput> productRelationInput, @RequestParam("productId") Long productId);


    /**
     * 批量更新关联商品
     *
     * @param productRelationInputs
     * @param productId
     */
    @RequestMapping(value = "/relateAndUpdateList", method = RequestMethod.POST)
    CommonResult relateAndUpdateList(@RequestBody List<CmsPrefrenceAreaProductRelationInput> productRelationInputs, @RequestParam("productId") Long productId);


    /**
     * 通过id查询关联专题
     *
     * @param productId
     * @return
     */
    @RequestMapping(value = "/relationByProductId", method = RequestMethod.GET)
    CommonResult<List<CmsPrefrenceAreaProductRelationInput>> relationByProductId(@RequestParam("productId") Long productId);
}
