package com.red.circle.wallet.inner.endpoint.freight.api;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.wallet.inner.model.dto.FreightSellerDTO;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 经销商卖家信息.
 *
 * @author pengliang on 2023/12/26
 */
public interface FreightSellerClientApi {

  String API_PREFIX = "/freight/seller/client";

  /**
   * 是否存卖家.
   *
   * @param userId 用户id
   * @return true 存在，false 不存在
   */
  @GetMapping("/existsSeller")
  ResultResponse<Boolean> existsSeller(@RequestParam("userId") Long userId);

  /**
   * 统计卖家数量.
   *
   * @param sysOrigin 平台
   * @param freightId 经销商id
   * @return 卖家数量
   */
  @GetMapping("/countByFreightId")
  ResultResponse<Long> countByFreightId(
      @RequestParam("freightId") Long freightId,
      @RequestParam("sysOrigin") String sysOrigin
  );

  /**
   * 查询卖家列表.
   *
   * @param sysOrigin 平台
   * @param freightId 经销商id
   * @return 查询卖家列表
   */
  @GetMapping("/listFreightSeller")
  ResultResponse<List<FreightSellerDTO>> listFreightSeller(
      @RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("freightId") Long freightId);

  /**
   * 查询卖家.
   *
   * @param userId 用户id
   * @return 查询卖家
   */
  @GetMapping("/getFreightSellerByUserId")
  ResultResponse<FreightSellerDTO> getFreightSellerByUserId(@RequestParam("userId") Long userId);

  /**
   * 根据id修改记录.
   */
  @PostMapping("/updateSelectiveById")
  ResultResponse<Void> updateSelectiveById(@RequestBody FreightSellerDTO dto);

  /**
   * 添加.
   */
  @PostMapping("/save")
  ResultResponse<Void> save(@RequestBody FreightSellerDTO dto);

  /**
   * 获取指定记录.
   */
  @GetMapping("/getById")
  ResultResponse<FreightSellerDTO> getById(@RequestParam("id") Long id);
}
