package com.red.circle.other.inner.endpoint.sys.api;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.sys.SysOperationIncomeExpenditureCmd;
import com.red.circle.other.inner.model.cmd.tools.ApiOperationLogCmd;
import com.red.circle.other.inner.model.dto.sys.ApiOperationLogDTO;

import java.util.List;
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;

/**
 * 系统操作日志表.
 *
 * @author pengliang on 2023/9/20
 */
public interface ApiOperationLogClientApi {

  String API_PREFIX = "/api-operation-log/client";

  /**
   * 添加日志.
   */
  @PostMapping("/add")
  ResultResponse<Void> add(@RequestBody @Validated ApiOperationLogDTO log);

  /**
   * 保存系统操作收支明细
   */
  @PostMapping("/addSysOperationIncome")
  ResultResponse<Void> addSysOperationIncome(
      @RequestBody @Validated SysOperationIncomeExpenditureCmd cmd);

  @PostMapping("/mapAssociateRemarks")
  ResultResponse<Map<String, String>> mapAssociateRemarks(@RequestBody Set<String> associateIds);

  /**
   * 获取最近业务请求数据.
   */
  @PostMapping("/api-operation-log")
  ResultResponse<List<ApiOperationLogDTO>> list(@RequestBody ApiOperationLogCmd query);
}
