package com.red.circle.other.inner.endpoint.user.region.api;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.user.SysRegionRelationCmd;
import com.red.circle.other.inner.model.cmd.user.SysRegionRelationQryCmd;
import com.red.circle.other.inner.model.dto.user.reigon.RegionRelationDTO;
import com.red.circle.other.inner.enums.user.RegionRelationGroupEnum;
import java.util.List;
import java.util.Set;
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/8/20
 */
public interface RegionRelationClientApi {

  String API_PREFIX = "/region-relation/client";

  /**
   * 获取一组区域关系信息.
   */
  @GetMapping("/listByRegionId")
  ResultResponse<List<RegionRelationDTO>> listByRegionId(
      @RequestParam("regionId") String regionId,
      @RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("group") RegionRelationGroupEnum group
  );

  @PostMapping("/pageRelation")
  ResultResponse<PageResult<RegionRelationDTO>> pageRelation(
      @RequestBody SysRegionRelationQryCmd query);

  @PostMapping("/add")
  ResultResponse<Void> add(@RequestBody SysRegionRelationCmd param);

  @PostMapping("/update")
  ResultResponse<Void> update(@RequestBody SysRegionRelationCmd param);

  @GetMapping("/getRelationIdsByRegionId")
  ResultResponse<Set<Long>> getRelationIdsByRegionId(@RequestParam("regionId") String regionId,
      @RequestParam("name") String name);
}
