package com.mall.thirdParty.controller;

import com.mall.common.domain.vo.result.Result;
import com.mall.thirdParty.service.AliOssService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Tag(name = "阿里云上传文件", description = "阿里云上传文件相关接口")
@RestController
@RequestMapping("/api/third-party")
@RequiredArgsConstructor
public class AliOssController {

    private final AliOssService aliOssService;

    @GetMapping("/oss/policy")
    @Operation(summary = "oss请求Token", description = "oss请求Token")
    public Result<Map<String, String>> getPostSignatureForOssUpload() {
        Map<String, String> vo = aliOssService.getPostSignatureForOssUpload();
        return Result.success(vo);
    }

}