package com.hc.gpweb.controller.common;

import com.hc.gpcore.utils.oss.QiNiuUtil;
import com.hc.gpcore.utils.result.Result;
import io.swagger.annotations.ApiOperation;
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;

/**
 * @author JIA
 */

@RestController
@RequestMapping("/api/common")
public class CommonController {

    private final QiNiuUtil qiNiuUtil;

    @Autowired
    public CommonController(QiNiuUtil qiNiuUtil) {
        this.qiNiuUtil = qiNiuUtil;
    }

    @GetMapping("/upToken")
    @ApiOperation(value = "", response = Result.class)
    public Result getUpToken() {
        return Result.success(qiNiuUtil.getUpToken());
    }

}

