package com.crm.manager.service;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.market.promo.code.MarketPromoCodeListDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.market.promo.code.MarketPromoCodeAddEntity;
import com.crm.rely.backend.core.entity.market.promo.code.MarketPromoCodeSearchPageEntity;
import com.crm.rely.backend.core.entity.market.promo.code.MarketPromoCodeUpdateEntity;
import com.crm.rely.backend.core.entity.market.promo.code.MarketPromoCodeUpdateStatusEntity;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @description:
 * @author: houn
 * @create: 2021-07-21 16:25
 **/
@FeignClient(name = "MARKETS-SERVICE", path = "/market/promo/code")
public interface MarketPromoCodeFeignService {

    /**
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/add")
    BaseResultDto add(@RequestBody @Validated MarketPromoCodeAddEntity entity) throws Exception;

    @PostMapping("/update")
    BaseResultDto update(@RequestBody @Validated MarketPromoCodeUpdateEntity entity) throws Exception;

    @PostMapping("/status")
    BaseResultDto status(@RequestBody @Validated MarketPromoCodeUpdateStatusEntity entity) throws Exception;

    @PostMapping("/search/list")
    ResultWithPagerDto<MarketPromoCodeListDto> pageList(@RequestBody @Validated MarketPromoCodeSearchPageEntity entity) throws Exception;

    @PostMapping("/search/single")
    BaseResultDto<MarketPromoCodeListDto> single(@RequestBody @Validated SingleLongEntity entity) throws Exception;
}
