package com.hwrj.cloud.admin.client;

import com.hwrj.cloud.admin.common.CmsSubjectProductRelationInput;
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 = "subject")
public interface CmsSubjectProductRelationClient {
    /**
     * 关联优选
     *
     * @param productRelationInputs
     */
    @RequestMapping(value = "/relateAndInsertList", method = RequestMethod.POST)
    CommonResult relateAndInsertList(@RequestBody List<CmsSubjectProductRelationInput> productRelationInputs, @RequestParam("productId") Long productId);

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


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

}