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

67 lines
1.1 KiB
Plaintext
Raw Normal View History

2026-08-16 12:46:15 +08:00
/*
* Copyright (c) 2025 SimcuTeam. All rights reserved.
* 移植自 C# 项目 SimApiE:\simcu\simapi-net),遵循 MIT 许可证。
*/
package simapi.communications
/**
* 基础请求 DTO。
*/
public class SimApiBaseRequest {}
/**
* 仅包含 Id 的请求。
*/
public class SimApiIdOnlyRequest {
public var id: Int64 = 0
public init() {}
public init(id: Int64) {
this.id = id
}
}
/**
* 仅包含 Id 的请求(字符串)。
*/
2026-08-16 12:46:15 +08:00
public class SimApiStringIdOnlyRequest {
public var id: String = ""
public init() {}
public init(id: String) {
this.id = id
}
}
/**
* 单字段请求。
* @param T 数据类型。
*/
public class SimApiOneFieldRequest<T> {
public var data: ?T = None
public init() {}
public init(data: T) {
this.data = Some(data)
}
}
/**
* 基础分页请求。
*/
public class SimApiBasePageRequest {
public var page: Int64 = 1
public var count: Int64 = 20
public init() {}
public init(page: Int64, count: Int64) {
this.page = page
this.count = count
}
}