Files
hpc/internal/model/cluster.go
dailz fbfd5c5f42 feat: 添加数据模型和存储层
- model: JobTemplate、SubmitJobRequest、JobHistoryQuery 等模型定义

- store: NewGormDB MySQL 连接池,使用 zap 日志替代 GORM 默认日志

- store: TemplateStore CRUD 操作,支持 GORM AutoMigrate

- NewGormDB 接受 gormLevel 参数,由上层传入配置值

- 完整 TDD 测试覆盖

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-10 08:39:30 +08:00

24 lines
835 B
Go

package model
// NodeResponse is the simplified API response for a node.
type NodeResponse struct {
Name string `json:"name"`
State []string `json:"state"`
CPUs int32 `json:"cpus"`
RealMemory int64 `json:"real_memory"`
AllocMem int64 `json:"alloc_memory,omitempty"`
Arch string `json:"architecture,omitempty"`
OS string `json:"operating_system,omitempty"`
}
// PartitionResponse is the simplified API response for a partition.
type PartitionResponse struct {
Name string `json:"name"`
State []string `json:"state"`
Nodes string `json:"nodes,omitempty"`
TotalCPUs int32 `json:"total_cpus,omitempty"`
TotalNodes int32 `json:"total_nodes,omitempty"`
MaxTime string `json:"max_time,omitempty"`
Default bool `json:"default,omitempty"`
}