appstypes.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. package model
  2. import (
  3. "time"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. )
  6. type AppModule struct {
  7. NodeID string `bson:"nodeId" json:"nodeId"`
  8. Name string `bson:"name" json:"name"`
  9. Intro string `bson:"intro" json:"intro"`
  10. Avatar string `bson:"avatar,omitempty" json:"avatar,omitempty"`
  11. FlowNodeType string `bson:"flowNodeType" json:"flowNodeType"`
  12. ShowStatus bool `bson:"showStatus,omitempty" json:"showStatus,omitempty"`
  13. Position Position `bson:"position" json:"position"`
  14. Version string `bson:"version" json:"version"`
  15. Inputs []AppInput `bson:"inputs" json:"inputs"`
  16. Outputs []AppOutput `bson:"outputs" json:"outputs"`
  17. }
  18. type Position struct {
  19. X float64 `bson:"x" json:"x"`
  20. Y float64 `bson:"y" json:"y"`
  21. }
  22. type AppInput struct {
  23. Key string `bson:"key" json:"key"`
  24. RenderTypeList []string `bson:"renderTypeList" json:"renderTypeList"`
  25. ValueType string `bson:"valueType" json:"valueType"`
  26. Label string `bson:"label" json:"label"`
  27. ToolDescription string `bson:"toolDescription,omitempty" json:"toolDescription,omitempty"`
  28. Required bool `bson:"required,omitempty" json:"required,omitempty"`
  29. Value interface{} `bson:"value,omitempty" json:"value,omitempty"`
  30. Min *int32 `bson:"min,omitempty" json:"min,omitempty"`
  31. Max *int32 `bson:"max,omitempty" json:"max,omitempty"`
  32. Step *int32 `bson:"step,omitempty" json:"step,omitempty"`
  33. Description string `bson:"description,omitempty" json:"description,omitempty"`
  34. DebugLabel string `bson:"debugLabel,omitempty" json:"debugLabel,omitempty"`
  35. Placeholder string `bson:"placeholder,omitempty" json:"placeholder,omitempty"`
  36. }
  37. type AppInputValue struct {
  38. Type string `bson:"type" json:"type"`
  39. Open bool `bson:"open" json:"open"`
  40. AutoSend bool `bson:"autoSend" json:"autoSend"`
  41. AutoTTSResponse bool `bson:"autoTTSResponse" json:"autoTTSResponse"`
  42. }
  43. type AppOutput struct {
  44. ID string `bson:"id" json:"id"`
  45. Key string `bson:"key" json:"key"`
  46. Label string `bson:"label" json:"label"`
  47. Required bool `bson:"required,omitempty" json:"required,omitempty"`
  48. Description string `bson:"description,omitempty" json:"description,omitempty"`
  49. ValueType string `bson:"valueType" json:"valueType"`
  50. ValueDesc string `bson:"valueDesc,omitempty" json:"valueDesc,omitempty"`
  51. Type string `bson:"type" json:"type"`
  52. }
  53. type Edge struct {
  54. Source string `bson:"source" json:"source"`
  55. Target string `bson:"target" json:"target"`
  56. SourceHandle string `bson:"sourceHandle" json:"sourceHandle"`
  57. TargetHandle string `bson:"targetHandle" json:"targetHandle"`
  58. }
  59. type PluginData struct {
  60. ID primitive.ObjectID `bson:"_id" json:"id"`
  61. NodeVersion string `bson:"nodeVersion" json:"nodeVersion"`
  62. }
  63. type TTSConfig struct {
  64. Type string `bson:"type" json:"type"`
  65. }
  66. type WhisperConfig struct {
  67. Open bool `bson:"open" json:"open"`
  68. AutoSend bool `bson:"autoSend" json:"autoSend"`
  69. AutoTTSResponse bool `bson:"autoTTSResponse" json:"autoTTSResponse"`
  70. }
  71. type ChatInputGuide struct {
  72. Open bool `bson:"open" json:"open"`
  73. TextList []string `bson:"textList" json:"textList"`
  74. CustomUrl string `bson:"customUrl" json:"customUrl"`
  75. }
  76. type ChatConfig struct {
  77. WelcomeText string `bson:"welcomeText" json:"welcomeText"`
  78. Variables []interface{} `bson:"variables" json:"variables"`
  79. QuestionGuide bool `bson:"questionGuide" json:"questionGuide"`
  80. TTSConfig TTSConfig `bson:"ttsConfig" json:"ttsConfig"`
  81. WhisperConfig WhisperConfig `bson:"whisperConfig" json:"whisperConfig"`
  82. ScheduledTriggerConfig interface{} `bson:"scheduledTriggerConfig" json:"scheduledTriggerConfig"`
  83. ChatInputGuide ChatInputGuide `bson:"chatInputGuide" json:"chatInputGuide"`
  84. Instruction string `bson:"instruction" json:"instruction"`
  85. ID primitive.ObjectID `bson:"_id" json:"id"`
  86. }
  87. type Apps struct {
  88. ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
  89. ParentID *primitive.ObjectID `bson:"parentId,omitempty" json:"parentId,omitempty"`
  90. TeamID primitive.ObjectID `bson:"teamId" json:"teamId"`
  91. TmbID primitive.ObjectID `bson:"tmbId" json:"tmbId"`
  92. Name string `bson:"name" json:"name"`
  93. Type string `bson:"type" json:"type"`
  94. Version string `bson:"version" json:"version"`
  95. Avatar string `bson:"avatar" json:"avatar"`
  96. Intro string `bson:"intro" json:"intro"`
  97. TeamTags []string `bson:"teamTags" json:"teamTags"`
  98. Modules []AppModule `bson:"modules" json:"modules"`
  99. Edges []Edge `bson:"edges" json:"edges"`
  100. PluginData PluginData `bson:"pluginData" json:"pluginData"`
  101. InheritPermission bool `bson:"inheritPermission" json:"inheritPermission"`
  102. UpdateTime time.Time `bson:"updateTime" json:"updateTime"`
  103. VersionNumber int32 `bson:"__v" json:"versionNumber"`
  104. ChatConfig ChatConfig `bson:"chatConfig" json:"chatConfig"`
  105. ScheduledTriggerConfig interface{} `bson:"scheduledTriggerConfig" json:"scheduledTriggerConfig"`
  106. ScheduledTriggerNextTime interface{} `bson:"scheduledTriggerNextTime" json:"scheduledTriggerNextTime"`
  107. }