Skip to content

Commit 16a7889

Browse files
authored
Новые типы MDO и тесты для 25-27 (#533)
* add 8.3.25 fixture * add 8.3.27 fixture * 1. Добавлена реализация нового типа WebSocketClient 2. реализовано чтение дочерних типов для ExternalDataSource * исключения ревью для AI
1 parent 45f4a68 commit 16a7889

File tree

713 files changed

+89456
-794
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

713 files changed

+89456
-794
lines changed

.coderabbit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reviews:
2+
path_filters:
3+
- "!src/test/resources/**"

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dependencies {
5959

6060
// прочее
6161
implementation("commons-io", "commons-io", "2.18.0")
62-
implementation("io.github.1c-syntax", "bsl-common-library", "0.9.0.18-SNAPSHOT")
62+
implementation("io.github.1c-syntax", "bsl-common-library", "0.9.0.21-SNAPSHOT")
6363
implementation("io.github.1c-syntax", "utils", "0.6.3")
6464
implementation("io.github.1c-syntax", "supportconf", "0.15.0.7-SNAPSHOT") {
6565
exclude("io.github.1c-syntax", "bsl-common-library")

src/main/java/com/github/_1c_syntax/bsl/mdclasses/Configuration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import com.github._1c_syntax.bsl.mdo.Task;
7171
import com.github._1c_syntax.bsl.mdo.WSReference;
7272
import com.github._1c_syntax.bsl.mdo.WebService;
73+
import com.github._1c_syntax.bsl.mdo.WebSocketClient;
7374
import com.github._1c_syntax.bsl.mdo.XDTOPackage;
7475
import com.github._1c_syntax.bsl.mdo.support.ApplicationRunMode;
7576
import com.github._1c_syntax.bsl.mdo.support.DataLockControlMode;
@@ -202,6 +203,8 @@ public class Configuration implements CF {
202203
@Singular
203204
List<WebService> webServices;
204205
@Singular
206+
List<WebSocketClient> webSocketClients;
207+
@Singular
205208
List<HTTPService> httpServices;
206209
@Singular
207210
List<WSReference> wsReferences;

src/main/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationExtension.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import com.github._1c_syntax.bsl.mdo.Task;
7171
import com.github._1c_syntax.bsl.mdo.WSReference;
7272
import com.github._1c_syntax.bsl.mdo.WebService;
73+
import com.github._1c_syntax.bsl.mdo.WebSocketClient;
7374
import com.github._1c_syntax.bsl.mdo.XDTOPackage;
7475
import com.github._1c_syntax.bsl.mdo.support.ApplicationRunMode;
7576
import com.github._1c_syntax.bsl.mdo.support.ConfigurationExtensionPurpose;
@@ -195,6 +196,8 @@ public class ConfigurationExtension implements CF {
195196
@Singular
196197
List<WebService> webServices;
197198
@Singular
199+
List<WebSocketClient> webSocketClients;
200+
@Singular
198201
List<HTTPService> httpServices;
199202
@Singular
200203
List<WSReference> wsReferences;

src/main/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTree.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import com.github._1c_syntax.bsl.mdo.Task;
6969
import com.github._1c_syntax.bsl.mdo.WSReference;
7070
import com.github._1c_syntax.bsl.mdo.WebService;
71+
import com.github._1c_syntax.bsl.mdo.WebSocketClient;
7172
import com.github._1c_syntax.bsl.mdo.XDTOPackage;
7273

7374
import java.util.List;
@@ -666,4 +667,16 @@ default Optional<Task> findTask(Predicate<? super Task> predicate) {
666667
default Optional<ExternalDataSource> findExternalDataSource(Predicate<? super ExternalDataSource> predicate) {
667668
return getExternalDataSources().stream().filter(predicate).findFirst();
668669
}
670+
671+
/**
672+
* WebSocket-клиенты
673+
*/
674+
List<WebSocketClient> getWebSocketClients();
675+
676+
/**
677+
* Поиск WebSocket-клиента по условию
678+
*/
679+
default Optional<WebSocketClient> findWebSocketClient(Predicate<? super WebSocketClient> predicate) {
680+
return getWebSocketClients().stream().filter(predicate).findFirst();
681+
}
669682
}

src/main/java/com/github/_1c_syntax/bsl/mdo/ExternalDataSource.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
package com.github._1c_syntax.bsl.mdo;
2323

24+
import com.github._1c_syntax.bsl.mdo.children.ExternalDataSourceCube;
25+
import com.github._1c_syntax.bsl.mdo.children.ExternalDataSourceFunction;
2426
import com.github._1c_syntax.bsl.mdo.children.ExternalDataSourceTable;
2527
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
2628
import com.github._1c_syntax.bsl.mdo.support.RoleRight;
@@ -66,6 +68,7 @@ public class ExternalDataSource implements MDObject, ChildrenOwner, AccessRights
6668
@Default
6769
SupportVariant supportVariant = SupportVariant.NONE;
6870

71+
Lazy<List<MD>> children = new Lazy<>(this::computeChildren);
6972
Lazy<List<MD>> plainChildren = new Lazy<>(this::computePlainChildren);
7073

7174
/*
@@ -78,17 +81,27 @@ public class ExternalDataSource implements MDObject, ChildrenOwner, AccessRights
7881
@Singular
7982
List<ExternalDataSourceTable> tables;
8083

84+
/**
85+
* Функции
86+
*/
87+
@Singular
88+
List<ExternalDataSourceFunction> functions;
89+
90+
/**
91+
* Кубы
92+
*/
93+
@Singular
94+
List<ExternalDataSourceCube> cubes;
95+
8196
/**
8297
* Пояснение
8398
*/
8499
@Default
85100
MultiLanguageString explanation = MultiLanguageString.EMPTY;
86101

87-
// todo сделать функции и кубы
88-
89102
@Override
90103
public List<MD> getChildren() {
91-
return Collections.unmodifiableList(tables);
104+
return children.getOrCompute();
92105
}
93106

94107
@Override
@@ -103,6 +116,10 @@ public static List<RoleRight> possibleRights() {
103116
return POSSIBLE_RIGHTS;
104117
}
105118

119+
private List<MD> computeChildren() {
120+
return LazyLoader.computeChildren(this);
121+
}
122+
106123
private List<MD> computePlainChildren() {
107124
return LazyLoader.computePlainChildren(this);
108125
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2025
5+
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.mdo;
23+
24+
import com.github._1c_syntax.bsl.mdo.support.ObjectBelonging;
25+
import com.github._1c_syntax.bsl.support.SupportVariant;
26+
import com.github._1c_syntax.bsl.types.MdoReference;
27+
import com.github._1c_syntax.bsl.types.MultiLanguageString;
28+
import lombok.Builder;
29+
import lombok.Builder.Default;
30+
import lombok.EqualsAndHashCode;
31+
import lombok.ToString;
32+
import lombok.Value;
33+
34+
import java.util.Collections;
35+
import java.util.List;
36+
37+
@Value
38+
@Builder
39+
@ToString(of = {"name", "uuid"})
40+
@EqualsAndHashCode(of = {"name", "uuid"})
41+
public class WebSocketClient implements MDObject, ModuleOwner {
42+
/*
43+
* MDObject
44+
*/
45+
46+
@Default
47+
String uuid = "";
48+
@Default
49+
String name = "";
50+
@Default
51+
MdoReference mdoReference = MdoReference.EMPTY;
52+
@Default
53+
ObjectBelonging objectBelonging = ObjectBelonging.OWN;
54+
@Default
55+
String comment = "";
56+
@Default
57+
MultiLanguageString synonym = MultiLanguageString.EMPTY;
58+
@Default
59+
SupportVariant supportVariant = SupportVariant.NONE;
60+
61+
/*
62+
* ModuleOwner
63+
*/
64+
65+
@Default
66+
List<Module> modules = Collections.emptyList();
67+
68+
/*
69+
* Свое
70+
*/
71+
72+
/**
73+
* Предопределенный
74+
*/
75+
boolean predefined;
76+
77+
/**
78+
* Подключать автоматически
79+
*/
80+
boolean autoConnect;
81+
82+
/**
83+
* URI сервера
84+
*/
85+
@Default
86+
String serverURL = "";
87+
88+
/**
89+
* Таймаут
90+
*/
91+
int timeout;
92+
93+
}

0 commit comments

Comments
 (0)