jd-cqhttp-robot/src/main/java/io/lxh/cqhttp/controller/NotifyController.java

27 lines
779 B
Java

package io.lxh.cqhttp.controller;
import io.lxh.cqhttp.entity.vo.NotifyVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("/qq")
public class NotifyController {
@PostMapping("")
public void notify(@RequestBody NotifyVO body) {
if ("heartbeat".equals(body.getMetaEventType())) {
log.debug("收到[{}]的心跳事件", body.getSelfId());
} else {
log.warn("QQ回调内容: {}", body);
}
}
}