package com.red.circle.other.inner.endpoint.team.target.api;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.team.TeamPolicyManagerCmd;
import com.red.circle.other.inner.model.dto.agency.agency.TeamPolicyManagerDTO;
import java.util.List;
import java.util.Map;
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 lisizhe on 2023/8/19
 */
public interface TeamPolicyManagerClientApi {

  String API_PREFIX = "/team-policy/client";

  @GetMapping("/getReleaseByRegionAndType")
  ResultResponse<TeamPolicyManagerDTO> getReleaseByRegionAndType(
      @RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("region") String region);


  @GetMapping("/getReleaseByRegionAndTypeAndPolicyType")
  ResultResponse<TeamPolicyManagerDTO> getReleaseByRegionAndType(
          @RequestParam("sysOrigin") String sysOrigin,
          @RequestParam("region") String region,
          @RequestParam("policyType") String policyType);

  @PostMapping("/mapRegionRelease")
  ResultResponse<Map<String, TeamPolicyManagerDTO>> mapRegionRelease(
      @RequestBody Set<String> regions);

  @GetMapping("/listSysOriginRegion")
  ResultResponse<List<TeamPolicyManagerDTO>> listSysOriginRegion(
      @RequestParam("sysOrigin") String sysOrigin, @RequestParam("region") String region, @RequestParam("policyType") String policyType);

  @GetMapping("/listTeamPolicy")
  ResultResponse<List<TeamPolicyManagerDTO>> listTeamPolicy(
      @RequestParam("sysOrigin") String sysOrigin, @RequestParam("region") String region);

  @PostMapping("/add")
  ResultResponse<Void> add(@RequestBody TeamPolicyManagerCmd cmd);

  @GetMapping("/deleteById")
  ResultResponse<Void> deleteById(@RequestParam("id") Long id);
}
