package com.ruoyi.web.controller.cos;

import com.ruoyi.system.service.CosStsService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;
import java.util.Map;

/**
 * @Description: sts
 * @Author: 86187
 * @Date: 2025/03/20 16:34
 * @Version: 1.0
 */
@RestController
@RequestMapping("/cos")
@RequiredArgsConstructor
public class CosStsController {

    private final CosStsService cosStsService;

    /**
     * 获取cos临时密钥
     *
     * @return sts
     */
    @GetMapping("/sts")
    @PermitAll
    public Map<String, Object> getCosSts() {
        return cosStsService.getTempKeys();
    }
}
