提供手动刷新 token的接口

pull/11/head
3y 3 years ago
parent e13cef7b39
commit 887337eeaf

@ -21,6 +21,7 @@ public enum IdType {
EMAIL(50, "email"),
ENTERPRISE_USER_ID(60, "enterprise_user_id"),
DING_DING_USER_ID(70, "ding_ding_user_id"),
CID(80, "cid"),
;
private Integer code;

@ -0,0 +1,46 @@
package com.java3y.austin.web.controller;
import com.java3y.austin.common.enums.ChannelType;
import com.java3y.austin.common.vo.BasicResultVO;
import com.java3y.austin.cron.handler.RefreshDingDingAccessTokenHandler;
import com.java3y.austin.cron.handler.RefreshGeTuiAccessTokenHandler;
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.RestController;
/**
* @Author 3y
*/
@Api(tags = {"手动刷新token的接口"})
@RestController
public class RefreshTokenController {
@Autowired
private RefreshDingDingAccessTokenHandler refreshDingDingAccessTokenHandler;
@Autowired
private RefreshGeTuiAccessTokenHandler refreshGeTuiAccessTokenHandler;
/**
* TokenchannelTypecom.java3y.austin.common.enums.ChannelType
* @param channelType
* @return
*/
@ApiOperation(value = "手动刷新token", notes = "钉钉/个推 token刷新")
@GetMapping("/refresh")
public BasicResultVO refresh(Integer channelType) {
if (ChannelType.PUSH.getCode().equals(channelType)) {
refreshGeTuiAccessTokenHandler.execute();
}
if (ChannelType.DING_DING_WORK_NOTICE.getCode().equals(channelType)) {
refreshDingDingAccessTokenHandler.execute();
}
return BasicResultVO.success("刷新成功");
}
}
Loading…
Cancel
Save