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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.team.manager.TeamManagerAddCmd;
import com.red.circle.other.inner.model.cmd.team.manager.TeamManagerOpsPageQryCmd;
import com.red.circle.other.inner.model.dto.agency.manager.TeamManagerDTO;
import java.util.Map;
import java.util.Set;
import org.springframework.validation.annotation.Validated;
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;

/**
 * 团队经理.
 */
public interface TeamManagerClientApi {

  String API_PREFIX = "/team/manager/client";

  @GetMapping("/getById")
  ResultResponse<TeamManagerDTO> getById(@RequestParam("id") Long id);

  @GetMapping("/getByUserId")
  ResultResponse<TeamManagerDTO> getByUserId(@RequestParam("userId") Long userId);

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

  @GetMapping("/check")
  ResultResponse<Boolean> check(@RequestParam("userId") Long userId);

  @PostMapping("/mapCheck")
  ResultResponse<Map<Long, Boolean>> mapCheck(@RequestBody Set<Long> userIds);

  @PostMapping("/pageOps")
  ResultResponse<PageResult<TeamManagerDTO>> pageOps(@RequestBody TeamManagerOpsPageQryCmd qryCmd);

  @PostMapping("/updateSelectiveById")
  ResultResponse<Void> updateSelectiveById(@RequestBody @Validated TeamManagerDTO dto);

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

}
