135 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
		
		
			
		
	
	
			135 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|  | syntax = "v1" | |||
|  | 
 | |||
|  | info ( | |||
|  | 	title:   "查询服务" | |||
|  | 	desc:    "查询服务" | |||
|  | 	author:  "Liangzai" | |||
|  | 	email:   "2440983361@qq.com" | |||
|  | 	version: "v1" | |||
|  | ) | |||
|  | 
 | |||
|  | @server ( | |||
|  | 	prefix: api/v1/admin/query | |||
|  | 	group:  admin_query | |||
|  | 	jwt:    JwtAuth | |||
|  | ) | |||
|  | service main { | |||
|  | 	@doc "获取查询详情" | |||
|  | 	@handler AdminGetQueryDetailByOrderId | |||
|  | 	get /detail/:order_id (AdminGetQueryDetailByOrderIdReq) returns (AdminGetQueryDetailByOrderIdResp) | |||
|  | 
 | |||
|  | 	@doc "获取清理日志列表" | |||
|  | 	@handler AdminGetQueryCleanupLogList | |||
|  | 	get /cleanup/logs (AdminGetQueryCleanupLogListReq) returns (AdminGetQueryCleanupLogListResp) | |||
|  | 
 | |||
|  | 	@doc "获取清理详情列表" | |||
|  | 	@handler AdminGetQueryCleanupDetailList | |||
|  | 	get /cleanup/details/:log_id (AdminGetQueryCleanupDetailListReq) returns (AdminGetQueryCleanupDetailListResp) | |||
|  | 
 | |||
|  | 	@doc "获取清理配置列表" | |||
|  | 	@handler AdminGetQueryCleanupConfigList | |||
|  | 	get /cleanup/configs (AdminGetQueryCleanupConfigListReq) returns (AdminGetQueryCleanupConfigListResp) | |||
|  | 
 | |||
|  | 	@doc "更新清理配置" | |||
|  | 	@handler AdminUpdateQueryCleanupConfig | |||
|  | 	put /cleanup/config (AdminUpdateQueryCleanupConfigReq) returns (AdminUpdateQueryCleanupConfigResp) | |||
|  | } | |||
|  | 
 | |||
|  | type AdminGetQueryDetailByOrderIdReq { | |||
|  | 	OrderId int64 `path:"order_id"` | |||
|  | } | |||
|  | 
 | |||
|  | type AdminGetQueryDetailByOrderIdResp { | |||
|  | 	Id          int64                  `json:"id"`           // 主键ID | |||
|  | 	OrderId     int64                  `json:"order_id"`     // 订单ID | |||
|  | 	UserId      int64                  `json:"user_id"`      // 用户ID | |||
|  | 	ProductName string                 `json:"product_name"` // 产品ID | |||
|  | 	QueryParams map[string]interface{} `json:"query_params"` | |||
|  | 	QueryData   []AdminQueryItem       `json:"query_data"` | |||
|  | 	CreateTime  string                 `json:"create_time"` // 创建时间 | |||
|  | 	UpdateTime  string                 `json:"update_time"` // 更新时间 | |||
|  | 	QueryState  string                 `json:"query_state"` // 查询状态 | |||
|  | } | |||
|  | 
 | |||
|  | type AdminQueryItem { | |||
|  | 	Feature interface{} `json:"feature"` | |||
|  | 	Data    interface{} `json:"data"` // 这里可以是 map 或 具体的 struct | |||
|  | } | |||
|  | 
 | |||
|  | // 清理日志相关请求响应定义 | |||
|  | type AdminGetQueryCleanupLogListReq { | |||
|  | 	Page      int64  `form:"page,default=1"`       // 页码 | |||
|  | 	PageSize  int64  `form:"page_size,default=20"` // 每页数量 | |||
|  | 	Status    int64  `form:"status,optional"`      // 状态:1-成功,2-失败 | |||
|  | 	StartTime string `form:"start_time,optional"`  // 开始时间 | |||
|  | 	EndTime   string `form:"end_time,optional"`    // 结束时间 | |||
|  | } | |||
|  | 
 | |||
