project.go 1.7 KB
Newer Older
E
eoLinker API Management 已提交
1 2 3
package project

import (
黄孟柱 已提交
4 5 6
	"github.com/eolinker/goku-api-gateway/server/dao"
	console_mysql "github.com/eolinker/goku-api-gateway/server/dao/console-mysql"
	entity "github.com/eolinker/goku-api-gateway/server/entity/console-entity"
E
eoLinker API Management 已提交
7 8
)

Y
Your Name 已提交
9
//AddProject 新建项目
E
eoLinker API Management 已提交
10 11 12 13
func AddProject(projectName string) (bool, interface{}, error) {
	return console_mysql.AddProject(projectName)
}

Y
Your Name 已提交
14
//EditProject 修改项目信息
E
eoLinker API Management 已提交
15 16 17 18
func EditProject(projectName string, projectID int) (bool, string, error) {
	return console_mysql.EditProject(projectName, projectID)
}

Y
Your Name 已提交
19
//DeleteProject 修改项目信息
E
eoLinker API Management 已提交
20 21 22 23 24 25 26 27 28
func DeleteProject(projectID int) (bool, string, error) {
	flag, result, err := console_mysql.DeleteProject(projectID)
	if flag {
		name := "goku_gateway_api"
		dao.UpdateTable(name)
	}
	return flag, result, err
}

Y
Your Name 已提交
29
//BatchDeleteProject 批量删除项目
E
eoLinker API Management 已提交
30 31 32 33 34 35 36 37 38
func BatchDeleteProject(projectIDList string) (bool, string, error) {
	flag, result, err := console_mysql.BatchDeleteProject(projectIDList)
	if flag {
		name := "goku_gateway_api"
		dao.UpdateTable(name)
	}
	return flag, result, err
}

Y
Your Name 已提交
39
//GetProjectInfo 获取项目信息
E
eoLinker API Management 已提交
40 41 42 43
func GetProjectInfo(projectID int) (bool, entity.Project, error) {
	return console_mysql.GetProjectInfo(projectID)
}

Y
Your Name 已提交
44
//GetProjectList 获取项目列表
E
eoLinker API Management 已提交
45 46 47 48
func GetProjectList(keyword string) (bool, []*entity.Project, error) {
	return console_mysql.GetProjectList(keyword)
}

Y
Your Name 已提交
49
//CheckProjectIsExist 检查项目是否存在
E
eoLinker API Management 已提交
50 51 52 53
func CheckProjectIsExist(projectID int) (bool, error) {
	return console_mysql.CheckProjectIsExist(projectID)
}

Y
Your Name 已提交
54 55 56
//GetAPIListFromProjectNotInStrategy 获取项目列表中没有被策略组绑定的接口
func GetAPIListFromProjectNotInStrategy() (bool, []map[string]interface{}, error) {
	return console_mysql.GetAPIListFromProjectNotInStrategy()
E
eoLinker API Management 已提交
57
}