package com.malk.pake.controller;

import com.malk.service.dingtalk.DDClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ZhangKan
 * @Data 15:03
 */

@RestController
@RequestMapping("/dingservice")
@CrossOrigin//解决跨域问题
public class AccessTokenController {

    @Autowired
    private DDClient ddClient;

    //获取钉钉中的access_token（帕科）
    @GetMapping("getAccessToken")
    public String getAccessToken(){

        String accessToken = ddClient.getAccessToken();
        return accessToken;
    }
}
