wf_process.go 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package model
  2. import (
  3. "gorm.io/gorm"
  4. "time"
  5. )
  6. type WorkflowProcess struct {
  7. ID string `json:"id" form:"id" gorm:"comment:流程标识;primaryKey;unique;not null"`
  8. CreatedAt time.Time
  9. UpdatedAt time.Time
  10. DeletedAt gorm.DeletedAt `gorm:"index"`
  11. Name string `json:"name" gorm:"comment:流程名称"`
  12. Category string `json:"category" gorm:"comment:分类"`
  13. Clazz string `json:"clazz" gorm:"comment:类型"`
  14. Label string `json:"label" gorm:"comment:流程标题"`
  15. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  16. Description string `json:"description" gorm:"comment:详细介绍"`
  17. Nodes []WorkflowNode `json:"nodes"` // 流程节点数据
  18. }
  19. type WorkflowNode struct {
  20. ID string `json:"id" form:"id" gorm:"comment:节点id;primaryKey;unique;not null"`
  21. CreatedAt time.Time
  22. UpdatedAt time.Time
  23. DeletedAt gorm.DeletedAt `gorm:"index"`
  24. WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
  25. Clazz string `json:"clazz" gorm:"comment:节点类型"`
  26. Label string `json:"label" gorm:"comment:节点名称"`
  27. Type string `json:"type" gorm:"comment:图标类型"`
  28. Shape string `json:"shape" gorm:"comment:形状"`
  29. Description bool `json:"description" gorm:"comment:详细介绍"`
  30. X float64 `json:"y" gorm:"comment:x位置"`
  31. Y float64 `json:"x" gorm:"comment:y位置"`
  32. WaitState string `json:"waitState" gorm:"comment:等待属性"`
  33. StateValue string `json:"stateValue" gorm:"comment:等待值"`
  34. To string `json:"to" gorm:"comment:收件人"`
  35. Subject string `json:"subject" gorm:"comment:标题"`
  36. Content string `json:"content" gorm:"comment:内容"`
  37. Cycle string `json:"cycle" gorm:"comment:循环时间"`
  38. Duration string `json:"duration" gorm:"comment:持续时间"`
  39. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  40. Edges []WorkflowEdge `json:"edges"` // 流程链接数据
  41. }
  42. type WorkflowEdge struct {
  43. ID string `json:"id" form:"id" gorm:"comment:唯一标识;primaryKey;unique;not null"`
  44. CreatedAt time.Time
  45. UpdatedAt time.Time
  46. DeletedAt gorm.DeletedAt `gorm:"index"`
  47. WorkflowNodeID string `json:"-" gorm:"comment:节点标识"`
  48. Clazz string `json:"clazz" gorm:"comment:类型(线)"`
  49. Source string `json:"source" gorm:"comment:起点节点"`
  50. Target string `json:"target" gorm:"comment:目标节点"`
  51. SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"`
  52. TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"`
  53. Shape string `json:"shape" gorm:"comment:形状"`
  54. StartPoint WorkflowPoint `json:"startPoint"` // 起点信息
  55. EndPoint WorkflowPoint `json:"endPoint"` // 终点信息
  56. Label string `json:"label" gorm:"comment:标题"`
  57. HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"`
  58. ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"`
  59. Seq string `json:"seq" gorm:"comment:序号"`
  60. Reverse bool `json:"reverse" gorm:"comment:是否反向"`
  61. }
  62. type WorkflowPoint struct {
  63. ID string `json:"-" gorm:"comment:唯一标识;primaryKey;unique;not null"`
  64. CreatedAt time.Time
  65. UpdatedAt time.Time
  66. DeletedAt gorm.DeletedAt `gorm:"index"`
  67. WorkflowEdgeID string `json:"-"`
  68. X float64 `json:"x"`
  69. Y float64 `json:"y"`
  70. Index int `json:"index"`
  71. }