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


import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.sys.PageVersionDescQryCmd;
import com.red.circle.other.inner.model.cmd.sys.SysVersionUpdateDescriptionCmd;
import com.red.circle.other.inner.model.cmd.sys.VersionManageQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysVersionUpdateDescriptionDTO;
import com.red.circle.other.inner.model.dto.sys.VersionManageDTO;
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/5/24
 */
public interface VersionClientApi {

  String API_PREFIX = "/version/client";

  @PostMapping("/pageDescription")
  ResultResponse<PageResult<SysVersionUpdateDescriptionDTO>> pageDescription(
      @RequestBody PageVersionDescQryCmd cmd);

  @PostMapping("/addDesc")
  ResultResponse<Boolean> addDesc(@RequestBody SysVersionUpdateDescriptionCmd param);

  @PostMapping("/updateDesc")
  ResultResponse<Boolean> updateDesc(@RequestBody SysVersionUpdateDescriptionCmd param);

  @PostMapping("/deleteDesc")
  ResultResponse<Boolean> deleteDesc(@RequestParam("id") Long id);

  @PostMapping("/pageVersionManage")
  ResultResponse<PageResult<VersionManageDTO>> pageVersionManage(
      @RequestBody VersionManageQryCmd cmd);

  @PostMapping("/saveVersionManage")
  ResultResponse<Boolean> saveVersionManage(@RequestBody VersionManageDTO param);

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

  @PostMapping("/updateVersionManage")
  ResultResponse<Void> updateVersionManage(@RequestBody VersionManageDTO param);

  @GetMapping("/addBuildVersion")
  ResultResponse<Void> addBuildVersion(@RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("platform") String platform,
      @RequestParam("channel") String channel,
      @RequestParam("buildVersion") Integer buildVersion);

  @GetMapping("/getBuildVersion")
  ResultResponse<Integer> getBuildVersion(@RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("platform") String platform,
      @RequestParam("channel") String channel);
}