|  | type AdminGetQueryCleanupLogListResp { | |||
|  | 	Total int64                 `json:"total"` // 总数 | |||
|  | 	Items []QueryCleanupLogItem `json:"items"` // 列表 | |||
|  | } | |||
|  | 
 | |||
|  | type QueryCleanupLogItem { | |||
|  | 	Id            int64  `json:"id"`             // 主键ID | |||
|  | 	CleanupTime   string `json:"cleanup_time"`   // 清理时间 | |||
|  | 	CleanupBefore string `json:"cleanup_before"` // 清理截止时间 | |||
|  | 	Status        int64  `json:"status"`         // 状态:1-成功,2-失败 | |||
|  | 	AffectedRows  int64  `json:"affected_rows"`  // 影响行数 | |||
|  | 	ErrorMsg      string `json:"error_msg"`      // 错误信息 | |||
|  | 	Remark        string `json:"remark"`         // 备注 | |||
|  | 	CreateTime    string `json:"create_time"`    // 创建时间 | |||
|  | } | |||
|  | 
 | |||
|  | // 清理详情相关请求响应定义 | |||
|  | type AdminGetQueryCleanupDetailListReq { | |||
|  | 	LogId    int64 `path:"log_id"`               // 清理日志ID | |||
|  | 	Page     int64 `form:"page,default=1"`       // 页码 | |||
|  | 	PageSize int64 `form:"page_size,default=20"` // 每页数量 | |||
|  | } | |||
|  | 
 | |||
|  | type AdminGetQueryCleanupDetailListResp { | |||
|  | 	Total int64                    `json:"total"` // 总数 | |||
|  | 	Items []QueryCleanupDetailItem `json:"items"` // 列表 | |||
|  | } | |||
|  | 
 | |||
|  | type QueryCleanupDetailItem { | |||
|  | 	Id            int64  `json:"id"`              // 主键ID | |||
|  | 	CleanupLogId  int64  `json:"cleanup_log_id"`  // 清理日志ID | |||
|  | 	QueryId       int64  `json:"query_id"`        // 查询ID | |||
|  | 	OrderId       int64  `json:"order_id"`        // 订单ID | |||
|  | 	UserId        int64  `json:"user_id"`         // 用户ID | |||
|  | 	ProductName   string `json:"product_name"`    // 产品名称 | |||
|  | 	QueryState    string `json:"query_state"`     // 查询状态 | |||
|  | 	CreateTimeOld string `json:"create_time_old"` // 原创建时间 | |||
|  | 	CreateTime    string `json:"create_time"`     // 创建时间 | |||
|  | } | |||
|  | 
 | |||
|  | // 清理配置相关请求响应定义 | |||
|  | type AdminGetQueryCleanupConfigListReq { | |||
|  | 	Status int64 `form:"status,optional"` // 状态:1-启用,0-禁用 | |||
|  | } | |||
|  | 
 | |||
|  | type AdminGetQueryCleanupConfigListResp { | |||
|  | 	Items []QueryCleanupConfigItem `json:"items"` // 配置列表 | |||
|  | } | |||
|  | 
 | |||
|  | type QueryCleanupConfigItem { | |||
|  | 	Id          int64  `json:"id"`           // 主键ID | |||
|  | 	ConfigKey   string `json:"config_key"`   // 配置键 | |||
|  | 	ConfigValue string `json:"config_value"` // 配置值 | |||
|  | 	ConfigDesc  string `json:"config_desc"`  // 配置描述 | |||
|  | 	Status      int64  `json:"status"`       // 状态:1-启用,0-禁用 | |||
|  | 	CreateTime  string `json:"create_time"`  // 创建时间 | |||
|  | 	UpdateTime  string `json:"update_time"`  // 更新时间 | |||
|  | } | |||
|  | 
 | |||
|  | type AdminUpdateQueryCleanupConfigReq { | |||
|  | 	Id          int64  `json:"id"`           // 主键ID | |||
|  | 	ConfigValue string `json:"config_value"` // 配置值 | |||
|  | 	Status      int64  `json:"status"`       // 状态:1-启用,0-禁用 | |||
|  | } | |||
|  | 
 | |||
|  | type AdminUpdateQueryCleanupConfigResp { | |||
|  | 	Success bool `json:"success"` // 是否成功 | |||
|  | } |