|
|
@@ -3,8 +3,8 @@ import request from '@/service/request'
|
|
|
/**
|
|
|
* API列表分页查询
|
|
|
* */
|
|
|
-export function getApiTableList (params) {
|
|
|
- return request({
|
|
|
+export function getApiTableList (params: COMMON.API.QueryParams) {
|
|
|
+ return request<DC.API.Api[]>({
|
|
|
url: '/apiCenter/page',
|
|
|
method: 'GET',
|
|
|
params
|
|
|
@@ -14,8 +14,8 @@ export function getApiTableList (params) {
|
|
|
/**
|
|
|
* API列表编辑弹框修改
|
|
|
*/
|
|
|
-export async function updateApiTableItem (data) {
|
|
|
- return request({
|
|
|
+export async function updateApiTableItem (data: DC.API.Api) {
|
|
|
+ return request<string>({
|
|
|
url: '/apiCenter',
|
|
|
method: 'PUT',
|
|
|
data
|
|
|
@@ -27,7 +27,7 @@ export async function updateApiTableItem (data) {
|
|
|
* 用appId获取
|
|
|
*/
|
|
|
export async function getDetailById (data) {
|
|
|
- return request({
|
|
|
+ return request<DC.API.Api>({
|
|
|
url: `/apiCenter?id=${data.id}&serviceId=${data.serviceId}${data.vid ? ('&vId=' + data.vid) : ''}`,
|
|
|
method: 'GET'
|
|
|
})
|
|
|
@@ -37,7 +37,7 @@ export async function getDetailById (data) {
|
|
|
* 根据id删除api
|
|
|
*/
|
|
|
export function delDataById (id: string) {
|
|
|
- return request({
|
|
|
+ return request<string>({
|
|
|
url: `/apiCenter/${id}`,
|
|
|
method: 'DELETE'
|
|
|
})
|
|
|
@@ -46,14 +46,24 @@ export function delDataById (id: string) {
|
|
|
/**
|
|
|
* API新增
|
|
|
*/
|
|
|
-export function addApi (data) {
|
|
|
- return request({
|
|
|
+export function addApi (data: DC.API.Api) {
|
|
|
+ return request<string>({
|
|
|
url: '/apiCenter',
|
|
|
method: 'POST',
|
|
|
data
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 将api按分组查询树结构
|
|
|
+ */
|
|
|
+export function getApiByTree (id: string) {
|
|
|
+ return request<string>({
|
|
|
+ url: `/apiCenter/tree?id=${id}`,
|
|
|
+ method: 'GET'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 根据serviceId获取api使用情况
|
|
|
*/
|