Browse Source

设计workflow数据结构

main
pixel 4 years ago
parent
commit
64cbca17c1
  1. 8
      server/model/wf_process.go

8
server/model/wf_process.go

@ -1,7 +1,7 @@
package model
type WorkflowProcess struct {
ID string `json:"id" gorm:"comment:流程标识"`
ID string `json:"id" gorm:"comment:流程标识;primaryKey"`
Name string `json:"name" gorm:"comment:流程名称"`
Category string `json:"category" gorm:"comment:分类"`
Clazz string `json:"clazz" gorm:"comment:类型"`
@ -12,7 +12,7 @@ type WorkflowProcess struct {
}
type WorkflowNode struct {
ID string `json:"id" gorm:"comment:节点id"`
ID string `json:"id" gorm:"comment:节点id;primaryKey"`
WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
Clazz string `json:"clazz" gorm:"comment:节点类型"`
Size [2]int `json:"size" gorm:"comment:节点大小"`
@ -32,8 +32,8 @@ type WorkflowNode struct {
}
type WorkflowEdge struct {
ID string `json:"id" gorm:"comment:唯一标识;primaryKey"`
WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
ID string `json:"id" gorm:"comment:唯一标识"`
Clazz string `json:"clazz" gorm:"comment:类型(线)"`
Source string `json:"source" gorm:"comment:起点节点"`
Target string `json:"target" gorm:"comment:目标节点"`
@ -50,6 +50,8 @@ type WorkflowEdge struct {
}
type WorkflowPoint struct {
ID string `json:"-" gorm:"comment:唯一标识;primaryKey"`
WorkflowEdgeID string `json:"-"`
X float64 `json:"x"`
Y float64 `json:"y"`
Index int `json:"index"`
Loading…
Cancel
Save