Commit d167913d authored by 贷前—徐菲's avatar 贷前—徐菲

整合sentry

parent 08b42294
......@@ -312,6 +312,11 @@
<artifactId>quantgroup-sms-sdk</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring</artifactId>
<version>1.6.3</version>
</dependency>
</dependencies>
......
......@@ -4,6 +4,7 @@ import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import com.weibo.api.motan.common.MotanConstants;
import com.weibo.api.motan.util.MotanSwitcherUtil;
import io.sentry.Sentry;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
......@@ -45,5 +46,7 @@ public class Bootstrap {
springApplication.setRegisterShutdownHook(true);
springApplication.run(args);
log.info("server start...");
Sentry.init("http://13ef5642903a414c910f8d0e0a2c56ee:8b351ad1abf44de3b4c25f39105fb927@172.16.4.89:9000/6");
}
}
package cn.quantgroup.xyqb.config.sentry;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.HandlerExceptionResolver;
/**
* @author xufei on 2017/12/27.
*/
@Controller
@EnableAutoConfiguration
@SpringBootApplication
public class SentryConfig {
@Bean
public HandlerExceptionResolver sentryExceptionResolver() {
return new io.sentry.spring.SentryExceptionResolver();
}
@Bean
public ServletContextInitializer sentryServletContextInitializer() {
return new io.sentry.spring.SentryServletContextInitializer();
}
}
......@@ -31,10 +31,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.sql.Timestamp;
......@@ -975,6 +972,7 @@ public class InnerController implements IBaseController {
@RequestMapping("/updateIdCard")
public JsonResult updateIdCard(@RequestParam(required = false)String name, @RequestParam(required = false)String idNo,
@RequestParam String phoneNo, @RequestParam String reason, @RequestParam String content) {
int x = 1 / 0;
//密文
if (null != content) {
content = content.replaceAll(" ", "+");
......@@ -1056,4 +1054,11 @@ public class InnerController implements IBaseController {
}
return pwd.toString();
}
@RequestMapping("/home")
String home() {
int x = 1 / 0;
return "Hello World!";
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment