Files
simapi-cj/src/communications/simapi_login_item.cj
T

43 lines
1.2 KiB
Plaintext
Raw Normal View History

2026-08-16 12:46:15 +08:00
/*
* Copyright (c) 2025 SimcuTeam. All rights reserved.
* 遵循 MIT 许可证。
2026-08-16 12:46:15 +08:00
* Communications/SimApiLoginItem:登录信息项。
*/
package simcu::simapi.communications
2026-08-16 12:46:15 +08:00
import std.collection.*
2026-08-31 23:47:33 +08:00
import simcu::serialization.*
2026-08-16 12:46:15 +08:00
/**
* 登录信息项:Token 认证通过后注入请求上下文。
*
* 序列化/反序列化由 simapi_serialization 反射处理(免标注、免约束),
* 字段 id/types/meta/extra 全部为受支持类型(String/Array/HashMap)。
2026-08-16 12:46:15 +08:00
*/
public class SimApiLoginItem {
public var id: String = ""
2026-08-31 23:47:33 +08:00
@NotRequired
public var types: Array<String> = ["user"]
2026-08-31 23:47:33 +08:00
@NotRequired
public var meta: HashMap<String, String> = HashMap<String, String>()
2026-08-31 23:47:33 +08:00
@NotRequired
public var extra: HashMap<String, Any> = HashMap<String, Any>()
2026-08-16 12:46:15 +08:00
public init() {}
public init(id: String) {
this.id = id
this.types = ["user"]
this.meta = HashMap<String, String>()
this.extra = HashMap<String, Any>()
2026-08-16 12:46:15 +08:00
}
public init(id: String, types: Array<String>) {
this.id = id
this.types = types
this.meta = HashMap<String, String>()
this.extra = HashMap<String, Any>()
2026-08-16 12:46:15 +08:00
}
}