refactor: 删除仅有空构造器的 public init() {}——编译器自动提供无参构造

删除(类无其他构造器):
- SimApiBaseModel / SimApiLoggerProvider / SimApiSignProviderBase / AesBodyProviderBase
- SimApiResponseFilter / SimApiAuthCenterOptions / SimApiExceptionOptions
- SimApiHttpClientOptions / SimApiOptions / SimApiSynapseOptions / SimApiRouteOptions
- SimApiStorageOptions / SimApiRequestLogOptions / SimApiJobServer / SimApiAuthOption
- AuthDto 5 个纯 POCO(AppAndProfileItem/ConfirmResponse/LoginInfoResponse/
  GroupRelatedItem/GroupDetailTreeNode)/ AesBodyRequest

保留(有带参构造器,空 init 是反序列化/绑定必需):
- GetCodeResponse / PermissionItem / SimApiBaseRequest 系列 / PageResponse
- SimApiLoginItem / SimApiDocGroup / SimApiStorage 相关 / 各 DTO
This commit is contained in:
2026-08-18 00:59:48 +08:00
parent 6e6b21ff83
commit ea31bd9b6a
18 changed files with 9 additions and 39 deletions
+9 -9
View File
@@ -1,20 +1,20 @@
version = 0 version = 0
[requires] [requires]
soulsoft_web_http = {version = "1.0.20260528"}
soulsoft_extensions_hosting = {version = "1.0.20260528"} soulsoft_extensions_hosting = {version = "1.0.20260528"}
soulsoft_web_routing = {version = "1.0.20260528"} soulsoft_web_http = {version = "1.0.20260528"}
soulsoft_web_hosting = {version = "1.0.20260528"} soulsoft_web_hosting = {version = "1.0.20260528"}
soulsoft_web_mvc = {version = "1.0.20260528"}
soulsoft_extensions_injection = {version = "1.0.20260528"}
soulsoft_web_cors = {version = "1.0.20260528"}
soulsoft_extensions_options = {version = "1.0.20260528"}
soulsoft_extensions_logging = {version = "1.0.20260528"} soulsoft_extensions_logging = {version = "1.0.20260528"}
soulsoft_serialization = {version = "1.0.20260528"} soulsoft_extensions_options_configuration = {version = "1.0.20260528"}
soulsoft_web_routing = {version = "1.0.20260528"}
soulsoft_extensions_logging_console = {version = "1.0.20260528"} soulsoft_extensions_logging_console = {version = "1.0.20260528"}
soulsoft_serialization = {version = "1.0.20260528"}
soulsoft_net_http = {version = "1.0.20260528"} soulsoft_net_http = {version = "1.0.20260528"}
soulsoft_web_mvc = {version = "1.0.20260528"}
soulsoft_extensions_logging_configuration = {version = "1.0.20260528"} soulsoft_extensions_logging_configuration = {version = "1.0.20260528"}
soulsoft_identity_claims = {version = "1.0.20260528"} soulsoft_identity_claims = {version = "1.0.20260528"}
soulsoft_extensions_options_configuration = {version = "1.0.20260528"}
redis = {version = "1.0.20260627"}
soulsoft_extensions_configuration = {version = "1.0.20260528"} soulsoft_extensions_configuration = {version = "1.0.20260528"}
soulsoft_extensions_options = {version = "1.0.20260528"}
soulsoft_web_cors = {version = "1.0.20260528"}
redis = {version = "1.0.20260627"}
soulsoft_extensions_injection = {version = "1.0.20260528"}
-10
View File
@@ -22,8 +22,6 @@ public class AppAndProfileItem {
public var _name: String = "" public var _name: String = ""
public var _image: ?String = None public var _image: ?String = None
public var _description: ?String = None public var _description: ?String = None
public init() {}
} }
/** /**
@@ -35,8 +33,6 @@ public class ConfirmResponse {
public var _profileId: String = "" public var _profileId: String = ""
public var _scene: ?String = None public var _scene: ?String = None
public var _data: ?HashMap<String, Any> = None public var _data: ?HashMap<String, Any> = None
public init() {}
} }
/** /**
@@ -49,8 +45,6 @@ public class LoginInfoResponse {
public var _name: String = "" public var _name: String = ""
public var _image: ?String = None public var _image: ?String = None
public var _description: ?String = None public var _description: ?String = None
public init() {}
} }
/** /**
@@ -81,8 +75,6 @@ public class GroupRelatedItem {
public var _isOwner: Bool = false public var _isOwner: Bool = false
public var _isAdmin: Bool = false public var _isAdmin: Bool = false
public var _isMember: Bool = false public var _isMember: Bool = false
public init() {}
} }
/** /**
@@ -95,8 +87,6 @@ public class GroupDetailTreeNode {
public var _description: ?String = None public var _description: ?String = None
public var _sort: Int64 = 0 public var _sort: Int64 = 0
public var _children: Array<GroupDetailTreeNode> = [] public var _children: Array<GroupDetailTreeNode> = []
public init() {}
} }
/** /**
@@ -36,5 +36,4 @@ public class SimApiAuthCenterOptions {
*/ */
public var useIam: Bool = false public var useIam: Bool = false
public init() {}
} }
-2
View File
@@ -55,8 +55,6 @@ public class SimApiAuthOption {
* 授权范围。 * 授权范围。
*/ */
public var scopes: HashMap<String, String> = HashMap<String, String>() public var scopes: HashMap<String, String> = HashMap<String, String>()
public init() {}
} }
/** /**
@@ -17,5 +17,4 @@ public class SimApiExceptionOptions {
*/ */
public var skipStatusCodes: HashSet<Int64> = HashSet<Int64>([200, 301, 302]) public var skipStatusCodes: HashSet<Int64> = HashSet<Int64>([200, 301, 302])
public init() {}
} }
@@ -14,5 +14,4 @@ public class SimApiHttpClientOptions {
public var appId: String = "" public var appId: String = ""
public var appKey: String = "" public var appKey: String = ""
public init() {}
} }
-2
View File
@@ -21,8 +21,6 @@ public class SimApiJobServer {
* 工作线程数(默认 5)。 * 工作线程数(默认 5)。
*/ */
public var workerNum: Int64 = 5 public var workerNum: Int64 = 5
public init() {}
} }
/** /**
-1
View File
@@ -118,7 +118,6 @@ public class SimApiOptions {
public var simApiRouteOptions = SimApiRouteOptions() public var simApiRouteOptions = SimApiRouteOptions()
public var simApiRequestLogOptions = SimApiRequestLogOptions() public var simApiRequestLogOptions = SimApiRequestLogOptions()
public init() {}
// ===== .NET 风格配置回调(对齐 C# ConfigureSimApiXxx(opt => ...) ===== // ===== .NET 风格配置回调(对齐 C# ConfigureSimApiXxx(opt => ...) =====
@@ -25,5 +25,4 @@ public class SimApiRequestLogOptions {
*/ */
public var requestStringLogLength: Int64 = 0 public var requestStringLogLength: Int64 = 0
public init() {}
} }
-1
View File
@@ -25,5 +25,4 @@ public class SimApiRouteOptions {
*/ */
public var webConfigRoute: ?String = Some("/config") public var webConfigRoute: ?String = Some("/config")
public init() {}
} }
@@ -16,5 +16,4 @@ public class SimApiStorageOptions {
public var bucket: String = "" public var bucket: String = ""
public var serveUrl: String = "" public var serveUrl: String = ""
public init() {}
} }
@@ -47,5 +47,4 @@ public class SimApiSynapseOptions {
*/ */
public var disableRpcClient: Bool = false public var disableRpcClient: Bool = false
public init() {}
} }
-2
View File
@@ -18,8 +18,6 @@ import simapi.interfaces.*
*/ */
public class AesBodyRequest { public class AesBodyRequest {
public var _data: String = "" public var _data: String = ""
public init() {}
} }
/** /**
-1
View File
@@ -13,7 +13,6 @@ import simapi.communications.*
* 在仓颉版中以中间件形式实现,对应 C# 的 SimApiResponseFilter。 * 在仓颉版中以中间件形式实现,对应 C# 的 SimApiResponseFilter。
*/ */
public class SimApiResponseFilter { public class SimApiResponseFilter {
public init() {}
/** /**
* 包装响应委托:捕获下一级写入的响应内容。 * 包装响应委托:捕获下一级写入的响应内容。
-1
View File
@@ -16,7 +16,6 @@ public open class AesBodyProviderBase {
/// appId 字段名(None 表示不带 appId /// appId 字段名(None 表示不带 appId
public var appIdName: ?String = Some("appId") public var appIdName: ?String = Some("appId")
public init() {}
/** /**
* 根据 appId 获取密钥。 * 根据 appId 获取密钥。
-1
View File
@@ -34,7 +34,6 @@ public open class SimApiSignProviderBase {
/// 参与签名的额外字段(与 appId/timestamp/nonce 一起拼入签名字符串) /// 参与签名的额外字段(与 appId/timestamp/nonce 一起拼入签名字符串)
public var signFields: Array<String> = [] public var signFields: Array<String> = []
public init() {}
/** /**
* 根据 appId 获取密钥。 * 根据 appId 获取密钥。
-2
View File
@@ -127,8 +127,6 @@ public class SimApiLogger <: ILogger {
public class SimApiLoggerProvider <: ILoggerProvider { public class SimApiLoggerProvider <: ILoggerProvider {
private let _loggers = ConcurrentHashMap<String, SimApiLogger>() private let _loggers = ConcurrentHashMap<String, SimApiLogger>()
public init() {}
public func createLogger(categoryName: String): ILogger { public func createLogger(categoryName: String): ILogger {
if (let Some(logger) <- _loggers.get(categoryName)) { if (let Some(logger) <- _loggers.get(categoryName)) {
return logger return logger
-1
View File
@@ -28,7 +28,6 @@ public open class SimApiBaseModel {
/// UpdateTime 更新的字段名 /// UpdateTime 更新的字段名
protected var _updatedTimeField: String = "_updatedAt" protected var _updatedTimeField: String = "_updatedAt"
public init() {}
/** /**
* 反射映射:把 source 的同名同类型非忽略字段赋值到 this(对齐 C# MapData(source, mapAll))。 * 反射映射:把 source 的同名同类型非忽略字段赋值到 this(对齐 C# MapData(source, mapAll))。