diff --git a/src/assets/images/illustration.png b/src/assets/images/illustration.png deleted file mode 100644 index cffa9007..00000000 Binary files a/src/assets/images/illustration.png and /dev/null differ diff --git a/src/assets/templates/java.tpl b/src/assets/templates/java.tpl deleted file mode 100644 index 710bc18c..00000000 --- a/src/assets/templates/java.tpl +++ /dev/null @@ -1,17 +0,0 @@ -JSONObject jsonObject = new JSONObject(); -{{#body}} -jsonObject.put("{{{key}}}", {{{value}}}); -{{/body}} -MediaType mediaType = "application/json; charset=utf-8".toMediaType(); -RequestBody body = jsonObject.toString().toRequestBody(mediaType); -Request request = new Request.Builder() - .url("{{{url}}}") - .{{{method}}}(body) -{{#headers}} - .addHeader("{{{key}}}", {{{value}}}) -{{/headers}} - .build(); - -OkHttpClient client = new OkHttpClient(); -Response response = client.newCall(request).execute(); -System.out.print(response.body!!.string()) \ No newline at end of file diff --git a/src/assets/templates/javascript.tpl b/src/assets/templates/javascript.tpl deleted file mode 100644 index 4bd5ac15..00000000 --- a/src/assets/templates/javascript.tpl +++ /dev/null @@ -1,18 +0,0 @@ -const options = { - method: '{{{method}}}', - headers: { -{{#headers}} - '{{{key}}}': {{{value}}}{{^last}},{{/last}} -{{/headers}} - }, - body: JSON.stringify({ -{{#body}} - '{{{key}}}': {{{value}}}{{^last}},{{/last}} -{{/body}} - }) -}; - -fetch('{{{url}}}', options) - .then(response => response.json()) - .then(response => console.log(response)) - .catch(err => console.error(err)); \ No newline at end of file diff --git a/src/assets/templates/php.tpl b/src/assets/templates/php.tpl deleted file mode 100644 index e9bf918e..00000000 --- a/src/assets/templates/php.tpl +++ /dev/null @@ -1,19 +0,0 @@ -request('{{{method}}}', '{{{url}}}', [ - 'body' => '{ -{{#body}} - "{{{key}}}": {{{value}}}{{^last}},{{/last}} -{{/body}} - }', - 'headers' => [ -{{#headers}} - '{{{key}}}': {{{value}}}{{^last}},{{/last}} -{{/headers}} - ], -]); - -echo $response->getBody(); \ No newline at end of file diff --git a/src/assets/templates/python.tpl b/src/assets/templates/python.tpl deleted file mode 100644 index 9080ba7a..00000000 --- a/src/assets/templates/python.tpl +++ /dev/null @@ -1,18 +0,0 @@ -import requests - -url = '{{{url}}}' - -headers = { -{{#headers}} - '{{{key}}}': {{{value}}}{{^last}},{{/last}} -{{/headers}} -} - -payload = { -{{#body}} - '{{{key}}}': {{{value}}}{{^last}},{{/last}} -{{/body}} -} - -response = requests.{{{method}}}(url, json=payload, headers=headers) -print(response.text) \ No newline at end of file diff --git a/src/components/api/Code.vue b/src/components/api/Code.vue deleted file mode 100644 index 54326775..00000000 --- a/src/components/api/Code.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - - diff --git a/src/components/api/Form.vue b/src/components/api/Form.vue deleted file mode 100644 index bf001b30..00000000 --- a/src/components/api/Form.vue +++ /dev/null @@ -1,296 +0,0 @@ - - - - - diff --git a/src/components/api/Info.vue b/src/components/api/Info.vue deleted file mode 100644 index 0b9298d3..00000000 --- a/src/components/api/Info.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/src/components/api/Preview.vue b/src/components/api/Preview.vue deleted file mode 100644 index 3a354190..00000000 --- a/src/components/api/Preview.vue +++ /dev/null @@ -1,158 +0,0 @@ - - - - - diff --git a/src/components/api/ResponseBody.vue b/src/components/api/ResponseBody.vue deleted file mode 100644 index 4e3f7a80..00000000 --- a/src/components/api/ResponseBody.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - - - diff --git a/src/components/api/Responses.vue b/src/components/api/Responses.vue deleted file mode 100644 index 2db3cf5a..00000000 --- a/src/components/api/Responses.vue +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - diff --git a/src/components/api/Try.vue b/src/components/api/Try.vue deleted file mode 100644 index e8aef18f..00000000 --- a/src/components/api/Try.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/src/components/api/Usage.vue b/src/components/api/Usage.vue deleted file mode 100644 index 911fd338..00000000 --- a/src/components/api/Usage.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - - - diff --git a/src/components/application/Confirm.vue b/src/components/application/Confirm.vue index facfab97..5b225d88 100644 --- a/src/components/application/Confirm.vue +++ b/src/components/application/Confirm.vue @@ -12,9 +12,6 @@ {{ $t('application.field.api') }} - - {{ $t('application.field.proxy') }} - {{ object?.title }} @@ -23,9 +20,6 @@ {{ object?.free_amount }}{{ $t(`api.unit.${object?.unit}`) }} - - {{ object?.free_amount }}{{ $t(`proxy.unit.${object?.unit}`) }} - @@ -43,7 +37,7 @@ - - diff --git a/src/components/common/Pagination.vue b/src/components/common/Pagination.vue deleted file mode 100644 index 23f8e120..00000000 --- a/src/components/common/Pagination.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - diff --git a/src/components/common/Price.vue b/src/components/common/Price.vue deleted file mode 100644 index ade42833..00000000 --- a/src/components/common/Price.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/components/common/TopHeader.vue b/src/components/common/TopHeader.vue deleted file mode 100644 index eedd232e..00000000 --- a/src/components/common/TopHeader.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/console/Navigator.vue b/src/components/console/Navigator.vue deleted file mode 100644 index e2bcddfa..00000000 --- a/src/components/console/Navigator.vue +++ /dev/null @@ -1,197 +0,0 @@ - - - - - diff --git a/src/components/document/List.vue b/src/components/document/List.vue deleted file mode 100644 index b90f6699..00000000 --- a/src/components/document/List.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - diff --git a/src/components/document/ListItem.vue b/src/components/document/ListItem.vue deleted file mode 100644 index 6d99eda1..00000000 --- a/src/components/document/ListItem.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - diff --git a/src/components/order/Create.vue b/src/components/order/Create.vue deleted file mode 100644 index 119e2df3..00000000 --- a/src/components/order/Create.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - - - diff --git a/src/components/order/Pay.vue b/src/components/order/Pay.vue deleted file mode 100644 index 3e29c788..00000000 --- a/src/components/order/Pay.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - - - diff --git a/src/components/proxy/Info.vue b/src/components/proxy/Info.vue deleted file mode 100644 index 0db7ba78..00000000 --- a/src/components/proxy/Info.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - diff --git a/src/components/proxy/Preview.vue b/src/components/proxy/Preview.vue deleted file mode 100644 index 82870012..00000000 --- a/src/components/proxy/Preview.vue +++ /dev/null @@ -1,158 +0,0 @@ - - - - - diff --git a/src/i18n/zh/api/entity.ts b/src/i18n/zh/api/entity.ts deleted file mode 100644 index 24d77273..00000000 --- a/src/i18n/zh/api/entity.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default { - requestQueries: 'URL参数', - requestBody: '请求体', - responseBody: '响应体', - requestHeaders: '请求头', - requestHeader: '请求头', - responseHeaders: '响应头', - response: '响应', - success: '成功', - failure: '失败', - responseExample: '样例', - authentication: '认证', - arrayOf: '列表', - apiKey: 'API Key' -}; diff --git a/src/i18n/zh/api/index.ts b/src/i18n/zh/api/index.ts deleted file mode 100644 index 3862e014..00000000 --- a/src/i18n/zh/api/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import entity from './entity'; -import unit from './unit'; -import message from './message'; - -export default { - entity, - unit, - message -}; diff --git a/src/i18n/zh/api/message.ts b/src/i18n/zh/api/message.ts deleted file mode 100644 index cd0f6efd..00000000 --- a/src/i18n/zh/api/message.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default { - free: '免费', - appliedCount: '申请次数', - firstFree: '首次送', - custom: '指定次数', - present: '赠送', - around: '约' -}; diff --git a/src/i18n/zh/api/unit.ts b/src/i18n/zh/api/unit.ts deleted file mode 100644 index 672f711e..00000000 --- a/src/i18n/zh/api/unit.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - Count: '次' -}; diff --git a/src/i18n/zh/application/button.ts b/src/i18n/zh/application/button.ts deleted file mode 100644 index 0774553f..00000000 --- a/src/i18n/zh/application/button.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default { - goDocument: '查看文档', - buyMore: '购买更多', - createOrder: '创建订单', - custom: '自定义', - query: '查询' -}; diff --git a/src/i18n/zh/application/field.ts b/src/i18n/zh/application/field.ts deleted file mode 100644 index a7bb5609..00000000 --- a/src/i18n/zh/application/field.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default { - id: '申请ID', - remainingAmount: '剩余量', - usedAmount: '使用量', - apiKey: 'API Key', - service: '服务', - operation: '操作', - amount: '数量', - shouldPayPrice: '应付金额', - api: 'API', - proxy: '代理', - credential: '密钥', - name: '名称', - package: '套餐', - type: '类型', - freeAmount: '免费赠送', - extraPrice: '价格' -}; diff --git a/src/i18n/zh/application/index.ts b/src/i18n/zh/application/index.ts deleted file mode 100644 index b093a5b9..00000000 --- a/src/i18n/zh/application/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import field from './field'; -import button from './button'; -import message from './message'; -import title from './title'; - -export default { - field, - button, - message, - title -}; diff --git a/src/i18n/zh/application/message.ts b/src/i18n/zh/application/message.ts deleted file mode 100644 index d139a9f8..00000000 --- a/src/i18n/zh/application/message.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default { - alreadyApplied: '已经申请过该服务', - applySuccessfully: '申请成功', - notApplied: '你尚未申请过该服务,请先申请该服务之后使用', - yourApplication: '你的申请', - unverified: '您需要完成实名认证之后方可申请该服务', - goVerify: '去实名认证', - requiredParameter: '必填参数', - example: '样例', - readPolicy: '我已阅读并同意', - policy: '《数据技术服务使用协议》', - notAgreePolicy: '您尚未同意《数据技术服务使用协议》', - confirmApplying: '申请服务确认', - rotateCredential: '重置密钥', - rotateCredentialConfirm: '你确定要重置密钥吗?重置后不可恢复', - idDoesNotExist: '申请不存在', - rotateCredentialSuccessfully: '密钥重置成功', - rotateCredentialFailed: '密钥重置失败,请联系处理', - updateFailed: '修改失败', - updateSuccessfully: '修改成功' -}; diff --git a/src/i18n/zh/application/title.ts b/src/i18n/zh/application/title.ts deleted file mode 100644 index 1efa1f92..00000000 --- a/src/i18n/zh/application/title.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - buyService: '购买服务', - applicationRemainingCount: '次数修改', - manageApplication: '申请管理' -}; diff --git a/src/i18n/zh/console/index.ts b/src/i18n/zh/console/index.ts deleted file mode 100644 index 5234bac5..00000000 --- a/src/i18n/zh/console/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import menu from './menu'; - -export default { - menu -}; diff --git a/src/i18n/zh/console/menu.ts b/src/i18n/zh/console/menu.ts deleted file mode 100644 index f34d13df..00000000 --- a/src/i18n/zh/console/menu.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default { - orderList: '订单列表', - applicationList: '申请列表', - userProfile: '个人信息', - idVerify: '实名认证', - manageApplication: '申请管理' -}; diff --git a/src/i18n/zh/index.ts b/src/i18n/zh/index.ts index dcc048da..f0e2f2d6 100644 --- a/src/i18n/zh/index.ts +++ b/src/i18n/zh/index.ts @@ -1,21 +1,9 @@ import common from './common'; import auth from './auth'; -import service from './service'; -import console from './console'; -import application from './application'; -import api from './api'; -import order from './order'; -import proxy from './proxy'; import conversation from './conversation'; export default { common, conversation, - auth, - service, - console, - application, - api, - order, - proxy + auth }; diff --git a/src/i18n/zh/order/button.ts b/src/i18n/zh/order/button.ts deleted file mode 100644 index 1d3a8a91..00000000 --- a/src/i18n/zh/order/button.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - pay: '支付', - continuePay: '继续支付', - checkDetail: '查看详情' -}; diff --git a/src/i18n/zh/order/field.ts b/src/i18n/zh/order/field.ts deleted file mode 100644 index b7703d01..00000000 --- a/src/i18n/zh/order/field.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default { - id: '订单号', - amount: '数量', - price: '金额', - description: '订单描述', - state: '状态', - createdAt: '创建时间', - service: '服务名称', - payWay: '支付方式', - api: 'API', - proxy: '代理' -}; diff --git a/src/i18n/zh/order/index.ts b/src/i18n/zh/order/index.ts deleted file mode 100644 index 71108c7a..00000000 --- a/src/i18n/zh/order/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import field from './field'; -import button from './button'; -import message from './message'; -import state from './state'; -import title from './title'; - -export default { - field, - button, - message, - state, - title -}; diff --git a/src/i18n/zh/order/message.ts b/src/i18n/zh/order/message.ts deleted file mode 100644 index 0a3e7b41..00000000 --- a/src/i18n/zh/order/message.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - paidSuccessfully: '支付成功', - createFailed: '创建失败', - wechatPayHelp: '请打开手机微信,扫一扫完成支付', - free: '免费' -}; diff --git a/src/i18n/zh/order/state.ts b/src/i18n/zh/order/state.ts deleted file mode 100644 index f372d314..00000000 --- a/src/i18n/zh/order/state.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - pending: '待支付', - paid: '已支付', - expired: '支付超时', - failed: '支付失败' -}; diff --git a/src/i18n/zh/order/title.ts b/src/i18n/zh/order/title.ts deleted file mode 100644 index 3b060a17..00000000 --- a/src/i18n/zh/order/title.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - info: '订单信息', - wechatPay: '微信支付', - aliPay: '支付宝' -}; diff --git a/src/i18n/zh/proxy/entity.ts b/src/i18n/zh/proxy/entity.ts deleted file mode 100644 index 83fe3127..00000000 --- a/src/i18n/zh/proxy/entity.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default { - requestQueries: 'URL参数', - requestBody: '请求体', - responseBody: '响应体', - requestHeaders: '请求头', - requestHeader: '请求头', - responseHeaders: '响应头', - response: '响应', - success: '成功', - failure: '失败', - responseExample: '样例', - authentication: '认证' -}; diff --git a/src/i18n/zh/proxy/index.ts b/src/i18n/zh/proxy/index.ts deleted file mode 100644 index 3862e014..00000000 --- a/src/i18n/zh/proxy/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import entity from './entity'; -import unit from './unit'; -import message from './message'; - -export default { - entity, - unit, - message -}; diff --git a/src/i18n/zh/proxy/message.ts b/src/i18n/zh/proxy/message.ts deleted file mode 100644 index 9ed1db18..00000000 --- a/src/i18n/zh/proxy/message.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default { - free: '免费', - appliedCount: '申请次数', - firstFree: '首次送', - custom: '指定量', - present: '赠送', - around: '约' -}; diff --git a/src/i18n/zh/proxy/unit.ts b/src/i18n/zh/proxy/unit.ts deleted file mode 100644 index e31909bd..00000000 --- a/src/i18n/zh/proxy/unit.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - MB: 'MB', - KB: 'KB', - B: 'B' -}; diff --git a/src/i18n/zh/service/button.ts b/src/i18n/zh/service/button.ts deleted file mode 100644 index 5cc04415..00000000 --- a/src/i18n/zh/service/button.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - learnMore: '了解更多', - apply: '立即申请', - introduction: '服务介绍', - apis: '接口说明' -}; diff --git a/src/i18n/zh/service/field.ts b/src/i18n/zh/service/field.ts deleted file mode 100644 index d33eca36..00000000 --- a/src/i18n/zh/service/field.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - price: '价格', - introduction: '介绍', - apis: 'API' -}; diff --git a/src/i18n/zh/service/index.ts b/src/i18n/zh/service/index.ts deleted file mode 100644 index 9d9f8dfc..00000000 --- a/src/i18n/zh/service/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import message from './message'; -import unit from './unit'; -import button from './button'; -import field from './field'; - -export default { - message, - unit, - button, - field -}; diff --git a/src/i18n/zh/service/message.ts b/src/i18n/zh/service/message.ts deleted file mode 100644 index 2b3f855e..00000000 --- a/src/i18n/zh/service/message.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default { - free: '免费', - appliedCount: '申请次数', - indexTitle: '数字化服务的智慧之选', - indexSubtitle: '用一个个标准化服务,助力你工作与生活的方方面面。', - fromPrice: '起' -}; diff --git a/src/i18n/zh/service/unit.ts b/src/i18n/zh/service/unit.ts deleted file mode 100644 index 2332000b..00000000 --- a/src/i18n/zh/service/unit.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - count: '次', - Count: '次', - MB: 'MB' -}; diff --git a/src/layouts/Console.vue b/src/layouts/Console.vue deleted file mode 100644 index 629527cf..00000000 --- a/src/layouts/Console.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - diff --git a/src/layouts/Document.vue b/src/layouts/Document.vue deleted file mode 100644 index a7c341c0..00000000 --- a/src/layouts/Document.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/src/layouts/Service.vue b/src/layouts/Service.vue deleted file mode 100644 index f9b53845..00000000 --- a/src/layouts/Service.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - diff --git a/src/operators/api/models.ts b/src/operators/api/models.ts index 5b993d04..7747ff35 100644 --- a/src/operators/api/models.ts +++ b/src/operators/api/models.ts @@ -1,6 +1,3 @@ -import { IDocument } from '../document'; -import { IService } from '../service'; - export interface IForm { queries?: { [key: string]: string; @@ -73,9 +70,7 @@ export interface IApi { request_id: string; responses: IResponse[]; response_ids: string[]; - document?: IDocument; document_id?: string; - service?: IService; packages?: IPackage[]; service_id?: string; created_at?: string; diff --git a/src/operators/application/models.ts b/src/operators/application/models.ts index 897f6f85..ceb50aa6 100644 --- a/src/operators/application/models.ts +++ b/src/operators/application/models.ts @@ -1,9 +1,7 @@ import { IApi } from '../api'; -import { IProxy } from '../proxy'; export enum IApplicationType { - API = 'Api', - PROXY = 'Proxy' + API = 'Api' } export enum ICredentialType { @@ -24,7 +22,6 @@ export interface ICredential { export interface IApplication { id?: string; api?: IApi; - proxy?: IProxy; type?: IApplicationType; api_id?: string; proxy_id?: string; diff --git a/src/operators/document/index.ts b/src/operators/document/index.ts deleted file mode 100644 index 4a6cbae5..00000000 --- a/src/operators/document/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './models'; -export * from './operator'; diff --git a/src/operators/document/models.ts b/src/operators/document/models.ts deleted file mode 100644 index 23969c7b..00000000 --- a/src/operators/document/models.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { IApi } from '../api/models'; -import { IProxy } from '../proxy'; - -export enum IDocumentType { - API = 'Api', - TEXT = 'Text', - PROXY = 'Proxy' -} - -export interface IDocument { - id?: string; - name?: string; - type: IDocumentType; - title?: string; - content?: string; - rank?: number; - api?: IApi; - proxy?: IProxy; - api_id?: string; - proxy_id?: string; - created_at?: string; - updated_at?: string; -} - -export interface IDocumentListResponse { - count: number; - items: IDocument[]; -} - -export type IDocumentDetailResponse = IDocument; diff --git a/src/operators/document/operator.ts b/src/operators/document/operator.ts deleted file mode 100644 index fda84a44..00000000 --- a/src/operators/document/operator.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AxiosRequestConfig, AxiosResponse } from 'axios'; -import { httpClient } from '../instance'; -import { IDocument, IDocumentDetailResponse, IDocumentListResponse } from './models'; - -export interface IDocumentQuery { - limit: number; - offset: number; - ordering: string; - private: boolean; -} - -class DocumentOperator { - key = 'documents'; - - async getAll(query: IDocumentQuery, config?: AxiosRequestConfig): Promise> { - return await httpClient.get(`/${this.key}/`, { - ...config, - params: query - }); - } - - async get(id: string, config?: AxiosRequestConfig): Promise> { - return await httpClient.get(`/${this.key}/${id}`, config); - } - - async create(data: IDocument, config?: AxiosRequestConfig): Promise> { - return await httpClient.post(`/${this.key}/`, data, config); - } - - async update( - id: string, - data: IDocument, - config?: AxiosRequestConfig - ): Promise> { - return await httpClient.put(`/${this.key}/${id}`, data, config); - } - - async delete(id: string, config?: AxiosRequestConfig): Promise> { - return await httpClient.delete(`/${this.key}/${id}`, config); - } -} - -export const documentOperator = new DocumentOperator(); diff --git a/src/operators/index.ts b/src/operators/index.ts index ffa0f864..cbcf3b45 100644 --- a/src/operators/index.ts +++ b/src/operators/index.ts @@ -1,8 +1,4 @@ export * from './instance'; export * from './application'; -export * from './service'; export * from './user'; export * from './api'; -export * from './document'; -export * from './order'; -export * from './proxy'; diff --git a/src/operators/order/index.ts b/src/operators/order/index.ts deleted file mode 100644 index 4a6cbae5..00000000 --- a/src/operators/order/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './models'; -export * from './operator'; diff --git a/src/operators/order/models.ts b/src/operators/order/models.ts deleted file mode 100644 index 6d6b8de4..00000000 --- a/src/operators/order/models.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IApplication } from '../application'; - -export enum OrderState { - PENDING = 'Pending', - PAID = 'Paid', - EXPIRED = 'Expired', - FAILED = 'Failed' -} - -export interface IOrder { - id?: string; - description?: string; - state?: OrderState; - price?: number; - amount?: number; - user_id?: number; - created_at?: string; - updated_at?: string; - application?: IApplication; - application_id?: string; - wechatpay_url?: string; - alipay_url?: string; - pay_way?: string; -} - -export interface IOrderListResponse { - count: number; - items: IOrder[]; -} - -export type IOrderDetailResponse = IOrder; diff --git a/src/operators/order/operator.ts b/src/operators/order/operator.ts deleted file mode 100644 index d9e9195a..00000000 --- a/src/operators/order/operator.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { AxiosResponse } from 'axios'; -import { httpClient } from '../instance'; -import { IOrder, IOrderDetailResponse, IOrderListResponse } from './models'; - -export interface IOrderQuery { - user_id?: string; - package_id?: string; - offset?: number; - limit?: number; - ordering: string; -} - -class OrderService { - key = 'orders'; - - async getAll(query: IOrderQuery): Promise> { - return await httpClient.get(`/${this.key}/`, { - params: query - }); - } - - async get(id: string): Promise> { - return await httpClient.get(`/${this.key}/${id}`); - } - - async create(data: IOrder): Promise> { - return await httpClient.post(`/${this.key}/`, data); - } - - async update(id: string, data: IOrder): Promise> { - return await httpClient.put(`/${this.key}/${id}`, data); - } - - async refresh(id: string): Promise> { - return await httpClient.post(`/${this.key}/${id}/refresh/`); - } - - async pay(id: string, data: IOrder): Promise> { - return await httpClient.post(`/${this.key}/${id}/pay/`, data); - } - - async delete(id: string): Promise> { - return await httpClient.delete(`/${this.key}/${id}`); - } -} - -export const orderOperator = new OrderService(); diff --git a/src/operators/proxy/index.ts b/src/operators/proxy/index.ts deleted file mode 100644 index 4a6cbae5..00000000 --- a/src/operators/proxy/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './models'; -export * from './operator'; diff --git a/src/operators/proxy/models.ts b/src/operators/proxy/models.ts deleted file mode 100644 index fc10eb3d..00000000 --- a/src/operators/proxy/models.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IPackage } from '../api'; -import { IDocument } from '../document'; -import { IService } from '../service'; - -export enum IProxyUnit { - MB = 'MB' -} - -export interface IProxy { - id: string; - path: string; - endpoint: string; - unit?: IProxyUnit; - price?: number; - title?: string; - introduction?: string; - applied_count?: number; - free_amount?: number; - applied?: boolean; - application_id?: string; - tags?: string[]; - document?: IDocument; - document_id?: string; - service?: IService; - packages?: IPackage[]; - service_id?: string; - created_at?: string; - updated_at?: string; -} - -export interface IProxyListResponse { - count: number; - items: IProxy[]; -} - -export type IProxyDetailResponse = IProxy; diff --git a/src/operators/proxy/operator.ts b/src/operators/proxy/operator.ts deleted file mode 100644 index 563bc863..00000000 --- a/src/operators/proxy/operator.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AxiosResponse } from 'axios'; -import { httpClient } from '../instance'; -import { IProxy, IProxyDetailResponse, IProxyListResponse } from '../proxy/models'; - -export interface IProxyQuery { - limit?: number; - offset?: number; - ordering?: string; -} - -class ProxyOperator { - key = 'proxies'; - - async getAll(query: IProxyQuery): Promise> { - return await httpClient.get(`/${this.key}/`, { - params: query - }); - } - - async get(id: string): Promise> { - return await httpClient.get(`/${this.key}/${id}`); - } - - async create(data: IProxy): Promise> { - return await httpClient.post(`/${this.key}/`, data); - } - - async update(id: string, data: IProxy): Promise> { - return await httpClient.put(`/${this.key}/${id}`, data); - } - - async delete(id: string): Promise> { - return await httpClient.delete(`/${this.key}/${id}`); - } - - async getAllForService(serviceId: string, query: IProxyQuery): Promise> { - return await httpClient.get(`/services/${serviceId}/${this.key}/`, { - params: query - }); - } -} - -export const proxyOperator = new ProxyOperator(); diff --git a/src/operators/service/index.ts b/src/operators/service/index.ts deleted file mode 100644 index 4a6cbae5..00000000 --- a/src/operators/service/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './models'; -export * from './operator'; diff --git a/src/operators/service/models.ts b/src/operators/service/models.ts deleted file mode 100644 index 07dac0ba..00000000 --- a/src/operators/service/models.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IApi } from '../api/models'; - -export interface IService { - id: string; - title: string; - unit?: string; - price?: number; - description?: string; - tags?: string[]; - thumbnail?: string; - introduction?: string; - api_ids?: string[]; - apis?: IApi[]; - created_at?: string; - updated_at?: string; -} - -export interface IServiceListResponse { - count: number; - items: IService[]; -} - -export type IServiceDetailResponse = IService; diff --git a/src/operators/service/operator.ts b/src/operators/service/operator.ts deleted file mode 100644 index 18bad059..00000000 --- a/src/operators/service/operator.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AxiosResponse } from 'axios'; -import { httpClient } from '../instance'; -import { IService, IServiceDetailResponse, IServiceListResponse } from './models'; - -export interface IServiceQuery { - limit: number; - offset: number; - ordering: string; - private: boolean; -} - -class ServiceOperator { - key = 'services'; - - async getAll(query: IServiceQuery): Promise> { - return await httpClient.get(`/${this.key}/`, { - params: query - }); - } - - async get(id: string): Promise> { - return await httpClient.get(`/${this.key}/${id}`); - } - - async create(data: IService): Promise> { - return await httpClient.post(`/${this.key}/`, data); - } - - async update(id: string, data: IService): Promise> { - return await httpClient.put(`/${this.key}/${id}`, data); - } - - async delete(id: string): Promise> { - return await httpClient.delete(`/${this.key}/${id}`); - } -} - -export const serviceOperator = new ServiceOperator(); diff --git a/src/pages/auth/Callback.vue b/src/pages/auth/Callback.vue index f2b0ec6c..cc26a653 100644 --- a/src/pages/auth/Callback.vue +++ b/src/pages/auth/Callback.vue @@ -1,7 +1,7 @@ - - diff --git a/src/pages/console/application/Buy.vue b/src/pages/console/application/Buy.vue deleted file mode 100644 index 647e51c9..00000000 --- a/src/pages/console/application/Buy.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/src/pages/console/application/List.vue b/src/pages/console/application/List.vue deleted file mode 100644 index d033b5fd..00000000 --- a/src/pages/console/application/List.vue +++ /dev/null @@ -1,327 +0,0 @@ - - - - - diff --git a/src/pages/console/order/Detail.vue b/src/pages/console/order/Detail.vue deleted file mode 100644 index 81f3120b..00000000 --- a/src/pages/console/order/Detail.vue +++ /dev/null @@ -1,307 +0,0 @@ - - - - - diff --git a/src/pages/console/order/List.vue b/src/pages/console/order/List.vue deleted file mode 100644 index 8f48eb0d..00000000 --- a/src/pages/console/order/List.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - - - diff --git a/src/pages/document/Detail.vue b/src/pages/document/Detail.vue deleted file mode 100644 index e42e5f5b..00000000 --- a/src/pages/document/Detail.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - diff --git a/src/pages/document/List.vue b/src/pages/document/List.vue deleted file mode 100644 index 214b4ef4..00000000 --- a/src/pages/document/List.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/src/pages/service/Detail.vue b/src/pages/service/Detail.vue deleted file mode 100644 index f9397d57..00000000 --- a/src/pages/service/Detail.vue +++ /dev/null @@ -1,583 +0,0 @@ - - - - - diff --git a/src/pages/service/List.vue b/src/pages/service/List.vue deleted file mode 100644 index 3b091ce7..00000000 --- a/src/pages/service/List.vue +++ /dev/null @@ -1,356 +0,0 @@ - - - - - diff --git a/src/plugins/font-awesome.ts b/src/plugins/font-awesome.ts index 1860311c..3a6aa7f9 100644 --- a/src/plugins/font-awesome.ts +++ b/src/plugins/font-awesome.ts @@ -2,7 +2,6 @@ import { library } from '@fortawesome/fontawesome-svg-core'; import { faCopy as faRegularCopy, faUser as faRegularUser, - faIdCard as faRegularIdCard, faPaperPlane as faRegularPaperPlane, faComment as faRegularComment, faSun as faRegularSun @@ -11,9 +10,6 @@ import { faRotateRight as faSolidRotateRight, faCheck as faSolidCheck, faPlus as faSolidPlus, - faCube as faSolidCube, - faCubes as faSolidCubes, - faStore as faSolidStore, faBolt as faSolidBolt, faQuestion as faSolidQuestion, faTrash as faSolidTrash, @@ -26,12 +22,8 @@ library.add(faRegularCopy); library.add(faSolidRotateRight); library.add(faSolidCheck); library.add(faRegularUser); -library.add(faRegularIdCard); library.add(faRegularSun); library.add(faSolidBolt); -library.add(faSolidCube); -library.add(faSolidCubes); -library.add(faSolidStore); library.add(faSolidPlus); library.add(faSolidQuestion); library.add(faSolidTriangleExclamation); diff --git a/src/router/console.ts b/src/router/console.ts deleted file mode 100644 index 85daaf21..00000000 --- a/src/router/console.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { - ROUTE_CONSOLE_ADMIN_APPLICATION, - ROUTE_CONSOLE_APPLICATION_BUY, - ROUTE_CONSOLE_APPLICATION_LIST, - ROUTE_CONSOLE_ORDER_DETAIL, - ROUTE_CONSOLE_ORDER_LIST, - ROUTE_CONSOLE_ROOT -} from './constants'; - -export default { - path: '/console', - meta: { - auth: true - }, - component: () => import('@/layouts/Console.vue'), - children: [ - { - path: '', - name: ROUTE_CONSOLE_ROOT, - redirect: { - name: ROUTE_CONSOLE_APPLICATION_LIST - } - }, - { - path: 'orders', - name: ROUTE_CONSOLE_ORDER_LIST, - component: () => import('@/pages/console/order/List.vue') - }, - { - path: 'orders/:id', - name: ROUTE_CONSOLE_ORDER_DETAIL, - component: () => import('@/pages/console/order/Detail.vue') - }, - { - path: 'applications', - name: ROUTE_CONSOLE_APPLICATION_LIST, - component: () => import('@/pages/console/application/List.vue') - }, - { - path: 'applications/:id/buy', - name: ROUTE_CONSOLE_APPLICATION_BUY, - component: () => import('@/pages/console/application/Buy.vue') - }, - { - path: 'admin/application', - name: ROUTE_CONSOLE_ADMIN_APPLICATION, - component: () => import('@/pages/console/admin/Application.vue') - } - ] -}; diff --git a/src/router/constants.ts b/src/router/constants.ts index 8c652889..659c99f6 100644 --- a/src/router/constants.ts +++ b/src/router/constants.ts @@ -3,17 +3,5 @@ export const ROUTE_INDEX = 'index'; export const ROUTE_AUTH_LOGIN = 'auth-login'; export const ROUTE_AUTH_CALLBACK = 'auth-callback'; -export const ROUTE_CONSOLE_ROOT = 'console-root'; -export const ROUTE_CONSOLE_ORDER_LIST = 'console-order-list'; -export const ROUTE_CONSOLE_ORDER_DETAIL = 'console-order-detail'; -export const ROUTE_CONSOLE_APPLICATION_LIST = 'console-application-list'; -export const ROUTE_CONSOLE_APPLICATION_BUY = 'console-application-buy'; -export const ROUTE_CONSOLE_ADMIN_APPLICATION = 'console-application-admin-application'; - -export const ROUTE_DOCUMENT_LIST = 'document-list'; -export const ROUTE_DOCUMENT_DETAIL = 'document-detail'; export const ROUTE_CONVERSATION_NEW = 'conversation-new'; export const ROUTE_CONVERSATION_DETAIL = 'conversation-detail'; - -export const ROUTE_SERVICE_LIST = 'service-list'; -export const ROUTE_SERVICE_DETAIL = 'service-detail'; diff --git a/src/router/document.ts b/src/router/document.ts deleted file mode 100644 index 15f397fe..00000000 --- a/src/router/document.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ROUTE_DOCUMENT_DETAIL, ROUTE_DOCUMENT_LIST } from './constants'; - -export default { - path: '/documents', - component: () => import('@/layouts/Document.vue'), - children: [ - { - path: '', - name: ROUTE_DOCUMENT_LIST, - component: () => import('@/pages/document/List.vue') - }, - { - path: ':id', - name: ROUTE_DOCUMENT_DETAIL, - component: () => import('@/pages/document/Detail.vue') - } - ] -}; diff --git a/src/router/index.ts b/src/router/index.ts index 2905c32b..dccaeaa1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,24 +1,18 @@ import { createRouter, createWebHistory } from 'vue-router'; -import service from './service'; import auth from './auth'; -import console from './console'; import conversation from './conversation'; -import document from './document'; import store from '@/store'; -import { ROUTE_AUTH_LOGIN, ROUTE_INDEX, ROUTE_SERVICE_LIST } from './constants'; +import { ROUTE_AUTH_LOGIN, ROUTE_CONVERSATION_NEW, ROUTE_INDEX } from './constants'; const routes = [ { path: '/', name: ROUTE_INDEX, redirect: { - name: ROUTE_SERVICE_LIST + name: ROUTE_CONVERSATION_NEW } }, - service, auth, - console, - document, conversation ]; diff --git a/src/router/service.ts b/src/router/service.ts deleted file mode 100644 index ad68575d..00000000 --- a/src/router/service.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ROUTE_SERVICE_DETAIL, ROUTE_SERVICE_LIST } from './constants'; - -export default { - path: '/services', - component: () => import('@/layouts/Service.vue'), - children: [ - { - path: '', - name: ROUTE_SERVICE_LIST, - component: () => import('@/pages/service/List.vue') - }, - { - path: ':id', - name: ROUTE_SERVICE_DETAIL, - component: () => import('@/pages/service/Detail.vue') - } - ] -}; diff --git a/src/utils/baseUrl.ts b/src/utils/baseUrl.ts index 9982854f..386fa394 100644 --- a/src/utils/baseUrl.ts +++ b/src/utils/baseUrl.ts @@ -8,7 +8,7 @@ import { getEnv } from './env'; export const getDataBaseUrl = () => { const env = getEnv(); if (env === ENV_LOCAL) { - return 'https://chat.local.zhishuyun.com'; + return 'https://data.local.zhishuyun.com'; } else if (env === ENV_TEST) { return 'https://data.test.zhishuyun.com'; } else { @@ -16,6 +16,21 @@ export const getDataBaseUrl = () => { } }; +/** + * Get base url of app + * @returns + */ +export const getChatBaseUrl = () => { + const env = getEnv(); + if (env === ENV_LOCAL) { + return 'https://chat.local.zhishuyun.com'; + } else if (env === ENV_TEST) { + return 'https://chat.test.zhishuyun.com'; + } else { + return 'https://chat.zhishuyun.com'; + } +}; + export const getAuthBaseUrl = () => { const env = getEnv(); if (env === ENV_LOCAL) {