| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- package request
-
- import (
- "time"
- )
-
- // ExchangeRequest 创建交换机的请求
- type ExchangeRequest struct {
- ChannelName string `json:"channel_name"`
- ExchangeName string `json:"exchange_name"`
- ExchangeType string `json:"exchange_type"` // direct, fanout, topic, headers
- Durable bool `json:"durable"`
- Internal bool `json:"internal"`
- AutoDelete bool `json:"auto_delete"`
- NoWait bool `json:"no_wait"`
- Arguments map[string]string `json:"arguments"`
- }
-
- // QueueRequest 创建队列的请求
- type QueueRequest struct {
- ChannelName string `json:"channel_name"`
- QueueName string `json:"queue_name"`
- Durable bool `json:"durable"`
- Exclusive bool `json:"exclusive"`
- AutoDelete bool `json:"auto_delete"`
- NoWait bool `json:"no_wait"`
- Url string `json:"url"`
- Concurrency int `json:"Concurrency"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
-
- Arguments map[string]string `json:"arguments"`
- }
-
- // BindRequest 绑定队列的请求
- type QueueBindRequest struct {
- ChannelName string `json:"channel_name"`
- QueueName string `json:"queue_name"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
- NoWait bool `json:"no_wait"`
- Arguments map[string]string `json:"arguments"`
- }
-
- // MessageRequest 发送消息的请求
- type MessageRequest struct {
- ChannelName string `json:"channel_name"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
- Message interface{} `json:"message"`
- ContentType string `json:"content_type"`
- Headers map[string]interface{} `json:"headers"`
- Priority uint8 `json:"priority"`
- CorrelationID string `json:"correlation_id"`
- ReplyTo string `json:"reply_to"`
- Expiration string `json:"expiration"`
- MessageID string `json:"message_id"`
- Timestamp time.Time `json:"timestamp"`
- Type string `json:"type"`
- AppID string `json:"app_id"`
- }
-
- // BytesMessageRequest 发送字节消息的请求
- type BytesMessageRequest struct {
- ChannelName string `json:"channel_name"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
- Data []byte `json:"data"`
- ContentType string `json:"content_type"`
- Headers map[string]string `json:"headers"`
- }
-
- // QueueInfoRequest 获取队列信息的请求
- type QueueInfoRequest struct {
- ChannelName string `json:"channel_name,omitempty"`
- QueueName string `json:"queue_name,omitempty"`
- }
-
- // RabbitMQResult RabbitMQ操作结果
- // type RabbitMQResult struct {
- // Success bool `json:"success"`
- // Error string `json:"error,omitempty"`
- // Data interface{} `json:"data,omitempty"`
- // Message string `json:"message,omitempty"`
- // Time string `json:"time"`
- // Exchange string `json:"exchange,omitempty"`
- // Queue string `json:"queue,omitempty"`
- // MessageID string `json:"message_id,omitempty"`
- // QueueInfo interface{} `json:"queue_info,omitempty"`
- // }
-
- // QueryRequest 查询请求
- type QueryRequest struct {
- SQL string `json:"sql" binding:"required"`
- Params map[string]interface{} `json:"params,omitempty"` //名称参数
- PositionalParams []interface{} `json:"positionalParams,omitempty"` // 位置参数
- WriterHeader bool `json:"writerHeader,omitempty"` //如果查询返回cvs格式时候,包含表头还是不包含。true包含。第一行是表头
- AgentUrl string `json:"agentUrl,omitempty"` //远程服务器地址
- AgentToken string `json:"agentToken,omitempty"` //远程代理服务器token
- DorisDatabase string `json:"dorisDatabase,omitempty"` //doris数据库名称
- DorisTable string `json:"dorisTable,omitempty"` //doris数据库里的表名称
-
- }
-
- // TableRequest 表字典
- type TableRequest struct {
- TableName string `json:"table_name"`
- TableNameCN string `json:"table_name_cn"`
- Description string `json:"description"`
- PrimaryKeyFieldName string `json:"primary_key_field_name"`
- }
-
- // TablesRequest 表字典集合
- type TablesRequest struct {
- TableNames []*TableRequest `json:"table_names"`
- FieldInfos []*FieldInfo `json:"field_names"`
- }
-
- // FieldInfo 字段信息
- type FieldInfo struct {
- TableName string `json:"table_name"`
- // 字段名称(英文/数据库字段名)
- FieldName string `json:"field_name"`
- // 字段中文名称
- FieldNameCN string `json:"field_name_cn"`
- // 字段描述
- Description string `json:"description"`
- // 字段类型(如:varchar, int, datetime等)
- FieldType string `json:"field_type"`
- // 字段长度/精度
- FieldLength *int `json:"field_length,omitempty"`
- // 是否为主键
- IsPrimaryKey bool `json:"is_primary_key"`
- // 是否允许为空
- IsNullable bool `json:"is_nullable"`
- // 小数位数(对于decimal类型)
- DecimalPlaces *int `json:"decimal_places,omitempty"`
- }
|