package com.yd.oss.api.controller;

import com.yd.common.result.Result;
import com.yd.oss.api.service.ApiOssStsService;
import com.yd.oss.feign.client.ApiOssStsFeignClient;
import com.yd.oss.feign.request.ApiBatchSaveFilesRequest;
import com.yd.oss.feign.response.ApiBatchSaveFilesResponse;
import com.yd.oss.feign.response.ApiGetStsTokenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * OSS-分片接口信息
 *
 * @author zxm
 * @since 2025-07-31
 */
@RestController
@RequestMapping("/sts")
@Validated
public class ApiOssStsController implements ApiOssStsFeignClient {

    @Autowired
    private ApiOssStsService apiOssStsService;

    /**
     * 获取STS凭证
     * @return
     */
    public Result<ApiGetStsTokenResponse> getStsToken(String projectBizId){
        return apiOssStsService.getStsToken(projectBizId);
    }

    /**
     * 批量保存文件列表
     * @return
     */
    @Override
    public Result<ApiBatchSaveFilesResponse> batchSaveFiles(ApiBatchSaveFilesRequest request) {
        return apiOssStsService.batchSaveFiles(request);
    }
}