package com.huimv.video.dhicc.test.controller;

import com.huimv.video.dhicc.test.request.GetPublicKeyRes;
import com.huimv.video.dhicc.test.response.GetTokenResponse;
import com.huimv.video.dhicc.test.service.IOauthService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 鉴权相关接口
 */
@RestController
@RequestMapping("/oauth")
public class OauthController {
    public static final Logger logger = LoggerFactory.getLogger(OauthController.class);

    @Autowired
    public IOauthService oauthService;

    /**
     * 获取公钥
     * **/
    @GetMapping("/get-public-key")
    public GetPublicKeyRes getPublicKey(){
        return oauthService.getPublicKey();
    }

    /**
     * 获取token
     * **/
    @GetMapping("/get-tokenTest01")
    public String getTokenTest01(@RequestBody Map<String,String> paramsMap){
        return oauthService.getTokenTest01(paramsMap);
    }
   /* *//**
     * 获取token
     * **//*
    @GetMapping("/get-tokenTest02")
    public GetTokenResponse getTokenTest02(){

        return oauthService.getTokenTest02();
    }*/

}
