Skip to content

Commit

Permalink
remove_task_config_field (#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyoungh authored Aug 11, 2023
1 parent a497d7e commit c3c35e8
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 225 deletions.
15 changes: 1 addition & 14 deletions dinky-admin/src/main/java/org/dinky/configure/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.dinky.configure;

import org.dinky.data.annotation.PublicInterface;
import org.dinky.data.constant.BaseConstant;
import org.dinky.interceptor.LocaleChangeInterceptor;
import org.dinky.interceptor.TenantInterceptor;
Expand All @@ -28,7 +27,6 @@

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down Expand Up @@ -105,18 +103,7 @@ public void addInterceptors(InterceptorRegistry registry) {
// .excludePathPatterns("/druid/**")
// .excludePathPatterns("/openapi/**");

registry.addInterceptor(
new SaInterceptor(
handler -> {
if (handler instanceof HandlerMethod) {
if (((HandlerMethod) handler)
.getMethodAnnotation(PublicInterface.class)
!= null) {
return;
}
StpUtil.checkLogin();
}
}))
registry.addInterceptor(new SaInterceptor(handler -> StpUtil.checkLogin()))
.addPathPatterns("/api/**")
.excludePathPatterns(
"/api/login", "/api/ldap/ldapEnableStatus",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.dinky.controller;

import org.dinky.data.annotation.Log;
import org.dinky.data.annotation.PublicInterface;
import org.dinky.data.dto.GitProjectDTO;
import org.dinky.data.dto.TreeNodeDTO;
import org.dinky.data.enums.BusinessType;
Expand All @@ -41,7 +40,6 @@

import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
Expand Down Expand Up @@ -227,8 +225,6 @@ public Result<Void> buildGitProject(@RequestParam("id") Integer id) {
* @return {@link Result} of {@link Void}
*/
@GetMapping(path = "/build-step-logs", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
@CrossOrigin("*")
@PublicInterface
@Log(title = "GitProject Build Step Logs", businessType = BusinessType.QUERY)
@ApiOperation("GitProject Build Step Logs")
public SseEmitter buildStepLogs(@RequestParam("id") Integer id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.dinky.controller;

import org.dinky.data.annotation.Log;
import org.dinky.data.annotation.PublicInterface;
import org.dinky.data.dto.MetricsLayoutDTO;
import org.dinky.data.enums.BusinessType;
import org.dinky.data.model.Metrics;
Expand Down Expand Up @@ -65,7 +64,6 @@ public Result<List<MetricsVO>> getData(@RequestParam Long startTime, Long endTim
}

@GetMapping(value = "/getLastUpdateData", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
@PublicInterface
@ApiOperation("Get Last Update Data")
public SseEmitter getLastUpdateData(Long lastTime) {
SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@

package org.dinky.controller;

import org.dinky.data.annotation.PublicInterface;
import org.dinky.service.MonitorService;
import org.dinky.sse.SseEmitterUTF8;

import java.util.concurrent.TimeUnit;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -44,8 +42,6 @@ public class SseController {
private final MonitorService monitorService;

@GetMapping(value = "/getLastUpdateData", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
@CrossOrigin("*")
@PublicInterface
@ApiOperation("Get Last Update Data")
public SseEmitter getLastUpdateData(Long lastTime) {
SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30));
Expand All @@ -54,8 +50,6 @@ public SseEmitter getLastUpdateData(Long lastTime) {
}

@GetMapping(value = "/getJvmInfo", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
@CrossOrigin("*")
@PublicInterface
@ApiOperation("Get JVM Info")
public SseEmitter getJvmInfo(Long lastTime) {
SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@

import org.dinky.assertion.Asserts;
import org.dinky.context.TenantContextHolder;
import org.dinky.data.annotation.PublicInterface;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.AsyncHandlerInterceptor;

import cn.dev33.satoken.SaManager;
import cn.dev33.satoken.exception.NotLoginException;
import cn.hutool.core.lang.Opt;
import lombok.extern.slf4j.Slf4j;

Expand Down Expand Up @@ -62,14 +59,6 @@ public boolean preHandle(
}
}
}
if (!isPass) {
if (handler instanceof HandlerMethod) {
if (((HandlerMethod) handler).getMethodAnnotation(PublicInterface.class) != null) {
return true;
}
}
throw new NotLoginException("请先登录", "login", "login");
}
return AsyncHandlerInterceptor.super.preHandle(request, response, handler);
}
}
Loading

0 comments on commit c3c35e8

Please sign in to comment.