rts-sim-testing-service/dto/projectRunConfig.go
weizhihong 172f65b14c 【删除废弃文件夹中代码】
【调整消息服务代码】
【删除多余代码】
【调整方法、结构体名称】
2023-10-27 14:57:37 +08:00

44 lines
1.4 KiB
Go

package dto
import "joylink.club/bj-rtsts-server/db/model"
type PageProjectRunConfigReqDto struct {
PageQueryDto
Name string `json:"name" form:"name"`
}
type ProjectRunConfigReqDto struct {
Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name" binding:"required"`
Description string `json:"description" form:"description"`
ConfigContent string `json:"config" form:"config" binding:"required"`
}
type ProjectRunConfigDto struct {
Id int32 `json:"id" form:"id"`
Name string `json:"name" form:"name"`
Description string `json:"description" form:"description"`
ConfigContent string `json:"config" form:"config"`
CreatedAt JsonTime `json:"createdAt" time_format:"2006-01-02 15:04:05"`
UpdateAt JsonTime `json:"updateAt" time_format:"2006-01-02 15:04:05"`
}
func ConvertToRunConfigDto(gi *model.ProjectRunConfig) *ProjectRunConfigDto {
return &ProjectRunConfigDto{
Id: gi.ID,
Name: gi.Name,
Description: gi.Description,
ConfigContent: gi.ConfigContent,
CreatedAt: JsonTime(gi.CreateTime),
UpdateAt: JsonTime(gi.UpdateTime),
}
}
func ConvertToRunConfigFromSlice(giSlice []*model.ProjectRunConfig) []*ProjectRunConfigDto {
var result []*ProjectRunConfigDto
for _, gi := range giSlice {
result = append(result, ConvertToRunConfigDto(gi))
}
return result
}