package com.muzhi.dingtalk.test.controller;

import com.muzhi.dingtalk.test.service.DingAccessTokenService;
import io.swagger.annotations.Api;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

@Api(description = "钉钉授权AccessToken")
@RestController
@RequestMapping("/dingservice")
public class AccessTokenController {

    @Autowired
    private DingAccessTokenService dingAccessTokenService;

    //获取钉钉中的access_token（云璞）
    @ApiOperation(value = "获取钉钉中的access_token")
    @GetMapping("getAccessToken")
    public String getAccessToken(){

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

    //获取钉钉中的access_token（牧之测试架构）
    @ApiOperation(value = "获取钉钉中的access_token")
    @GetMapping("getMuZhiAccessToken")
    public String getMuZhiAccessToken(){

        String muZhiAccessToken = dingAccessTokenService.getMuZhiAccessToken();
        return muZhiAccessToken;
    }
}
