Skip to content

新增 EndsWith/IsTrue/IsFalse 操作符 - #1487

Merged
Qinyouzeng merged 1 commit into
mainfrom
feat/dynamic-role-operator-types
Sep 23, 2026
Merged

Qinyouzeng merged 1 commit into
mainfrom
feat/dynamic-role-operator-types

Conversation

@MayueCif

Copy link
Copy Markdown
Contributor

在 OperatorType 中新增三个 public static 字段(EndsWith/IsTrue/IsFalse)并在按名创建操作符的映射中加入对应分支(返回相应实例),行为类似已有的 Contains/NotContains。增加私有无参构造函数 private OperatorType() : base(0, "")(保留原有私有带参构造)。新增私有子类实现:EndsWithOperator(id=19,name="EndsWith",EvaluateCondition 使用 data?.EndsWith(value, StringComparison.Ordinal) == true)、IsTrueOperator(id=20,name="IsTrue",EvaluateCondition 使用 bool.TryParse(data, out var b) && b)、IsFalseOperator(id=21,name="IsFalse",EvaluateCondition 使用 bool.TryParse(data, out var b) && !b)。其它现有操作符实现保持不变,默认分支仍返回 new OperatorType()。

在 OperatorType 中新增三个 public static 字段(EndsWith/IsTrue/IsFalse)并在按名创建操作符的映射中加入对应分支(返回相应实例),行为类似已有的 Contains/NotContains。增加私有无参构造函数 private OperatorType() : base(0, "")(保留原有私有带参构造)。新增私有子类实现:EndsWithOperator(id=19,name="EndsWith",EvaluateCondition 使用 data?.EndsWith(value, StringComparison.Ordinal) == true)、IsTrueOperator(id=20,name="IsTrue",EvaluateCondition 使用 bool.TryParse(data, out var b) && b)、IsFalseOperator(id=21,name="IsFalse",EvaluateCondition 使用 bool.TryParse(data, out var b) && !b)。其它现有操作符实现保持不变,默认分支仍返回 new OperatorType()。
@Qinyouzeng
Qinyouzeng merged commit d58c094 into main Sep 23, 2026
1 of 2 checks passed
@MayueCif
MayueCif deleted the feat/dynamic-role-operator-types branch September 23, 2026 06:57
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants