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.

taskmodel_gen.go 2.2 kB

2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. "time"
  9. "github.com/zeromicro/go-zero/core/stores/builder"
  10. "github.com/zeromicro/go-zero/core/stores/sqlx"
  11. "github.com/zeromicro/go-zero/core/stringx"
  12. )
  13. var (
  14. taskFieldNames = builder.RawFieldNames(&Task{})
  15. taskRows = strings.Join(taskFieldNames, ",")
  16. taskRowsExpectAutoSet = strings.Join(stringx.Remove(taskFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
  17. taskRowsWithPlaceHolder = strings.Join(stringx.Remove(taskFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
  18. )
  19. type (
  20. taskModel interface {
  21. Insert(ctx context.Context, data *Task) (sql.Result, error)
  22. FindOne(ctx context.Context, id int64) (*Task, error)
  23. Update(ctx context.Context, data *Task) error
  24. Delete(ctx context.Context, id int64) error
  25. }
  26. defaultTaskModel struct {
  27. conn sqlx.SqlConn
  28. table string
  29. }
  30. Task struct {
  31. Id int64 `db:"id"` // id
  32. Name string `db:"name"` // 作业名称
  33. Description string `db:"description"` // 作业描述
  34. Status string `db:"status"` // 作业状态
  35. Strategy int64 `db:"strategy"` // 策略
  36. SynergyStatus int64 `db:"synergy_status"` // 协同状态(0-未协同、1-已协同)
  37. CommitTime time.Time `db:"commit_time"` // 提交时间
  38. StartTime string `db:"start_time"` // 开始时间
  39. EndTime string `db:"end_time"` // 结束运行时间
  40. RunningTime int64 `db:"running_time"` // 已运行时间(单位秒)
  41. YamlString string `db:"yaml_string"`
  42. Result string `db:"result"` // 作业结果
  43. DeletedAt gorm.DeletedAt `gorm:"index"`
  44. NsID string `db:"ns_id"`
  45. }
  46. )
  47. func newTaskModel(conn sqlx.SqlConn) *defaultTaskModel {
  48. return &defaultTaskModel{
  49. conn: conn,
  50. table: "`task`",
  51. }
  52. }
  53. func (m *defaultTaskModel) tableName() string {
  54. return m.table
  55. }

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.