package org.springblade.thirdparty.wps.feign;

import org.springblade.thirdparty.wps.config.WpsFeignClientConfig;
import org.springblade.thirdparty.wps.pojo.dto.WpsFilePreviewDTO;
import org.springblade.thirdparty.wps.pojo.vo.WpsFilePreviewVO;
import org.springblade.thirdparty.wps.pojo.vo.WpsResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *  wps接口
 * @author bfhuange
 * @date 2024/10/30
 */
@FeignClient(name = "WPS", url = "${thirdParty.wps.baseUrl}", configuration = WpsFeignClientConfig.class)
public interface IWpsClient {

    /**
     *  获取文件预览链接
     * @param fileId
     * @return
     */
    @GetMapping(value = "/open/api/preview/v1/files/{fileId}/link", headers = "Content-Type=application/json")
    WpsResultVO<WpsFilePreviewVO> getFilePreviewUrl(@PathVariable("fileId") String fileId,
                                                    @RequestParam("preview_mode") String previewMode,
                                                    @RequestParam("_w_tokentype") int tokenType,
                                                    @SpringQueryMap WpsFilePreviewDTO param);

    /**
     *  获取文件编辑链接
     * @param fileId
     * @return
     */
    @GetMapping(value = "/open/api/edit/v1/files/{fileId}/link", headers = "Content-Type=application/json")
    WpsResultVO<WpsFilePreviewVO> getFileEditUrl(@PathVariable("fileId") String fileId,
                                                    @RequestParam("preview_mode") String previewMode,
                                                    @RequestParam("_w_tokentype") int tokenType,
                                                    @SpringQueryMap WpsFilePreviewDTO param);
}
