package com.brframework.commonwebadmin.web.admin;

import com.brframework.commonoss.core.OSSMessage;
import com.brframework.commonweb.json.JSONResult;
import com.brframework.commonwebbase.service.OSSService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * OSS STS 权限
 * @author xu
 * @date 2018/3/9 0009 下午 9:04
 */
@RestController
@Api(tags = "OSS STS权限")
@RequestMapping("/admin/access")
public class AdminSTSController {

    @Autowired
    OSSService ossService;

    @ApiOperation(value = "获取OSS写入权限", notes = "获取OSS写入权限")
    @GetMapping("v1/sts")
    public JSONResult<OSSMessage> stsV1() {
        return JSONResult.ok(ossService.adminSts());
    }

}
