api2sql基础的能力 #8
@ -11,6 +11,7 @@ import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"git.zhangdeman.cn/zhangdeman/consts"
 | 
			
		||||
	"git.zhangdeman.cn/zhangdeman/database/abstract"
 | 
			
		||||
	"git.zhangdeman.cn/zhangdeman/database/define"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -19,6 +20,16 @@ var (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type execute struct {
 | 
			
		||||
	databaseClientManager abstract.IWrapperClient // 全部数据库管理的实例
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetDatabaseClientManager 设置数据库连接管理实例
 | 
			
		||||
//
 | 
			
		||||
// Author : go_developer@163.com<白茶清欢>
 | 
			
		||||
//
 | 
			
		||||
// Date : 21:06 2024/8/21
 | 
			
		||||
func (e *execute) SetDatabaseClientManager(databaseClientManager abstract.IWrapperClient) {
 | 
			
		||||
	e.databaseClientManager = databaseClientManager
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Run 执行
 | 
			
		||||
 | 
			
		||||
@ -19,6 +19,7 @@ type Api2SqlParam struct {
 | 
			
		||||
	SplitField    string               `json:"split_field"`    // 分表字段, 仅分表时有效, 分表字段要求在 ValueList 必须存在
 | 
			
		||||
	SplitStrategy string               `json:"split_strategy"` // 分表策略, 仅分表时有效, 支持注册自动以策略
 | 
			
		||||
	SqlType       string               `json:"sql_type"`       // sql语句类型 : detail - 查询详情 list - 查询列表  count - 查询数量 update - 更新 insert - 插入 delete - 删除
 | 
			
		||||
	FieldList     []string             `json:"field_list"`     // 仅针对 select / detail 有效, 查询的字段列表
 | 
			
		||||
	OrderField    string               `json:"order_field"`    // 排序字段, 仅 sqlType = list 生效
 | 
			
		||||
	OrderRule     string               `json:"order_rule"`     // 排序规则, Asc / Desc
 | 
			
		||||
	WithCount     bool                 `json:"with_count"`     // 是否返回数据总量, 仅 sqlType = list 生效
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user