-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support users in searching for all users and groups by name in turms-…
…service #1431
- Loading branch information
1 parent
c53c47a
commit d14e168
Showing
78 changed files
with
4,337 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...er/common/infra/property/env/service/env/elasticsearch/ElasticsearchClientProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2019 The Turms Project | ||
* https://github.com/turms-im/turms | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.turms.server.common.infra.property.env.service.env.elasticsearch; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import im.turms.server.common.infra.property.metadata.Description; | ||
|
||
/** | ||
* @author James Chen | ||
*/ | ||
@AllArgsConstructor | ||
@Builder(toBuilder = true) | ||
@Data | ||
@NoArgsConstructor | ||
public class ElasticsearchClientProperties { | ||
|
||
@Description("Elasticsearch URI") | ||
private String uri = "http://localhost:9200"; | ||
|
||
@Description("Elasticsearch HTTP request headers") | ||
private List<HttpHeaderProperties> requestHeaders = Collections.emptyList(); | ||
|
||
@Description("Elasticsearch username") | ||
private String username = "elastic"; | ||
|
||
@Description("Elasticsearch password") | ||
private String password = ""; | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...mon/infra/property/env/service/env/elasticsearch/ElasticsearchGroupUseCaseProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2019 The Turms Project | ||
* https://github.com/turms-im/turms | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.turms.server.common.infra.property.env.service.env.elasticsearch; | ||
|
||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
/** | ||
* @author James Chen | ||
*/ | ||
@AllArgsConstructor | ||
@SuperBuilder(toBuilder = true) | ||
@Data | ||
@NoArgsConstructor | ||
public class ElasticsearchGroupUseCaseProperties extends ElasticsearchUseCaseProperties { | ||
|
||
private List<ElasticsearchIndexProperties> indexes = | ||
List.of(new ElasticsearchIndexProperties()); | ||
|
||
} |
55 changes: 55 additions & 0 deletions
55
...ver/common/infra/property/env/service/env/elasticsearch/ElasticsearchIndexProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (C) 2019 The Turms Project | ||
* https://github.com/turms-im/turms | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.turms.server.common.infra.property.env.service.env.elasticsearch; | ||
|
||
import jakarta.validation.constraints.Min; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.boot.context.properties.NestedConfigurationProperty; | ||
|
||
import im.turms.server.common.infra.property.metadata.Description; | ||
|
||
/** | ||
* @author James Chen | ||
*/ | ||
@AllArgsConstructor | ||
@Builder(toBuilder = true) | ||
@Data | ||
@NoArgsConstructor | ||
public class ElasticsearchIndexProperties { | ||
|
||
@Description("The index will be created for the specified language. " | ||
+ "If the language is NONE, this index will be used as the default index for all languages that don't have a specified index for them") | ||
private LanguageCode code = LanguageCode.NONE; | ||
|
||
@Description("The number of shards. -1 means use the default value") | ||
@Min(-1) | ||
private int numberOfShards = -1; | ||
|
||
@Description("The number of replicas. -1 means use the default value") | ||
@Min(-1) | ||
private int numberOfReplicas = -1; | ||
|
||
@NestedConfigurationProperty | ||
private ElasticsearchIndexPropertiesProperties properties = | ||
new ElasticsearchIndexPropertiesProperties(); | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...a/property/env/service/env/elasticsearch/ElasticsearchIndexPropertiesFieldProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2019 The Turms Project | ||
* https://github.com/turms-im/turms | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.turms.server.common.infra.property.env.service.env.elasticsearch; | ||
|
||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* @author James Chen | ||
*/ | ||
@AllArgsConstructor | ||
@Builder(toBuilder = true) | ||
@Data | ||
@NoArgsConstructor | ||
public class ElasticsearchIndexPropertiesFieldProperties { | ||
|
||
private List<ElasticsearchIndexTextFieldProperties> textFields = | ||
List.of(new ElasticsearchIndexTextFieldProperties()); | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
.../infra/property/env/service/env/elasticsearch/ElasticsearchIndexPropertiesProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2019 The Turms Project | ||
* https://github.com/turms-im/turms | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.turms.server.common.infra.property.env.service.env.elasticsearch; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
import org.springframework.boot.context.properties.NestedConfigurationProperty; | ||
|
||
/** | ||
* @author James Chen | ||
*/ | ||
@AllArgsConstructor | ||
@SuperBuilder(toBuilder = true) | ||
@Data | ||
@NoArgsConstructor | ||
public class ElasticsearchIndexPropertiesProperties { | ||
|
||
@NestedConfigurationProperty | ||
private ElasticsearchIndexPropertiesFieldProperties name = | ||
new ElasticsearchIndexPropertiesFieldProperties(); | ||
|
||
} |
Oops, something went wrong.