1 Commits

Author SHA1 Message Date
pisces
f973faba04 Merge 5b45cfbad7 into 3db9a0dcec 2024-12-10 09:24:28 +08:00
19 changed files with 27 additions and 63 deletions

View File

@@ -15,17 +15,11 @@ jobs:
strategy:
matrix:
java-version: [21] # 定义要测试的JDK版本
java-version: [8, 11, 21] # 定义要测试的JDK版本
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Reset DNF repositories
run: |
cd /etc/yum.repos.d/
@@ -35,11 +29,21 @@ jobs:
- name: Update DNF package index
run: dnf makecache
- name: Install Maven with retry
- name: Install Java and Maven with retry
run: |
if [ ${{ matrix.java-version }} -eq 8 ]; then
for i in {1..5}; do
dnf install -y maven && break || sleep 15
dnf install -y java-1.8.0-openjdk-devel maven && break || sleep 15
done
elif [ ${{ matrix.java-version }} -eq 11 ]; then
for i in {1..5}; do
dnf install -y java-11-openjdk-devel maven && break || sleep 15
done
elif [ ${{ matrix.java-version }} -eq 21 ]; then
for i in {1..5}; do
dnf install -y java-21-openjdk-devel maven && break || sleep 15
done
fi
- name: Verify Java and Maven installation
run: |

View File

@@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java-version: [21] # Define the JDK versions to test
java-version: [8, 11, 21] # Define the JDK versions to test
steps:
- uses: actions/checkout@v2

View File

@@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java-version: [21] # 定义要测试的JDK版本
java-version: [8, 11, 21] # 定义要测试的JDK版本
steps:
- uses: actions/checkout@v2

View File

@@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java-version: [21] # Add JDK 21 to the matrix
java-version: [8, 11, 21] # Add JDK 21 to the matrix
steps:
- uses: actions/checkout@v2

View File

@@ -18,9 +18,6 @@ public class AuthenticationConfig {
@Value("${s2.authentication.include.path:/api}")
private String includePath;
@Value("${s2.authentication.strategy:http}")
private String strategy;
@Value("${s2.authentication.enable:false}")
private boolean enabled;

View File

@@ -7,8 +7,6 @@ import com.tencent.supersonic.common.pojo.User;
public interface UserStrategy {
String getStrategyName();
boolean accept(boolean isEnableAuthentication);
User findUser(HttpServletRequest request, HttpServletResponse response);

View File

@@ -10,13 +10,6 @@ import org.springframework.stereotype.Service;
@Service
public class FakeUserStrategy implements UserStrategy {
public static final String STRATEGY_NAME = "fake";
@Override
public String getStrategyName() {
return STRATEGY_NAME;
}
@Override
public boolean accept(boolean isEnableAuthentication) {
return !isEnableAuthentication;

View File

@@ -15,18 +15,12 @@ import java.util.Optional;
@Service
public class HttpHeaderUserStrategy implements UserStrategy {
public static final String STRATEGY_NAME = "http";
private final TokenService tokenService;
public HttpHeaderUserStrategy(TokenService tokenService) {
this.tokenService = tokenService;
}
@Override
public String getStrategyName() {
return STRATEGY_NAME;
}
@Override
public boolean accept(boolean isEnableAuthentication) {
return isEnableAuthentication;

View File

@@ -9,7 +9,6 @@ import lombok.Data;
import org.springframework.context.annotation.Configuration;
import java.util.List;
import java.util.Optional;
@Configuration
@Data
@@ -27,26 +26,10 @@ public class UserStrategyFactory {
@PostConstruct
public void setUserStrategy() {
boolean enabled = authenticationConfig.isEnabled();
if (!enabled) {
for (UserStrategy userStrategy : userStrategyList) {
if (userStrategy.accept(authenticationConfig.isEnabled())) {
UserHolder.setStrategy(userStrategy);
}
for (UserStrategy userStrategy : userStrategyList) {
if (userStrategy.accept(authenticationConfig.isEnabled())) {
UserHolder.setStrategy(userStrategy);
}
return;
}
String strategy = authenticationConfig.getStrategy();
Optional<UserStrategy> strategyOptional = userStrategyList.stream()
.filter(t -> t.accept(true) && strategy.equalsIgnoreCase(t.getStrategyName()))
.findAny();
if (strategyOptional.isPresent()) {
UserHolder.setStrategy(strategyOptional.get());
} else {
throw new IllegalStateException("strategy is not found: " + strategy);
}
}
}

View File

@@ -8,6 +8,7 @@ import java.util.List;
/** extended information command about model */
@Data
@ToString
public class ChatConfigBaseReq {
private Long modelId;

View File

@@ -4,15 +4,11 @@ import javax.validation.constraints.NotNull;
import com.tencent.supersonic.chat.api.pojo.enums.MemoryReviewResult;
import com.tencent.supersonic.chat.api.pojo.enums.MemoryStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChatMemoryUpdateReq {
@NotNull(message = "id不可为空")

View File

@@ -4,6 +4,7 @@ import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ItemNameVisibility {
private ItemNameVisibilityInfo aggVisibilityInfo;

View File

@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List;
@Data
@ToString
public class ItemNameVisibilityInfo {
/** invisible dimensions */

View File

@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List;
@Data
@ToString
public class ItemVisibility {
/** invisible dimensions */

View File

@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class RecommendedQuestionReq {

View File

@@ -6,6 +6,7 @@ import lombok.ToString;
import java.util.Date;
@ToString
@Data
public class DictLatestTaskResp {

View File

@@ -3,12 +3,10 @@ package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.request.RecommendedQuestionReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RecommendQuestionResp {
private Long modelId;

View File

@@ -1,14 +1,10 @@
package com.tencent.supersonic.chat.api.pojo.response;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SimilarQueryRecallResp {
private Long queryId;

View File

@@ -230,8 +230,7 @@ public class ChatQueryServiceImpl implements ChatQueryService {
return queryResult;
}
private boolean checkMetricReplace(ChatQueryDataReq chatQueryDataReq,
SemanticParseInfo parseInfo) {
private boolean checkMetricReplace(ChatQueryDataReq chatQueryDataReq, SemanticParseInfo parseInfo) {
List<String> oriFields = getFieldsFromSql(parseInfo);
Set<SchemaElement> metrics = chatQueryDataReq.getMetrics();
if (CollectionUtils.isEmpty(oriFields) || CollectionUtils.isEmpty(metrics)) {
@@ -243,7 +242,7 @@ public class ChatQueryServiceImpl implements ChatQueryService {
}
private String replaceFilters(ChatQueryDataReq queryData, SemanticParseInfo parseInfo,
DataSetSchema dataSetSchema) {
DataSetSchema dataSetSchema) {
String correctorSql = parseInfo.getSqlInfo().getCorrectedS2SQL();
log.info("correctorSql before replacing:{}", correctorSql);
// get where filter and having filter