pcm-coordinator/model/cloudmodel_gen.go

67 lines
2.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by goctl. DO NOT EDIT.
package model
import (
"context"
"database/sql"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
cloudFieldNames = builder.RawFieldNames(&Cloud{})
cloudRows = strings.Join(cloudFieldNames, ",")
cloudRowsExpectAutoSet = strings.Join(stringx.Remove(cloudFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
cloudRowsWithPlaceHolder = strings.Join(stringx.Remove(cloudFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
cloudModel interface {
Insert(ctx context.Context, data *Cloud) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*Cloud, error)
FindOneByNamespaceNameServiceName(ctx context.Context, namespace sql.NullString, name sql.NullString, serviceName sql.NullString) (*Cloud, error)
Update(ctx context.Context, data *Cloud) error
Delete(ctx context.Context, id int64) error
}
defaultCloudModel struct {
conn sqlx.SqlConn
table string
}
Cloud struct {
Id int64 `db:"id"` // id
TaskId int64 `db:"task_id"` // 任务id
ParticipantId int64 `db:"participant_id"` // 集群静态信息id
ApiVersion string `db:"api_version"` //api版本
Name string `db:"name"` // 名称
Namespace string `db:"namespace"` // 命名空间
Kind string `db:"kind"` // 种类
Status string `db:"status"` // 状态
StartTime string `db:"start_time"` // 开始时间
RunningTime int64 `db:"running_time"` // 运行时长
CreatedBy int64 `db:"created_by"` // 创建人
CreatedTime sql.NullTime `db:"created_time"` // 创建时间
UpdatedBy int64 `db:"updated_by"` // 更新人
UpdatedTime sql.NullTime `db:"updated_time"` // 更新时间
DeletedFlag int64 `db:"deleted_flag"` // 是否删除0-否1-是)
YamlString string `db:"yaml_string"`
Result string `db:"result"` // 运行结果
}
)
func newCloudModel(conn sqlx.SqlConn) *defaultCloudModel {
return &defaultCloudModel{
conn: conn,
table: "`cloud`",
}
}
func (m *defaultCloudModel) tableName() string {
return m.table
}