添加日志
This commit is contained in:
1 parent
9c29db1245
commit
13ba3a5fdb
1 file changed
+3
-1
@@ -3,8 +3,9 @@ package com.ruoyi.system.controller;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.system.service.TelegramAuditService;
|
import com.ruoyi.system.service.TelegramAuditService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/auth/telegram")
|
@RequestMapping("/auth/telegram")
|
||||||
public class TelegramAuditController {
|
public class TelegramAuditController {
|
||||||
@@ -16,6 +17,7 @@ public class TelegramAuditController {
|
|||||||
|
|
||||||
@PostMapping("/webhook")
|
@PostMapping("/webhook")
|
||||||
public AjaxResult webhook(@RequestHeader(value = "X-Telegram-Bot-Api-Secret-Token", required = false) String secret, @RequestBody JSONObject update) {
|
public AjaxResult webhook(@RequestHeader(value = "X-Telegram-Bot-Api-Secret-Token", required = false) String secret, @RequestBody JSONObject update) {
|
||||||
|
log.info("telegram webhook " + update.toJSONString() + " secret = {}",secret);
|
||||||
if (!service.matchesSecret(secret)) return AjaxResult.error("非法请求");
|
if (!service.matchesSecret(secret)) return AjaxResult.error("非法请求");
|
||||||
service.handleUpdate(update);
|
service.handleUpdate(update);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
|||||||
Reference in new issue
Block a user