1+ /**
2+ * Copyright (c) 2023 - present TinyEngine Authors.
3+ * Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
4+ *
5+ * Use of this source code is governed by an MIT-style license.
6+ *
7+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10+ *
11+ */
12+
13+ /* metaService: engine.plugins.blockmanage.js-http */
14+ import { getMetaApi , META_SERVICE } from '@opentiny/tiny-engine-meta-register'
15+
16+ const baseUrl = 'http://10.234.151.79:9090'
17+ export const isDevelopEnv = import . meta. env . MODE ?. includes ( 'dev' )
18+ // 模版管理 -- 获取模版列表
19+ export const fetchTemplateList = ( params ) => getMetaApi ( META_SERVICE . Http ) . get ( `${ baseUrl } /app-center/api/app-template/list` , { params} )
20+
21+ // 模版管理 -- 通过模板创建应用
22+ export const createAppFromTemplate = ( params ) => getMetaApi ( META_SERVICE . Http ) . post ( `${ baseUrl } /app-center/api/app-template/create` , params )
23+
24+ // 模版管理 -- 业务场景全查询
25+ export const fetchBusinessCategory = ( ) => getMetaApi ( META_SERVICE . Http ) . get ( `${ baseUrl } /material-center/api/business-category/list` )
26+
27+ // 模版管理 -- 按分类查询业务场景
28+ export const fetchBusinessCategoryByGroup = ( group ) => getMetaApi ( META_SERVICE . Http ) . get ( `${ baseUrl } /material-center/api/business-category/find?group=${ group } ` )
29+
30+ // 应用管理 -- 获取应用列表
31+ export const fetchApplicationList = ( params ) => getMetaApi ( META_SERVICE . Http ) . get ( `${ baseUrl } /app-center/api/apps/page` , { params} ) // currentPage pageSize
32+
33+ // 应用管理 -- 创建应用
34+ export const createApplication = ( params ) => getMetaApi ( META_SERVICE . Http ) . post ( `${ baseUrl } /app-center/api/apps/create` , params )
35+
36+ // 应用管理 -- 编辑应用
37+ export const updateApplication = ( id , params ) => getMetaApi ( META_SERVICE . Http ) . post ( `${ baseUrl } /app-center/api/apps/update/${ id } ` , params )
38+
39+ // 应用管理 -- 删除应用
40+ export const deleteApplication = ( id ) => getMetaApi ( META_SERVICE . Http ) . get ( `${ baseUrl } /app-center/api/apps/delete/${ id } ` )
41+
42+ // 模板管理 -- 查询页面列表
43+ export const getPageList = ( id ) => getMetaApi ( META_SERVICE . Http ) . get ( `/app-center/api/pages/list/${ id } ` )
0 commit comments