Geen omschrijving
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

requset_model.go 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. package request
  2. import (
  3. "time"
  4. )
  5. // ExchangeRequest 创建交换机的请求
  6. type ExchangeRequest struct {
  7. ChannelName string `json:"channel_name"`
  8. ExchangeName string `json:"exchange_name"`
  9. ExchangeType string `json:"exchange_type"` // direct, fanout, topic, headers
  10. Durable bool `json:"durable"`
  11. Internal bool `json:"internal"`
  12. AutoDelete bool `json:"auto_delete"`
  13. NoWait bool `json:"no_wait"`
  14. Arguments map[string]string `json:"arguments"`
  15. }
  16. // QueueRequest 创建队列的请求
  17. type QueueRequest struct {
  18. ChannelName string `json:"channel_name"`
  19. QueueName string `json:"queue_name"`
  20. Durable bool `json:"durable"`
  21. Exclusive bool `json:"exclusive"`
  22. AutoDelete bool `json:"auto_delete"`
  23. NoWait bool `json:"no_wait"`
  24. Url string `json:"url"`
  25. Concurrency int `json:"Concurrency"`
  26. ExchangeName string `json:"exchange_name"`
  27. RoutingKey string `json:"routing_key"`
  28. Arguments map[string]string `json:"arguments"`
  29. }
  30. // BindRequest 绑定队列的请求
  31. type QueueBindRequest struct {
  32. ChannelName string `json:"channel_name"`
  33. QueueName string `json:"queue_name"`
  34. ExchangeName string `json:"exchange_name"`
  35. RoutingKey string `json:"routing_key"`
  36. NoWait bool `json:"no_wait"`
  37. Arguments map[string]string `json:"arguments"`
  38. }
  39. // MessageRequest 发送消息的请求
  40. type MessageRequest struct {
  41. ChannelName string `json:"channel_name"`
  42. ExchangeName string `json:"exchange_name"`
  43. RoutingKey string `json:"routing_key"`
  44. Message interface{} `json:"message"`
  45. ContentType string `json:"content_type"`
  46. Headers map[string]interface{} `json:"headers"`
  47. Priority uint8 `json:"priority"`
  48. CorrelationID string `json:"correlation_id"`
  49. ReplyTo string `json:"reply_to"`
  50. Expiration string `json:"expiration"`
  51. MessageID string `json:"message_id"`
  52. Timestamp time.Time `json:"timestamp"`
  53. Type string `json:"type"`
  54. AppID string `json:"app_id"`
  55. }
  56. // BytesMessageRequest 发送字节消息的请求
  57. type BytesMessageRequest struct {
  58. ChannelName string `json:"channel_name"`
  59. ExchangeName string `json:"exchange_name"`
  60. RoutingKey string `json:"routing_key"`
  61. Data []byte `json:"data"`
  62. ContentType string `json:"content_type"`
  63. Headers map[string]string `json:"headers"`
  64. }
  65. // QueueInfoRequest 获取队列信息的请求
  66. type QueueInfoRequest struct {
  67. ChannelName string `json:"channel_name,omitempty"`
  68. QueueName string `json:"queue_name,omitempty"`
  69. }
  70. // RabbitMQResult RabbitMQ操作结果
  71. // type RabbitMQResult struct {
  72. // Success bool `json:"success"`
  73. // Error string `json:"error,omitempty"`
  74. // Data interface{} `json:"data,omitempty"`
  75. // Message string `json:"message,omitempty"`
  76. // Time string `json:"time"`
  77. // Exchange string `json:"exchange,omitempty"`
  78. // Queue string `json:"queue,omitempty"`
  79. // MessageID string `json:"message_id,omitempty"`
  80. // QueueInfo interface{} `json:"queue_info,omitempty"`
  81. // }
  82. // QueryRequest 查询请求
  83. type QueryRequest struct {
  84. SQL string `json:"sql" binding:"required"`
  85. Params map[string]interface{} `json:"params,omitempty"` //名称参数
  86. PositionalParams []interface{} `json:"positionalParams,omitempty"` // 位置参数
  87. WriterHeader bool `json:"writerHeader,omitempty"` //如果查询返回cvs格式时候,包含表头还是不包含。true包含。第一行是表头
  88. AgentUrl string `json:"agentUrl,omitempty"` //远程服务器地址
  89. AgentToken string `json:"agentToken,omitempty"` //远程代理服务器token
  90. DorisDatabase string `json:"dorisDatabase,omitempty"` //doris数据库名称
  91. DorisTable string `json:"dorisTable,omitempty"` //doris数据库里的表名称
  92. }
  93. // TableRequest 表字典
  94. type TableRequest struct {
  95. TableName string `json:"table_name"`
  96. TableNameCN string `json:"table_name_cn"`
  97. Description string `json:"description"`
  98. PrimaryKeyFieldName string `json:"primary_key_field_name"`
  99. }
  100. // TablesRequest 表字典集合
  101. type TablesRequest struct {
  102. TableNames []*TableRequest `json:"table_names"`
  103. FieldInfos []*FieldInfo `json:"field_names"`
  104. }
  105. // FieldInfo 字段信息
  106. type FieldInfo struct {
  107. TableName string `json:"table_name"`
  108. // 字段名称(英文/数据库字段名)
  109. FieldName string `json:"field_name"`
  110. // 字段中文名称
  111. FieldNameCN string `json:"field_name_cn"`
  112. // 字段描述
  113. Description string `json:"description"`
  114. // 字段类型(如:varchar, int, datetime等)
  115. FieldType string `json:"field_type"`
  116. // 字段长度/精度
  117. FieldLength *int `json:"field_length,omitempty"`
  118. // 是否为主键
  119. IsPrimaryKey bool `json:"is_primary_key"`
  120. // 是否允许为空
  121. IsNullable bool `json:"is_nullable"`
  122. // 小数位数(对于decimal类型)
  123. DecimalPlaces *int `json:"decimal_places,omitempty"`
  124. }