1- import { Result } from '@/request/Result'
2- import { get , post , postStream , del , put , request , download , exportFile } from '@/request/index'
3- import type { pageRequest } from '@/api/type/common'
4- import type { ApplicationFormType } from '@/api/type/application'
5- import { type Ref } from 'vue'
1+ import { Result } from '@/request/Result'
2+ import { get , post , postStream , del , put , request , download , exportFile } from '@/request/index'
3+ import type { pageRequest } from '@/api/type/common'
4+ import type { ApplicationFormType } from '@/api/type/application'
5+ import { type Ref } from 'vue'
66import useStore from '@/stores'
77
8- const prefix : any = { _value : '/workspace/' }
8+ const prefix : any = { _value : '/workspace/' }
99Object . defineProperty ( prefix , 'value' , {
1010 get : function ( ) {
11- const { user } = useStore ( )
11+ const { user} = useStore ( )
1212 return this . _value + user . getWorkspaceId ( ) + '/application'
1313 } ,
1414} )
@@ -187,6 +187,32 @@ const chat: (chat_id: string, data: any) => Promise<any> = (chat_id, data) => {
187187const getChatUserAuthType : ( loading ?: Ref < boolean > ) => Promise < any > = ( loading ) => {
188188 return get ( `/chat_user/auth/types` , { } , loading )
189189}
190+
191+ /**
192+ * 获取平台状态
193+ */
194+ const getPlatformStatus : ( application_id : string ) => Promise < Result < any > > = ( application_id ) => {
195+ return get ( `${ prefix . value } /${ application_id } /platform/status` )
196+ }
197+ /**
198+ * 更新平台状态
199+ */
200+ const updatePlatformStatus : ( application_id : string , data : any ) => Promise < Result < any > > = (
201+ application_id ,
202+ data
203+ ) => {
204+ return post ( `${ prefix . value } /${ application_id } /platform/status` , data )
205+ }
206+ /**
207+ * 获取平台配置
208+ */
209+ const getPlatformConfig : ( application_id : string , type : string ) => Promise < Result < any > > = (
210+ application_id ,
211+ type
212+ ) => {
213+ return get ( `${ prefix . value } /${ application_id } /platform/${ type } ` )
214+ }
215+
190216export default {
191217 getAllApplication,
192218 getApplication,
@@ -203,4 +229,7 @@ export default {
203229 chat,
204230 getChatUserAuthType,
205231 getApplicationSetting,
232+ getPlatformStatus,
233+ updatePlatformStatus,
234+ getPlatformConfig
206235}
0 commit comments