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

import (
Y
Your Name 已提交
4
	console_sqlite3 "github.com/eolinker/goku-api-gateway/server/dao/console-sqlite3"
黄孟柱 已提交
5
	entity "github.com/eolinker/goku-api-gateway/server/entity/console-entity"
E
eoLinker API Management 已提交
6 7
)

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

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

Y
Your Name 已提交
18
//DeleteProject 修改项目信息
E
eoLinker API Management 已提交
19
func DeleteProject(projectID int) (bool, string, error) {
Y
Your Name 已提交
20 21
	flag, result, err := console_sqlite3.DeleteProject(projectID)

E
eoLinker API Management 已提交
22 23 24
	return flag, result, err
}

Y
Your Name 已提交
25
//BatchDeleteProject 批量删除项目
E
eoLinker API Management 已提交
26
func BatchDeleteProject(projectIDList string) (bool, string, error) {
Y
Your Name 已提交
27
	flag, result, err := console_sqlite3.BatchDeleteProject(projectIDList)
E
eoLinker API Management 已提交
28 29 30
	return flag, result, err
}

Y
Your Name 已提交
31
//GetProjectInfo 获取项目信息
E
eoLinker API Management 已提交
32
func GetProjectInfo(projectID int) (bool, entity.Project, error) {
Y
Your Name 已提交
33
	return console_sqlite3.GetProjectInfo(projectID)
E
eoLinker API Management 已提交
34 35
}

Y
Your Name 已提交
36
//GetProjectList 获取项目列表
E
eoLinker API Management 已提交
37
func GetProjectList(keyword string) (bool, []*entity.Project, error) {
Y
Your Name 已提交
38
	return console_sqlite3.GetProjectList(keyword)
E
eoLinker API Management 已提交
39 40
}

Y
Your Name 已提交
41
//CheckProjectIsExist 检查项目是否存在
E
eoLinker API Management 已提交
42
func CheckProjectIsExist(projectID int) (bool, error) {
Y
Your Name 已提交
43
	return console_sqlite3.CheckProjectIsExist(projectID)
E
eoLinker API Management 已提交
44 45
}

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