refactor: DTO 字段去下划线 + SimApiBaseResponse 不再可继承 + 删除 SimApiJson/toJsonString
- 纯 POCO DTO 字段去下划线:AuthDto(id/name/applicationId/profileId/scene 等)、 SimApiLoginItem(id/types/meta/extra)、AesBodyRequest(data)、 SimApiBaseResponse 系列(code/message/data/list/page/count/total) - SimApiBaseResponse 去 open(不再允许继承)+ 删 @SerializerParent(无子类继承) - SimApiResponse<T> / SimApiDataResponse 改为组合(自带 code/message/data) - 删除 toJsonString(无使用点,统一走 simapi_serialization) - 删除 SimApiJson.cj:json() → SimApiUtil.json() 直接序列化; escapeJson() 迁入 SimApiUtil - 同步更新所有字段引用(AuthCenter/AuthIam/HttpClient/ExceptionMiddleware 等) - 保留 sqlsharp 实体 User/Bot 的 _ 前缀(soulsoft 宏依赖)
This commit is contained in:
@@ -17,7 +17,7 @@ import simapi.interfaces.*
|
||||
* AES body 请求({"data": "密文"},对齐 C# SimApiOneFieldRequest<string>)。
|
||||
*/
|
||||
public class AesBodyRequest {
|
||||
public var _data: String = ""
|
||||
public var data: String = ""
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,7 @@ public class SimApiAesBodyChecker {
|
||||
|
||||
// 2. 反序列化 {"data": "密文"}
|
||||
let req = JsonSerializer.Deserialize<AesBodyRequest>(body)
|
||||
if (req._data.isEmpty()) {
|
||||
if (req.data.isEmpty()) {
|
||||
SimApiError.error(code: 400, message: "请求体缺少密文Data字段")
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class SimApiAesBodyChecker {
|
||||
}
|
||||
|
||||
// 5. 解密
|
||||
let jsonStr = SimApiAesUtil.decrypt(req._data, key.getOrThrow())
|
||||
let jsonStr = SimApiAesUtil.decrypt(req.data, key.getOrThrow())
|
||||
if (jsonStr.isEmpty()) {
|
||||
SimApiError.error(code: 400, message: "解密失败")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user