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.0 kB

2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Code generated by goctl. DO NOT EDIT.
  2. package model
  3. import (
  4. "context"
  5. "database/sql"
  6. "strings"
  7. "time"
  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. taskFieldNames = builder.RawFieldNames(&Task{})
  14. taskRows = strings.Join(taskFieldNames, ",")
  15. taskRowsExpectAutoSet = strings.Join(stringx.Remove(taskFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
  16. taskRowsWithPlaceHolder = strings.Join(stringx.Remove(taskFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
  17. )
  18. type (
  19. taskModel interface {
  20. Insert(ctx context.Context, data *Task) (sql.Result, error)
  21. FindOne(ctx context.Context, id int64) (*Task, error)
  22. Update(ctx context.Context, data *Task) error
  23. Delete(ctx context.Context, id int64) error
  24. }
  25. defaultTaskModel struct {
  26. conn sqlx.SqlConn
  27. table string
  28. }
  29. Task struct {
  30. Id int64 `db:"id"` // id
  31. Name string `db:"name"` // 作业名称
  32. Description string `db:"description"` // 作业描述
  33. Status string `db:"status"` // 作业状态
  34. Strategy int64 `db:"strategy"` // 策略
  35. SynergyStatus int64 `db:"synergy_status"` // 协同状态(0-未协同、1-已协同)
  36. StartTime time.Time `db:"start_time"` // 开始运行时间
  37. EndTime string `db:"end_time"` // 结束运行时间
  38. RunningTime int64 `db:"running_time"` // 已运行时间(单位秒)
  39. YamlString string `db:"yaml_string"`
  40. Result string `db:"result"` // 作业结果
  41. }
  42. )
  43. func newTaskModel(conn sqlx.SqlConn) *defaultTaskModel {
  44. return &defaultTaskModel{
  45. conn: conn,
  46. table: "`task`",
  47. }
  48. }
  49. func (m *defaultTaskModel) tableName() string {
  50. return m.table
  51. }

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.