CallbackController.java 654 B

12345678910111213141516171819202122
  1. package com.fjhx.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.fjhx.entity.Message;
  4. import lombok.extern.slf4j.Slf4j;
  5. import org.springframework.web.bind.annotation.PostMapping;
  6. import org.springframework.web.bind.annotation.RequestBody;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RestController;
  9. @Slf4j
  10. @RestController
  11. @RequestMapping("/callback")
  12. public class CallbackController {
  13. @PostMapping("/163email")
  14. public String email(@RequestBody Message message) {
  15. log.error("接收到新邮件:{}", JSON.toJSONString(message));
  16. return "ok";
  17. }
  18. }