feat:token 更新消息

This commit is contained in:
Xiang
2025-12-18 10:30:45 +08:00
parent 4bc549eebe
commit f3637a80f2

View File

@@ -1,5 +1,6 @@
package com.xiang.xservice.application.script.jntyzx.controller;
import com.xiang.xservice.application.script.jntyzx.service.DingTalkScriptVenueService;
import com.xiang.xservice.application.script.jntyzx.service.IUserTokenInfoService;
import com.xiang.xservice.basic.common.resp.Result;
import lombok.RequiredArgsConstructor;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
public class TokenFreshController {
private final IUserTokenInfoService userTokenInfoService;
private final DingTalkScriptVenueService dingTalkScriptVenueService;
@GetMapping("/freshToken")
public Result<Void> freshToken() {
@@ -27,7 +29,9 @@ public class TokenFreshController {
@GetMapping("/freshTokenOnline")
public Result<Void> freshTokenOnline(@RequestParam("token") String token, @RequestParam("name") String name) {
userTokenInfoService.updateTokenByName(name, token);
if (userTokenInfoService.updateTokenByName(name, token)) {
dingTalkScriptVenueService.sendScriptMsg(name + "token更新成功");
}
return Result.success();
}
}