package com.zanxiang.game.module.manage.controller.api;

import com.zanxiang.module.oss.pojo.OssUploadCallback;
import com.zanxiang.module.oss.pojo.dto.OssUploadDTO;
import com.zanxiang.module.oss.service.IOssService;
import com.zanxiang.module.util.pojo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : lingfeng
 * @time : 2023-06-27
 * @description : oss回调api
 */
@Api(tags = {"oss相关接口管理"})
@RestController
@RequestMapping("/api/oss")
@Slf4j
public class OssCallBackApi {

    @Autowired
    private IOssService ossService;

    @ApiOperation(value = "oss回传接口")
    @PostMapping("/callback")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = OssUploadCallback.class)})
    public ResultVO<OssUploadCallback> ossCallback(@RequestBody OssUploadDTO dto) {
        return ResultVO.ok(ossService.callback(dto));
    }
}
