refactor: remove JobTemplate production code
Remove all JobTemplate model, store, handler, migrations, and wiring. Replaced by Application Definition system. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// JobTemplate represents a saved job template.
|
||||
type JobTemplate struct {
|
||||
ID int64 `json:"id" gorm:"primaryKey;autoIncrement"` // 模板 ID
|
||||
Name string `json:"name" gorm:"uniqueIndex;size:255;not null"` // 模板名称
|
||||
Description string `json:"description,omitempty" gorm:"type:text"` // 模板描述
|
||||
Script string `json:"script" gorm:"type:text;not null"` // 作业脚本内容
|
||||
Partition string `json:"partition,omitempty" gorm:"size:255"` // 提交到的分区
|
||||
QOS string `json:"qos,omitempty" gorm:"column:qos;size:255"` // 使用的 QOS 策略
|
||||
CPUs int `json:"cpus,omitempty" gorm:"column:cpus"` // 请求的 CPU 核数
|
||||
Memory string `json:"memory,omitempty" gorm:"size:50"` // 请求的内存大小
|
||||
TimeLimit string `json:"time_limit,omitempty" gorm:"column:time_limit;size:50"` // 运行时间限制
|
||||
CreatedAt time.Time `json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// TableName specifies the database table name for GORM.
|
||||
func (JobTemplate) TableName() string { return "job_templates" }
|
||||
|
||||
// CreateTemplateRequest is the API request for creating a template.
|
||||
type CreateTemplateRequest struct {
|
||||
Name string `json:"name"` // 模板名称 (必填)
|
||||
Description string `json:"description,omitempty"` // 模板描述
|
||||
Script string `json:"script"` // 作业脚本内容 (必填)
|
||||
Partition string `json:"partition,omitempty"` // 提交到的分区
|
||||
QOS string `json:"qos,omitempty"` // 使用的 QOS 策略
|
||||
CPUs int `json:"cpus,omitempty"` // 请求的 CPU 核数
|
||||
Memory string `json:"memory,omitempty"` // 请求的内存大小
|
||||
TimeLimit string `json:"time_limit,omitempty"` // 运行时间限制
|
||||
}
|
||||
|
||||
// UpdateTemplateRequest is the API request for updating a template.
|
||||
type UpdateTemplateRequest struct {
|
||||
Name string `json:"name,omitempty"` // 模板名称
|
||||
Description string `json:"description,omitempty"` // 模板描述
|
||||
Script string `json:"script,omitempty"` // 作业脚本内容
|
||||
Partition string `json:"partition,omitempty"` // 提交到的分区
|
||||
QOS string `json:"qos,omitempty"` // 使用的 QOS 策略
|
||||
CPUs int `json:"cpus,omitempty"` // 请求的 CPU 核数
|
||||
Memory string `json:"memory,omitempty"` // 请求的内存大小
|
||||
TimeLimit string `json:"time_limit,omitempty"` // 运行时间限制
|
||||
}
|
||||
Reference in New Issue
Block a user