mirror of
https://github.com/luoye663/e5.git
synced 2024-12-26 11:48:50 +00:00
调整日志等级
This commit is contained in:
parent
81b245a749
commit
fd52ede2e8
@ -94,7 +94,7 @@ public class Start {
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
log.info("本轮调用完成!");
|
||||
log.debug("本轮调用完成!");
|
||||
}
|
||||
|
||||
/*任务执行*/
|
||||
@ -108,7 +108,7 @@ public class Start {
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("消费数据: " + value);
|
||||
// System.out.println("消费数据: " + value);
|
||||
Task.listen(new OutlookMq(value.getGithubId(), value.getId()));
|
||||
this.cdl.countDown();
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class GithubAuth2AuthenticationConfig extends SecurityConfigurerAdapter<D
|
||||
public void configure(HttpSecurity http) throws Exception {
|
||||
GithubLoginAuthenticationFilter authenticationFilter = new GithubLoginAuthenticationFilter();
|
||||
|
||||
log.info("自定义用户认证处理逻辑");
|
||||
log.debug("自定义用户认证处理逻辑");
|
||||
// 自定义用户认证处理逻辑时,需要指定AuthenticationManager,否则无法认证
|
||||
authenticationFilter.setAuthenticationManager(http.getSharedObject(AuthenticationManager.class));
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
System.out.println("HttpSecurity http");
|
||||
|
||||
/*自定义*/
|
||||
log.info("注册gituhb授权登录");
|
||||
log.debug("注册gituhb授权登录");
|
||||
// http.authorizeRequests().antMatchers("/user/login", "/user/loginFrom", "/auth2/getGithubUrl").permitAll()// 指定相应的请求 不需要验证
|
||||
//// .and()
|
||||
//// .authorizeRequests().antMatchers("/quartz/**").permitAll()//测试
|
||||
@ -89,7 +89,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
return new ObjectPostProcessor<FilterSecurityInterceptor>() {
|
||||
@Override
|
||||
public <O extends FilterSecurityInterceptor> O postProcess(O object) {
|
||||
log.info("加载自定义url权限");
|
||||
log.debug("加载自定义url权限");
|
||||
object.setAccessDecisionManager(myAccessDecisionManager);
|
||||
object.setSecurityMetadataSource(myInvocationSecurityMetadataSourceService);
|
||||
return object;
|
||||
|
@ -56,13 +56,13 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
|
||||
|
||||
@Override
|
||||
public boolean supports(ConfigAttribute configAttribute) {
|
||||
log.info("进入权限判断! ConfigAttribute configAttribute");
|
||||
log.debug("进入权限判断! ConfigAttribute configAttribute");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> aClass) {
|
||||
log.info("进入权限判断! Class<?> aClass");
|
||||
log.debug("进入权限判断! Class<?> aClass");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class UsernamePasswordAuthenticationToken extends AbstractAuthenticationT
|
||||
super(null);
|
||||
this.code = code;
|
||||
super.setAuthenticated(false);
|
||||
logger.info("创建未认证的用户名密码认证对象1 setAuthenticated ->false loading ...");
|
||||
logger.debug("创建未认证的用户名密码认证对象1 setAuthenticated ->false loading ...");
|
||||
}
|
||||
|
||||
// 创建未认证的用户名密码认证对象
|
||||
@ -53,7 +53,7 @@ public class UsernamePasswordAuthenticationToken extends AbstractAuthenticationT
|
||||
this.code = code;
|
||||
this.state = state;
|
||||
super.setAuthenticated(false);
|
||||
logger.info("创建未认证的用户名密码认证对象2 setAuthenticated ->false loading ...");
|
||||
logger.debug("创建未认证的用户名密码认证对象2 setAuthenticated ->false loading ...");
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class GithubLoginAuthenticationFilter extends AbstractAuthenticationProce
|
||||
|
||||
@Override
|
||||
public Authentication attemptAuthentication(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws AuthenticationException, IOException, ServletException {
|
||||
log.info("接收github回调参数!");
|
||||
log.debug("接收github回调参数!");
|
||||
/*if (!httpServletRequest.getMethod().equals(HttpMethod.POST.name())) {
|
||||
throw new AuthenticationServiceException("不支持该验证方法: " + httpServletRequest.getMethod());
|
||||
} else {
|
||||
|
@ -46,7 +46,6 @@ public class GithubServiceImpl extends ServiceImpl<GithubMapper, Github> impleme
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(s);
|
||||
Map<String, String> map = StringUtil.ParsingUrl(s);
|
||||
return map.get("access_token");
|
||||
}
|
||||
@ -57,7 +56,6 @@ public class GithubServiceImpl extends ServiceImpl<GithubMapper, Github> impleme
|
||||
head.put("Authorization", "token " + access_token);
|
||||
head.put("Content-Type", "application/vnd.github.machine-man-preview+json");
|
||||
String s = OkHttpClientUtil.doGet("https://api.github.com/user/emails", null,head, null);
|
||||
System.out.println(s);
|
||||
JSONArray jsonArray = JSON.parseArray(s);
|
||||
if (!jsonArray.isEmpty()) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
|
@ -61,7 +61,7 @@ public class OutlookServiceImpl extends ServiceImpl<OutlookMapper, Outlook> impl
|
||||
par.put("grant_type", grant_type);
|
||||
String s = OkHttpClientUtil.doPost("https://login.microsoftonline.com/" + tenantId + "/oauth2/v2.0/token", head, par);
|
||||
JSONObject jsonObject = JSON.parseObject(s);
|
||||
logger.info("请求access_token返回数据:" + s);
|
||||
logger.debug("请求access_token返回数据:" + s);
|
||||
if (jsonObject.get("error") != null) {
|
||||
logger.error("错授权误!");
|
||||
throw new APIException(jsonObject.get("error_description").toString());
|
||||
@ -102,7 +102,7 @@ public class OutlookServiceImpl extends ServiceImpl<OutlookMapper, Outlook> impl
|
||||
outlook.setName(name);
|
||||
outlook.setDescribes(describe);
|
||||
outlook.setGithubId(github_id);
|
||||
logger.info(outlook.toString());
|
||||
logger.debug(outlook.toString());
|
||||
if (baseMapper.insert(outlook) != 1) {
|
||||
throw new APIException(APiCode.OUTLOOK_INSERT_ERROR);
|
||||
}
|
||||
@ -233,7 +233,7 @@ public class OutlookServiceImpl extends ServiceImpl<OutlookMapper, Outlook> impl
|
||||
if (!errorCheck(message)) {
|
||||
throw new Exception("无法刷新令牌!code:3" + message);
|
||||
}
|
||||
logger.info("令牌过期!");
|
||||
logger.debug("令牌过期!");
|
||||
/*刷新令牌*/
|
||||
String token = refresh_token(outlook);
|
||||
if (token == null) {
|
||||
@ -320,10 +320,10 @@ public class OutlookServiceImpl extends ServiceImpl<OutlookMapper, Outlook> impl
|
||||
par.put("refresh_token", outlook.getRefreshToken());
|
||||
String s = null;
|
||||
s = OkHttpClientUtil.doPost("https://login.microsoftonline.com/" + outlook.getTenantId() + "/oauth2/v2.0/token", head, par);
|
||||
logger.info("请求刷新列表返回数据:" + s);
|
||||
logger.debug("请求刷新列表返回数据:" + s);
|
||||
JSONObject jsonObject = JSON.parseObject(s);
|
||||
if (!jsonObject.containsKey("access_token")) {
|
||||
logger.info("返回的access_token字段不存在");
|
||||
logger.debug("返回的access_token字段不存在");
|
||||
throw new Exception("返回的access_token字段不存在,无法刷新令牌! 需要重新授权!");
|
||||
}
|
||||
outlook.setRefreshToken(jsonObject.getString("refresh_token"));
|
||||
@ -332,7 +332,7 @@ public class OutlookServiceImpl extends ServiceImpl<OutlookMapper, Outlook> impl
|
||||
QueryWrapper<Outlook> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("client_id", outlook.getClientId());
|
||||
if (baseMapper.update(outlook, queryWrapper) != 1) {
|
||||
logger.info("返更新行数不为1");
|
||||
logger.debug("返更新行数不为1");
|
||||
throw new Exception("更新数据库时发现有重复的key");
|
||||
}
|
||||
return outlook.getAccessToken();
|
||||
|
@ -17,7 +17,6 @@ public class StringUtil {
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
String[] split1 = split[i].split("=");
|
||||
if (split1.length > 1) {
|
||||
System.out.println(split1[0] + " --- " + split1[1]);
|
||||
map.put(split1[0], split1[1]);
|
||||
} else {
|
||||
map.put(split1[0], "");
|
||||
|
@ -84,7 +84,7 @@
|
||||
<loggers>
|
||||
<!--过滤掉spring和hibernate的一些无用的debug信息-->
|
||||
<logger name="org.springframework" level="INFO"/>
|
||||
<logger name="io.qyi.e5" level="debug"/>
|
||||
<logger name="io.qyi.e5" level="INFO"/>
|
||||
<logger name="org.mybatis" level="INFO">
|
||||
<!-- 添加如下设置,控制台会再打印一次 -->
|
||||
<AppenderRef ref="Console"/>
|
||||
|
@ -55,7 +55,6 @@ public class influxdb2Test {
|
||||
.addFields(beanMap);
|
||||
list1.add(point);
|
||||
});
|
||||
System.out.println("list 大小:" + list1.size());
|
||||
Map<String, Object> aa = new HashMap<>();
|
||||
aa.put("a1", 1);
|
||||
writeApi.writePoint("e5", org, list1.get(0));
|
||||
@ -125,9 +124,7 @@ public class influxdb2Test {
|
||||
|
||||
for (FluxRecord fluxRecord : records) {
|
||||
// System.out.println(fluxRecord.getField());
|
||||
System.out.println(fluxRecord.getField() + " ->" + fluxRecord.getValueByKey("_value"));
|
||||
}
|
||||
System.out.println("------------------------------------------");
|
||||
}
|
||||
influxDBClient.close();
|
||||
}
|
||||
@ -140,16 +137,13 @@ public class influxdb2Test {
|
||||
"|> filter(fn: (r) => r[\"outlookId\"] == \"38\")" +
|
||||
"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")";
|
||||
QueryApi queryApi = influxDBClient.getQueryApi();
|
||||
System.out.println(System.currentTimeMillis());
|
||||
List<OutlookLog> tables = queryApi.query(flux, org, OutlookLog.class);
|
||||
System.out.println(System.currentTimeMillis());
|
||||
for (OutlookLog table : tables) {
|
||||
if (table.getMsg() == null) {
|
||||
continue;
|
||||
}
|
||||
// System.out.println(table);
|
||||
}
|
||||
System.out.println("tables 大小:" + tables.size());
|
||||
influxDBClient.close();
|
||||
}
|
||||
|
||||
@ -163,11 +157,9 @@ public class influxdb2Test {
|
||||
QueryApi queryApi = influxDBClient.getQueryApi();
|
||||
queryApi.query(flux, org, OutlookLog.class, (cancellable, outlookLog) -> {
|
||||
if (outlookLog.getMsg() != null) {
|
||||
System.out.println(outlookLog);
|
||||
}
|
||||
|
||||
});
|
||||
System.out.println("查询完成");
|
||||
Thread.sleep(5_000);
|
||||
influxDBClient.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user