package com.senmesh.common.exception.controller; import com.senmesh.common.exception.dao.ExceptionLogMapper; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 异常日志查看 * * @author on 2019-11-05 */ @RestController @RequestMapping("/anon/exception") @Api(tags = "异常日志查看") public class ExceptionLogController { @Autowired private ExceptionLogMapper exceptionLogMapper; @GetMapping("/{id}") public String getExceptionMsg(@PathVariable Long id) { try { return exceptionLogMapper.selectById(id).getMsg(); } catch (Exception e) { return "未找到对应id错误"; } } }