74 lines
3.1 KiB
Go
Executable File
74 lines
3.1 KiB
Go
Executable File
// Code generated by goctl. DO NOT EDIT.
|
|
|
|
package model
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/zeromicro/go-zero/core/stores/builder"
|
|
"github.com/zeromicro/go-zero/core/stores/cache"
|
|
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
|
"github.com/zeromicro/go-zero/core/stringx"
|
|
)
|
|
|
|
var (
|
|
scParticipantAvailInfoFieldNames = builder.RawFieldNames(&ScParticipantAvailInfo{})
|
|
scParticipantAvailInfoRows = strings.Join(scParticipantAvailInfoFieldNames, ",")
|
|
scParticipantAvailInfoRowsExpectAutoSet = strings.Join(stringx.Remove(scParticipantAvailInfoFieldNames, "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
|
|
scParticipantAvailInfoRowsWithPlaceHolder = strings.Join(stringx.Remove(scParticipantAvailInfoFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
|
|
|
|
cachePcmScParticipantAvailInfoIdPrefix = "cache:pcm:scParticipantAvailInfo:id:"
|
|
)
|
|
|
|
type (
|
|
scParticipantAvailInfoModel interface {
|
|
Insert(ctx context.Context, data *ScParticipantAvailInfo) (sql.Result, error)
|
|
FindOne(ctx context.Context, id int64) (*ScParticipantAvailInfo, error)
|
|
Update(ctx context.Context, data *ScParticipantAvailInfo) error
|
|
Delete(ctx context.Context, id int64) error
|
|
}
|
|
|
|
defaultScParticipantAvailInfoModel struct {
|
|
sqlc.CachedConn
|
|
table string
|
|
}
|
|
|
|
ScParticipantAvailInfo struct {
|
|
Id int64 `db:"id"` // id
|
|
Host string `db:"host"` // 集群p端host
|
|
Port string `db:"port"` // 集群p端端口
|
|
AvailStorageSpace int64 `db:"avail_storage_space"` // 集群存储可用空间
|
|
UserNum int64 `db:"user_num"` // 用户数量
|
|
PendingJobNum int64 `db:"pending_job_num"` // 待处理作业数量
|
|
RunningJobNum int64 `db:"running_job_num"` // 运行作业数量
|
|
ParticipantId int64 `db:"participant_id"` // 集群静态信息id
|
|
DeletedFlag int64 `db:"deleted_flag"` // 是否删除
|
|
CreatedBy sql.NullInt64 `db:"created_by"` // 创建人
|
|
CreatedTime time.Time `db:"created_time"` // 创建时间
|
|
UpdatedBy sql.NullInt64 `db:"updated_by"` // 更新人
|
|
UpdatedTime sql.NullTime `db:"updated_time"` // 更新时间
|
|
}
|
|
)
|
|
|
|
func newScParticipantAvailInfoModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) *defaultScParticipantAvailInfoModel {
|
|
return &defaultScParticipantAvailInfoModel{
|
|
CachedConn: sqlc.NewConn(conn, c, opts...),
|
|
table: "`sc_participant_avail_info`",
|
|
}
|
|
}
|
|
|
|
func (m *defaultScParticipantAvailInfoModel) withSession(session sqlx.Session) *defaultScParticipantAvailInfoModel {
|
|
return &defaultScParticipantAvailInfoModel{
|
|
CachedConn: m.CachedConn.WithSession(session),
|
|
table: "`sc_participant_avail_info`",
|
|
}
|
|
}
|
|
|
|
func (m *defaultScParticipantAvailInfoModel) tableName() string {
|
|
return m.table
|
|
}
|