You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

cloudmodel_gen.go 2.6 kB

2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Code generated by goctl. DO NOT EDIT.
  2. package models
  3. import (
  4. "context"
  5. "database/sql"
  6. "gorm.io/gorm"
  7. "strings"
  8. "github.com/zeromicro/go-zero/core/stores/builder"
  9. "github.com/zeromicro/go-zero/core/stores/sqlx"
  10. "github.com/zeromicro/go-zero/core/stringx"
  11. )
  12. var (
  13. cloudFieldNames = builder.RawFieldNames(&TaskCloud{})
  14. cloudRows = strings.Join(cloudFieldNames, ",")
  15. cloudRowsExpectAutoSet = strings.Join(stringx.Remove(cloudFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
  16. cloudRowsWithPlaceHolder = strings.Join(stringx.Remove(cloudFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
  17. )
  18. type (
  19. cloudModel interface {
  20. Insert(ctx context.Context, data *TaskCloud) (sql.Result, error)
  21. FindOne(ctx context.Context, id int64) (*TaskCloud, error)
  22. FindOneByNamespaceNameServiceName(ctx context.Context, namespace sql.NullString, name sql.NullString, serviceName sql.NullString) (*TaskCloud, error)
  23. Update(ctx context.Context, data *TaskCloud) error
  24. Delete(ctx context.Context, id int64) error
  25. }
  26. defaultCloudModel struct {
  27. conn sqlx.SqlConn
  28. table string
  29. }
  30. TaskCloud struct {
  31. Id int64 `db:"id"` // id
  32. TaskId int64 `db:"task_id"` // 任务id
  33. ParticipantId int64 `db:"participant_id"` // 集群静态信息id
  34. ClusterId int64 `db:"cluster_id"`
  35. ClusterName string `db:"cluster_name"`
  36. AdapterId int64 `db:"adapter_id"`
  37. AdapterName string `db:"adapter_name"`
  38. ApiVersion string `db:"api_version"` //api版本
  39. Name string `db:"name"` // 名称
  40. Namespace string `db:"namespace"` // 命名空间
  41. Kind string `db:"kind"` // 种类
  42. Status string `db:"status"` // 状态
  43. StartTime string `db:"start_time"` // 开始时间
  44. RunningTime int64 `db:"running_time"` // 运行时长
  45. DeletedAt gorm.DeletedAt `gorm:"index"`
  46. YamlString string `db:"yaml_string"`
  47. Result string `db:"result"` // 运行结果
  48. NsID string `db:"ns_id"`
  49. Replica int32 `db:"replica"`
  50. }
  51. )
  52. func newCloudModel(conn sqlx.SqlConn) *defaultCloudModel {
  53. return &defaultCloudModel{
  54. conn: conn,
  55. table: "`task_cloud`",
  56. }
  57. }
  58. func (m *defaultCloudModel) tableName() string {
  59. return m.table
  60. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.