strategyGroup.go 1.1 KB
Newer Older
E
eoLinker API Management 已提交
1 2 3 4 5 6
package strategy

import (
	"errors"
)

Y
Your Name 已提交
7
//AddStrategyGroup 新建策略组分组
E
eoLinker API Management 已提交
8
func AddStrategyGroup(groupName string) (bool, interface{}, error) {
Y
Your Name 已提交
9
	return strategyGroupDao.AddStrategyGroup(groupName)
E
eoLinker API Management 已提交
10 11
}

Y
Your Name 已提交
12
//EditStrategyGroup 修改策略组分组
E
eoLinker API Management 已提交
13
func EditStrategyGroup(groupName string, groupID int) (bool, string, error) {
Y
Your Name 已提交
14
	return strategyGroupDao.EditStrategyGroup(groupName, groupID)
E
eoLinker API Management 已提交
15 16 17 18
}

// DeleteStrategyGroup 删除策略组分组
func DeleteStrategyGroup(groupID int) (bool, string, error) {
Y
Your Name 已提交
19
	flag := strategyGroupDao.CheckIsOpenGroup(groupID)
E
eoLinker API Management 已提交
20 21 22
	if flag {
		return false, "[ERROR]The group is an open group", errors.New("[ERROR]The group is an open group")
	}
Y
Your Name 已提交
23
	flag, result, err := strategyGroupDao.DeleteStrategyGroup(groupID)
Y
Your Name 已提交
24

Y
Your Name 已提交
25
	return flag, result, err
E
eoLinker API Management 已提交
26 27
}

Y
Your Name 已提交
28
//GetStrategyGroupList 获取策略组分组列表
E
eoLinker API Management 已提交
29
func GetStrategyGroupList() (bool, []map[string]interface{}, error) {
Y
Your Name 已提交
30
	return strategyGroupDao.GetStrategyGroupList()
E
eoLinker API Management 已提交
31 32
}

Y
Your Name 已提交
33
//CheckIsOpenGroup 判断是否是开放分组
E
eoLinker API Management 已提交
34
func CheckIsOpenGroup(groupID int) bool {
Y
Your Name 已提交
35
	return strategyGroupDao.CheckIsOpenGroup(groupID)
E
eoLinker API Management 已提交
36
}