| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.muzhi.huanshi.controller;
- import com.muzhi.huanshi.service.AccessTokenService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- 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
- */
- @Api(description = "钉钉授权AccessToken")
- @RestController
- @RequestMapping("/dingservice")
- @CrossOrigin//解决跨域问题
- public class AccessTokenController {
- @Autowired
- private AccessTokenService AccessTokenService;
- //获取钉钉中的access_token(斯曼尔)
- @ApiOperation(value = "获取钉钉中的access_token")
- @GetMapping("getAccessToken")
- public String getAccessToken(){
- String accessToken = AccessTokenService.getAccessToken();
- return accessToken;
- }
- //获取钉钉中的access_token(环世TB应用)
- @ApiOperation(value = "获取钉钉中的access_token")
- @GetMapping("getAppToken")
- public String getAppToken(){
- String AppToken = AccessTokenService.getAppToken();
- return AppToken;
- }
- }
|