apiPlugin.go 2.7 KB
Newer Older
E
eoLinker API Management 已提交
1 2
package api

Y
Your Name 已提交
3
//BatchEditAPIPluginStatus BatchEditAPIPluginStatus批量修改接口插件状态
Y
Your Name 已提交
4
func BatchEditAPIPluginStatus(connIDList, strategyID string, pluginStatus, userID int) (bool, string, error) {
Y
Your Name 已提交
5
	flag, result, err := apiPluginDao.BatchEditAPIPluginStatus(connIDList, strategyID, pluginStatus, userID)
E
eoLinker API Management 已提交
6 7 8
	return flag, result, err
}

Y
Your Name 已提交
9 10
//BatchDeleteAPIPlugin 批量删除接口插件
func BatchDeleteAPIPlugin(connIDList, strategyID string) (bool, string, error) {
Y
Your Name 已提交
11
	flag, result, err := apiPluginDao.BatchDeleteAPIPlugin(connIDList, strategyID)
Y
Your Name 已提交
12

E
eoLinker API Management 已提交
13 14 15
	return flag, result, err
}

Y
Your Name 已提交
16 17
//AddPluginToAPI 新增插件到接口
func AddPluginToAPI(pluginName, config, strategyID string, apiID, userID int) (bool, interface{}, error) {
Y
Your Name 已提交
18
	flag, result, err := apiPluginDao.AddPluginToAPI(pluginName, config, strategyID, apiID, userID)
Y
Your Name 已提交
19

E
eoLinker API Management 已提交
20 21 22
	return flag, result, err
}

Y
Your Name 已提交
23 24
//EditAPIPluginConfig 修改接口插件配置
func EditAPIPluginConfig(pluginName, config, strategyID string, apiID, userID int) (bool, interface{}, error) {
Y
Your Name 已提交
25
	flag, result, err := apiPluginDao.EditAPIPluginConfig(pluginName, config, strategyID, apiID, userID)
Y
Your Name 已提交
26

E
eoLinker API Management 已提交
27 28 29
	return flag, result, err
}

Y
Your Name 已提交
30 31
//GetAPIPluginList 获取接口插件列表
func GetAPIPluginList(apiID int, strategyID string) (bool, []map[string]interface{}, error) {
Y
Your Name 已提交
32
	return apiPluginDao.GetAPIPluginList(apiID, strategyID)
E
eoLinker API Management 已提交
33 34
}

Y
Your Name 已提交
35
//GetPluginIndex 获取插件优先级
E
eoLinker API Management 已提交
36
func GetPluginIndex(pluginName string) (bool, int, error) {
Y
Your Name 已提交
37
	return apiPluginDao.GetPluginIndex(pluginName)
E
eoLinker API Management 已提交
38 39
}

Y
Your Name 已提交
40
//GetAPIPluginConfig 通过ApiID获取配置信息
Y
Your Name 已提交
41
func GetAPIPluginConfig(apiID int, strategyID, pluginName string) (bool, map[string]string, error) {
Y
Your Name 已提交
42
	return apiPluginDao.GetAPIPluginConfig(apiID, strategyID, pluginName)
E
eoLinker API Management 已提交
43 44
}

Y
Your Name 已提交
45 46
//CheckPluginIsExistInAPI 检查策略组是否绑定插件
func CheckPluginIsExistInAPI(strategyID, pluginName string, apiID int) (bool, error) {
Y
Your Name 已提交
47
	return apiPluginDao.CheckPluginIsExistInAPI(strategyID, pluginName, apiID)
E
eoLinker API Management 已提交
48 49
}

Y
Your Name 已提交
50 51
//GetAllAPIPluginInStrategy 获取策略组中所有接口插件列表
func GetAllAPIPluginInStrategy(strategyID string) (bool, []map[string]interface{}, error) {
Y
Your Name 已提交
52
	return apiPluginDao.GetAllAPIPluginInStrategy(strategyID)
E
eoLinker API Management 已提交
53 54 55 56
}

// GetAPIPluginInStrategyByAPIID 获取策略组中所有接口插件列表
func GetAPIPluginInStrategyByAPIID(strategyID string, apiID int, keyword string, condition int) (bool, []map[string]interface{}, map[string]interface{}, error) {
Y
Your Name 已提交
57
	return apiPluginDao.GetAPIPluginInStrategyByAPIID(strategyID, apiID, keyword, condition)
E
eoLinker API Management 已提交
58 59
}

Y
Your Name 已提交
60
//GetAPIPluginListWithNotAssignAPIList 获取没有绑定插件得接口列表
Y
Your Name 已提交
61
func GetAPIPluginListWithNotAssignAPIList(strategyID string) (bool, []map[string]interface{}, error) {
Y
Your Name 已提交
62
	return apiPluginDao.GetAPIPluginListWithNotAssignAPIList(strategyID)
E
eoLinker API Management 已提交
63
}