├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .prettierignore ├── .prettierrc.js ├── LICENSE ├── README.md ├── config ├── config.ts ├── defaultSettings.ts ├── oneapi.json ├── proxy.ts └── routes.ts ├── jsconfig.json ├── mock ├── listTableList.ts ├── notices.ts ├── route.ts └── user.ts ├── package.json ├── public ├── CNAME ├── favicon.ico ├── icons │ ├── icon-128x128.png │ ├── icon-192x192.png │ └── icon-512x512.png ├── logo.jpg ├── logo.svg └── pro_icon.svg ├── src ├── access.ts ├── api │ ├── binapi-backend │ │ ├── analysisController.ts │ │ ├── index.ts │ │ ├── interfaceAuditController.ts │ │ ├── interfaceChargingController.ts │ │ ├── interfaceInfoController.ts │ │ ├── typings.d.ts │ │ ├── userController.ts │ │ └── userInterfaceController.ts │ ├── binapi-order │ │ ├── basicErrorController.ts │ │ ├── index.ts │ │ ├── orderController.ts │ │ └── typings.d.ts │ └── binapi-third │ │ ├── aliPayController.ts │ │ ├── index.ts │ │ └── typings.d.ts ├── app.tsx ├── components │ ├── Footer │ │ └── index.tsx │ ├── HeaderDropdown │ │ ├── index.less │ │ └── index.tsx │ ├── HeaderSearch │ │ ├── index.less │ │ └── index.tsx │ ├── RightContent │ │ ├── AvatarDropdown.tsx │ │ ├── index.less │ │ └── index.tsx │ └── index.md ├── global.less ├── global.tsx ├── manifest.json ├── pages │ ├── 404.tsx │ ├── Admin.tsx │ ├── Admin │ │ ├── InterfaceAnalysis │ │ │ └── index.tsx │ │ ├── InterfaceInfo │ │ │ ├── components │ │ │ │ ├── CreateModal.tsx │ │ │ │ ├── UpdateForm.tsx │ │ │ │ └── UpdateModal.tsx │ │ │ └── index.tsx │ │ └── UserManager │ │ │ ├── index.less │ │ │ └── index.tsx │ ├── Index │ │ └── index.tsx │ ├── InterfaceInfo │ │ └── index.tsx │ ├── InterfaceSearch │ │ └── index.tsx │ ├── Order │ │ └── index.tsx │ └── User │ │ ├── Info │ │ └── index.tsx │ │ ├── Login │ │ ├── index.less │ │ └── index.tsx │ │ ├── MyInterface │ │ └── index.tsx │ │ └── Register │ │ ├── index.less │ │ └── index.tsx ├── requestConfig.ts ├── service-worker.js ├── services │ ├── ant-design-pro │ │ ├── api.ts │ │ ├── index.ts │ │ ├── login.ts │ │ └── typings.d.ts │ └── swagger │ │ ├── index.ts │ │ ├── pet.ts │ │ ├── store.ts │ │ ├── typings.d.ts │ │ └── user.ts └── typings.d.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [Makefile] 16 | indent_style = tab 17 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /lambda/ 2 | /scripts 3 | /config 4 | .history 5 | public 6 | dist 7 | .umi 8 | mock -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [require.resolve('@umijs/fabric/dist/eslint')], 3 | globals: { 4 | ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, 5 | page: true, 6 | REACT_APP_ENV: true, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | **/node_modules 5 | # roadhog-api-doc ignore 6 | /src/utils/request-temp.js 7 | _roadhog-api-doc 8 | 9 | # production 10 | /dist 11 | 12 | # misc 13 | .DS_Store 14 | npm-debug.log* 15 | yarn-error.log 16 | 17 | /coverage 18 | .idea 19 | yarn.lock 20 | package-lock.json 21 | pnpm-lock.yaml 22 | *bak 23 | .vscode 24 | 25 | 26 | # visual studio code 27 | .history 28 | *.log 29 | functions/* 30 | .temp/** 31 | 32 | # umi 33 | .umi 34 | .umi-production 35 | .umi-test 36 | 37 | # screenshot 38 | screenshot 39 | .firebase 40 | .eslintcache 41 | 42 | build 43 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | # Export Git hook params 5 | export GIT_PARAMS=$* 6 | 7 | npx --no-install fabric verify-commit 8 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install lint-staged 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.svg 2 | .umi 3 | .umi-production 4 | /dist 5 | .dockerignore 6 | .DS_Store 7 | .eslintignore 8 | *.png 9 | *.toml 10 | docker 11 | .editorconfig 12 | Dockerfile* 13 | .gitignore 14 | .prettierignore 15 | LICENSE 16 | .eslintcache 17 | *.lock 18 | yarn-error.log 19 | .history 20 | CNAME 21 | /build 22 | /public 23 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | const fabric = require('@umijs/fabric'); 2 | 3 | module.exports = { 4 | ...fabric.prettier, 5 | }; 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ishuaige 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bin API 2 | 3 | > 一个丰富的API开放调用平台,为开发者提供便捷、实用的API调用体验 4 | > 5 | > Java + React 全栈项目,包括网站前台+管理员后台,感谢[鱼厂创始人](https://github.com/liyupi)提供的项目基础框架,我也是在此基础上作拓展 6 | > 项目后端开源代码:https://github.com/ishuaige/binapi 7 | > 项目前端开源代码:https://github.com/ishuaige/binapi-frontend 8 | 9 | 10 | ## 项目介绍 11 | 12 | Bin API 平台初衷是尽可能地帮助和服务更多的用户和开发者, 为开发者提供API接口,提高开发者开发效率的平台。我们可以为用户提供各种类型的接口服务,使他们能够更高效地完成需求,例如:获取今日天气、获取金句、随机头像等服务。 13 | 14 | 项目后端使用语言为Java,包括现在市面上主流技术栈,采用微服务架构开发,解耦业务模块,前端使用React,Ant Design Pro + Ant Design组件库,使用现成组件库快速开发项目。 15 | 16 | ## 项目背景 17 | 18 | 本人大学牲一枚,作为一个菜鸡程序员,身边的前端朋友也常来问我是否可以开发一些接口可以供他们调用,或是自己难免在开发中会遇到一些简单地想法,但是可能又要花费不少时间去实现,于是乎自然就会想到有没有一些现成的API可以调用。 19 | 20 | 在搜罗了大多API网站后,发现有的接口质量参差不齐,或是收费不合理,或是速度慢,或是不符合预期,在获取之前有可能还需要进行关注公众号等操作,甚是繁琐,虽然知道有些操作合理的,但却让我萌生了一个自己写一个接口平台的想法,于是该项目诞生了。 21 | 22 | Bin API 平台在开发者注册后,只需要找到需要的接口,获取接口后,使用我们提供的SDK配置密钥后就可以很方便地调用我们为您提供的服务! 23 | 24 | ## 技术栈 25 | 26 | ### 前端技术栈 27 | 28 | - 开发框架:React、Umi 29 | - 脚手架:Ant Design Pro 30 | - 组件库:Ant Design、Ant Design Components 31 | - 语法扩展:TypeScript、Less 32 | - 打包工具:Webpack 33 | - 代码规范:ESLint、StyleLint、Prettier 34 | 35 | ### 后端技术栈 36 | 37 | * 主语言:Java 38 | * 框架:SpringBoot 2.7.0、Mybatis-plus、Spring Cloud 39 | * 数据库:Mysql8.0、Redis 40 | * 中间件:RabbitMq 41 | * 注册中心:Nacos 42 | * 服务调用:Dubbo 43 | * 网关:Spring Cloud Gateway 44 | * 负载均衡:Spring cloud Loadbalancer 45 | 46 | ## 快速上手 47 | 48 | ### 前端 49 | 50 | 环境要求:Node.js >= 14 51 | 52 | 安装依赖: 53 | 54 | ``` 55 | yarn 56 | ``` 57 | 58 | 启动: 59 | 60 | ``` 61 | npm run start:dev 62 | ``` 63 | 64 | ## 功能模块 65 | 66 | > 🚀 未来计划(画饼) 67 | 68 | * 用户、管理员 69 | * 登录注册 70 | * 短信验证:[短信验证码—Java实现](https://blog.csdn.net/idogbin/article/details/130444691) 71 | * 个人主页 72 | * 设置个人信息(🚀,因为用户信息模块并不是本项目重点,优先级较后) 73 | * 管理员:用户管理 74 | * 管理员:接口管理 75 | * 管理员:接口分析、订单分析 76 | * 接口 77 | * 浏览接口信息 78 | * 在线调用接口 79 | * 接口搜索 80 | * 购买接口 81 | * 下载SDK调用接口 82 | * 用户上传自己的接口(🚀) 83 | * 订单 84 | * 创建订单 85 | * 支付宝沙箱支付 86 | 87 | ### 后端模块 88 | 89 | * binapi-backend:后端服务,提供用户、接口等基本操作 90 | * binapi-common:项目公共模块,包含一些公用的实体类,远程调用接口 91 | * binapi-gateway:api网关,整个后端的入口,作服务转发、用户鉴权、统一日志、服务接口调用计数 92 | * binapi-interface:平台提供的接口服务,目前只有简单的几个接口,大家可以自行拓展 93 | * binapi-order:订单服务,提供对订单的操作 94 | * binapi-third-party:第三方服务,包含阿里云oss、支付宝沙箱支付、腾讯短信服务 95 | * binapi-client-sdk:提供给开发者的SDK 96 | ![image-20230513211723627](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513211723627.png) 97 | ## 系统架构 98 | 99 | > 仅供参考 100 | 101 | ![image-20230513161820131](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513161820131.png) 102 | 103 | ## 项目展示 104 | 105 | * 登陆注册 106 | 107 | ![image-20230513163417755](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513163417755.png) 108 | 109 | ![image-20230513163549224](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513163549224.png) 110 | 111 | * 主页 112 | 113 | ![image-20230513225733026](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513225733026.png) 114 | 115 | * 接口详情以及在线调用 116 | 117 | ![image-20230513225745495](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513225745495.png) 118 | 119 | 120 | 121 | ![image-20230513225757002](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513225757002.png) 122 | 123 | * 购买接口(创建订单) 124 | 125 | ![image-20230513225812582](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513225812582.png) 126 | 127 | * 订单页 128 | 129 | ![image-20230513230326046](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513230326046.png) 130 | 131 | * 支付弹窗 132 | 133 | ![image-20230513230345813](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513230345813.png) 134 | 135 | * 我已经拥有的接口页 136 | 137 | ![image-20230513230400078](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513230400078.png) 138 | 139 | * 用户、接口管理页 140 | 141 | ![image-20230513230411559](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513230411559.png) 142 | 143 | ![image-20230513230426027](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513230426027.png) 144 | 145 | * 分析页 146 | 147 | ![image-20230513204432307](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513204432307.png) 148 | 149 | * 个人信息页 150 | 151 | ![image-20230513230441943](https://niumapicgo.oss-cn-beijing.aliyuncs.com/images/image-20230513230441943.png) 152 | 153 | ## 欢迎贡献 154 | 155 | 项目需要大家的支持,期待更多小伙伴的贡献,你可以: 156 | 157 | * 对于项目中的Bug和建议,能够在Issues区提出建议,我会积极响应 158 | -------------------------------------------------------------------------------- /config/config.ts: -------------------------------------------------------------------------------- 1 | // https://umijs.org/config/ 2 | import { defineConfig } from '@umijs/max'; 3 | import defaultSettings from './defaultSettings'; 4 | import proxy from './proxy'; 5 | import routes from './routes'; 6 | const { REACT_APP_ENV } = process.env; 7 | export default defineConfig({ 8 | /** 9 | * @name 开启 hash 模式 10 | * @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。 11 | * @doc https://umijs.org/docs/api/config#hash 12 | */ 13 | hash: true, 14 | /** 15 | * @name 兼容性设置 16 | * @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖 17 | * @doc https://umijs.org/docs/api/config#targets 18 | */ 19 | // targets: { 20 | // ie: 11, 21 | // }, 22 | /** 23 | * @name 路由的配置,不在路由中引入的文件不会编译 24 | * @description 只支持 path,component,routes,redirect,wrappers,title 的配置 25 | * @doc https://umijs.org/docs/guides/routes 26 | */ 27 | // umi routes: https://umijs.org/docs/routing 28 | routes, 29 | /** 30 | * @name 主题的配置 31 | * @description 虽然叫主题,但是其实只是 less 的变量设置 32 | * @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn 33 | * @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme 34 | */ 35 | theme: { 36 | // 如果不想要 configProvide 动态设置主题需要把这个设置为 default 37 | // 只有设置为 variable, 才能使用 configProvide 动态设置主色调 38 | 'root-entry-name': 'variable', 39 | }, 40 | /** 41 | * @name moment 的国际化配置 42 | * @description 如果对国际化没有要求,打开之后能减少js的包大小 43 | * @doc https://umijs.org/docs/api/config#ignoremomentlocale 44 | */ 45 | ignoreMomentLocale: true, 46 | /** 47 | * @name 代理配置 48 | * @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了 49 | * @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。 50 | * @doc 代理介绍 https://umijs.org/docs/guides/proxy 51 | * @doc 代理配置 https://umijs.org/docs/api/config#proxy 52 | */ 53 | proxy: proxy[REACT_APP_ENV || 'dev'], 54 | /** 55 | * @name 快速热更新配置 56 | * @description 一个不错的热更新组件,更新时可以保留 state 57 | */ 58 | fastRefresh: true, 59 | //============== 以下都是max的插件配置 =============== 60 | /** 61 | * @name 数据流插件 62 | * @@doc https://umijs.org/docs/max/data-flow 63 | */ 64 | model: {}, 65 | /** 66 | * 一个全局的初始数据流,可以用它在插件之间共享数据 67 | * @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。 68 | * @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81 69 | */ 70 | initialState: {}, 71 | /** 72 | * @name layout 插件 73 | * @doc https://umijs.org/docs/max/layout-menu 74 | */ 75 | layout: { 76 | locale: true, 77 | ...defaultSettings, 78 | }, 79 | /** 80 | * @name antd 插件 81 | * @description 内置了 babel import 插件 82 | * @doc https://umijs.org/docs/max/antd#antd 83 | */ 84 | antd: {}, 85 | /** 86 | * @name 网络请求配置 87 | * @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。 88 | * @doc https://umijs.org/docs/max/request 89 | */ 90 | request: {}, 91 | /** 92 | * @name 权限插件 93 | * @description 基于 initialState 的权限插件,必须先打开 initialState 94 | * @doc https://umijs.org/docs/max/access 95 | */ 96 | access: {}, 97 | //================ pro 插件配置 ================= 98 | presets: ['umi-presets-pro'], 99 | /** 100 | * @name openAPI 插件的配置 101 | * @description 基于 openapi 的规范生成serve 和mock,能减少很多样板代码 102 | * @doc https://pro.ant.design/zh-cn/docs/openapi/ 103 | */ 104 | openAPI: [ 105 | { 106 | requestLibPath: "import { request } from '@umijs/max'", 107 | // schemaPath: 'http://localhost:8004/api/third/v3/api-docs', 108 | // schemaPath: 'http://localhost:8003/api/order/v3/api-docs', 109 | schemaPath: 'http://localhost:8080/api/v3/api-docs', 110 | projectName: 'binapi-backend', 111 | }, 112 | ], 113 | mfsu: { 114 | exclude: ['@playwright/test'], 115 | }, 116 | }); 117 | -------------------------------------------------------------------------------- /config/defaultSettings.ts: -------------------------------------------------------------------------------- 1 | import { Settings as LayoutSettings } from '@ant-design/pro-components'; 2 | 3 | /** 4 | * @name 5 | */ 6 | const Settings: LayoutSettings & { 7 | pwa?: boolean; 8 | logo?: string; 9 | } = { 10 | navTheme: 'light', 11 | // 拂晓蓝 12 | colorPrimary: '#1890ff', 13 | layout: 'top', 14 | contentWidth: 'Fluid', 15 | fixedHeader: false, 16 | fixSiderbar: true, 17 | colorWeak: false, 18 | title: 'Bin API', 19 | pwa: false, 20 | logo: '/logo.svg', 21 | iconfontUrl: '', 22 | }; 23 | 24 | export default Settings; 25 | -------------------------------------------------------------------------------- /config/proxy.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @name 代理的配置 3 | * @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 4 | * ------------------------------- 5 | * The agent cannot take effect in the production environment 6 | * so there is no configuration of the production environment 7 | * For details, please see 8 | * https://pro.ant.design/docs/deploy 9 | * 10 | * @doc https://umijs.org/docs/guides/proxy 11 | */ 12 | export default { 13 | dev: {}, 14 | /** 15 | * @name 详细的代理配置 16 | * @doc https://github.com/chimurai/http-proxy-middleware 17 | */ 18 | test: { 19 | // localhost:8000/api/** -> https://preview.pro.ant.design/api/** 20 | '/api/': { 21 | target: 'https://proapi.azurewebsites.net', 22 | changeOrigin: true, 23 | pathRewrite: { '^': '' }, 24 | }, 25 | }, 26 | pre: { 27 | '/api/': { 28 | target: 'your pre url', 29 | changeOrigin: true, 30 | pathRewrite: { '^': '' }, 31 | }, 32 | }, 33 | }; 34 | -------------------------------------------------------------------------------- /config/routes.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | path: '/', 4 | name: '主页', 5 | icon: 'smile', 6 | component: './Index', 7 | }, 8 | { 9 | path: '/interface_info/:id', 10 | name: '查看接口', 11 | icon: 'smile', 12 | component: './InterfaceInfo', 13 | hideInMenu: true, 14 | }, 15 | { 16 | path: '/user', 17 | layout: false, 18 | name: '欢迎页', 19 | routes: [ 20 | { name: '登录', path: '/user/login', component: './User/Login' }, 21 | { name: '注册', path: '/user/register', component: './User/Register' }, 22 | ], 23 | }, 24 | { 25 | path: '/user', 26 | routes: [{ name: '个人信息', path: '/user/info', component: './User/Info' }], 27 | }, 28 | { 29 | path: '/search', 30 | name: '搜索接口', 31 | icon: 'SearchOutlined', 32 | component: './InterfaceSearch', 33 | }, 34 | { 35 | path: '/order', 36 | name: '订单', 37 | icon: 'containerOutlined', 38 | component: './Order', 39 | }, 40 | { 41 | path: '/myInterface', 42 | name: '我的接口', 43 | icon: 'appstoreOutlined', 44 | component: './User/MyInterface', 45 | }, 46 | // { path: '/welcome', name: '欢迎', icon: 'smile', component: './Index' }, 47 | { 48 | path: '/admin', 49 | name: '管理页', 50 | icon: 'crown', 51 | access: 'canAdmin', 52 | routes: [ 53 | { 54 | name: '用户管理', 55 | icon: 'table', 56 | path: '/admin/user', 57 | component: './Admin/UserManager', 58 | }, 59 | { 60 | name: '接口管理', 61 | icon: 'table', 62 | path: '/admin/interface_Info', 63 | component: './Admin/InterfaceInfo', 64 | }, 65 | { 66 | name: '接口分析', 67 | icon: 'table', 68 | path: '/admin/interface_analysis', 69 | component: './Admin/InterfaceAnalysis', 70 | }, 71 | ], 72 | }, 73 | // { path: '/', redirect: '/welcome' }, 74 | { path: '*', layout: false, component: './404' }, 75 | ]; 76 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "emitDecoratorMetadata": true, 5 | "experimentalDecorators": true, 6 | "baseUrl": ".", 7 | "paths": { 8 | "@/*": ["./src/*"] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /mock/listTableList.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | import moment from 'moment'; 3 | import { parse } from 'url'; 4 | 5 | // mock tableListDataSource 6 | const genList = (current: number, pageSize: number) => { 7 | const tableListDataSource: API.RuleListItem[] = []; 8 | 9 | for (let i = 0; i < pageSize; i += 1) { 10 | const index = (current - 1) * 10 + i; 11 | tableListDataSource.push({ 12 | key: index, 13 | disabled: i % 6 === 0, 14 | href: 'https://ant.design', 15 | avatar: [ 16 | 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', 17 | 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', 18 | ][i % 2], 19 | name: `TradeCode ${index}`, 20 | owner: '曲丽丽', 21 | desc: '这是一段描述', 22 | callNo: Math.floor(Math.random() * 1000), 23 | status: Math.floor(Math.random() * 10) % 4, 24 | updatedAt: moment().format('YYYY-MM-DD'), 25 | createdAt: moment().format('YYYY-MM-DD'), 26 | progress: Math.ceil(Math.random() * 100), 27 | }); 28 | } 29 | tableListDataSource.reverse(); 30 | return tableListDataSource; 31 | }; 32 | 33 | let tableListDataSource = genList(1, 100); 34 | 35 | function getRule(req: Request, res: Response, u: string) { 36 | let realUrl = u; 37 | if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') { 38 | realUrl = req.url; 39 | } 40 | const { current = 1, pageSize = 10 } = req.query; 41 | const params = parse(realUrl, true).query as unknown as API.PageParams & 42 | API.RuleListItem & { 43 | sorter: any; 44 | filter: any; 45 | }; 46 | 47 | let dataSource = [...tableListDataSource].slice( 48 | ((current as number) - 1) * (pageSize as number), 49 | (current as number) * (pageSize as number), 50 | ); 51 | if (params.sorter) { 52 | const sorter = JSON.parse(params.sorter); 53 | dataSource = dataSource.sort((prev, next) => { 54 | let sortNumber = 0; 55 | Object.keys(sorter).forEach((key) => { 56 | if (sorter[key] === 'descend') { 57 | if (prev[key] - next[key] > 0) { 58 | sortNumber += -1; 59 | } else { 60 | sortNumber += 1; 61 | } 62 | return; 63 | } 64 | if (prev[key] - next[key] > 0) { 65 | sortNumber += 1; 66 | } else { 67 | sortNumber += -1; 68 | } 69 | }); 70 | return sortNumber; 71 | }); 72 | } 73 | if (params.filter) { 74 | const filter = JSON.parse(params.filter as any) as { 75 | [key: string]: string[]; 76 | }; 77 | if (Object.keys(filter).length > 0) { 78 | dataSource = dataSource.filter((item) => { 79 | return Object.keys(filter).some((key) => { 80 | if (!filter[key]) { 81 | return true; 82 | } 83 | if (filter[key].includes(`${item[key]}`)) { 84 | return true; 85 | } 86 | return false; 87 | }); 88 | }); 89 | } 90 | } 91 | 92 | if (params.name) { 93 | dataSource = dataSource.filter((data) => data?.name?.includes(params.name || '')); 94 | } 95 | const result = { 96 | data: dataSource, 97 | total: tableListDataSource.length, 98 | success: true, 99 | pageSize, 100 | current: parseInt(`${params.current}`, 10) || 1, 101 | }; 102 | 103 | return res.json(result); 104 | } 105 | 106 | function postRule(req: Request, res: Response, u: string, b: Request) { 107 | let realUrl = u; 108 | if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') { 109 | realUrl = req.url; 110 | } 111 | 112 | const body = (b && b.body) || req.body; 113 | const { method, name, desc, key } = body; 114 | 115 | switch (method) { 116 | /* eslint no-case-declarations:0 */ 117 | case 'delete': 118 | tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1); 119 | break; 120 | case 'post': 121 | (() => { 122 | const i = Math.ceil(Math.random() * 10000); 123 | const newRule: API.RuleListItem = { 124 | key: tableListDataSource.length, 125 | href: 'https://ant.design', 126 | avatar: [ 127 | 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', 128 | 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', 129 | ][i % 2], 130 | name, 131 | owner: '曲丽丽', 132 | desc, 133 | callNo: Math.floor(Math.random() * 1000), 134 | status: Math.floor(Math.random() * 10) % 2, 135 | updatedAt: moment().format('YYYY-MM-DD'), 136 | createdAt: moment().format('YYYY-MM-DD'), 137 | progress: Math.ceil(Math.random() * 100), 138 | }; 139 | tableListDataSource.unshift(newRule); 140 | return res.json(newRule); 141 | })(); 142 | return; 143 | 144 | case 'update': 145 | (() => { 146 | let newRule = {}; 147 | tableListDataSource = tableListDataSource.map((item) => { 148 | if (item.key === key) { 149 | newRule = { ...item, desc, name }; 150 | return { ...item, desc, name }; 151 | } 152 | return item; 153 | }); 154 | return res.json(newRule); 155 | })(); 156 | return; 157 | default: 158 | break; 159 | } 160 | 161 | const result = { 162 | list: tableListDataSource, 163 | pagination: { 164 | total: tableListDataSource.length, 165 | }, 166 | }; 167 | 168 | res.json(result); 169 | } 170 | 171 | export default { 172 | 'GET /api/rule': getRule, 173 | 'POST /api/rule': postRule, 174 | }; 175 | -------------------------------------------------------------------------------- /mock/notices.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | 3 | const getNotices = (req: Request, res: Response) => { 4 | res.json({ 5 | data: [ 6 | { 7 | id: '000000001', 8 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/MSbDR4FR2MUAAAAAAAAAAAAAFl94AQBr', 9 | title: '你收到了 14 份新周报', 10 | datetime: '2017-08-09', 11 | type: 'notification', 12 | }, 13 | { 14 | id: '000000002', 15 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/hX-PTavYIq4AAAAAAAAAAAAAFl94AQBr', 16 | title: '你推荐的 曲妮妮 已通过第三轮面试', 17 | datetime: '2017-08-08', 18 | type: 'notification', 19 | }, 20 | { 21 | id: '000000003', 22 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/jHX5R5l3QjQAAAAAAAAAAAAAFl94AQBr', 23 | title: '这种模板可以区分多种通知类型', 24 | datetime: '2017-08-07', 25 | read: true, 26 | type: 'notification', 27 | }, 28 | { 29 | id: '000000004', 30 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Wr4mQqx6jfwAAAAAAAAAAAAAFl94AQBr', 31 | title: '左侧图标用于区分不同的类型', 32 | datetime: '2017-08-07', 33 | type: 'notification', 34 | }, 35 | { 36 | id: '000000005', 37 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Mzj_TbcWUj4AAAAAAAAAAAAAFl94AQBr', 38 | title: '内容不要超过两行字,超出时自动截断', 39 | datetime: '2017-08-07', 40 | type: 'notification', 41 | }, 42 | { 43 | id: '000000006', 44 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/eXLzRbPqQE4AAAAAAAAAAAAAFl94AQBr', 45 | title: '曲丽丽 评论了你', 46 | description: '描述信息描述信息描述信息', 47 | datetime: '2017-08-07', 48 | type: 'message', 49 | clickClose: true, 50 | }, 51 | { 52 | id: '000000007', 53 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/w5mRQY2AmEEAAAAAAAAAAAAAFl94AQBr', 54 | title: '朱偏右 回复了你', 55 | description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', 56 | datetime: '2017-08-07', 57 | type: 'message', 58 | clickClose: true, 59 | }, 60 | { 61 | id: '000000008', 62 | avatar: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/wPadR5M9918AAAAAAAAAAAAAFl94AQBr', 63 | title: '标题', 64 | description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', 65 | datetime: '2017-08-07', 66 | type: 'message', 67 | clickClose: true, 68 | }, 69 | { 70 | id: '000000009', 71 | title: '任务名称', 72 | description: '任务需要在 2017-01-12 20:00 前启动', 73 | extra: '未开始', 74 | status: 'todo', 75 | type: 'event', 76 | }, 77 | { 78 | id: '000000010', 79 | title: '第三方紧急代码变更', 80 | description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', 81 | extra: '马上到期', 82 | status: 'urgent', 83 | type: 'event', 84 | }, 85 | { 86 | id: '000000011', 87 | title: '信息安全考试', 88 | description: '指派竹尔于 2017-01-09 前完成更新并发布', 89 | extra: '已耗时 8 天', 90 | status: 'doing', 91 | type: 'event', 92 | }, 93 | { 94 | id: '000000012', 95 | title: 'ABCD 版本发布', 96 | description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', 97 | extra: '进行中', 98 | status: 'processing', 99 | type: 'event', 100 | }, 101 | ], 102 | }); 103 | }; 104 | 105 | export default { 106 | 'GET /api/notices': getNotices, 107 | }; 108 | -------------------------------------------------------------------------------- /mock/route.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | '/api/auth_routes': { 3 | '/form/advanced-form': { authority: ['admin', 'user'] }, 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /mock/user.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | 3 | const waitTime = (time: number = 100) => { 4 | return new Promise((resolve) => { 5 | setTimeout(() => { 6 | resolve(true); 7 | }, time); 8 | }); 9 | }; 10 | 11 | async function getFakeCaptcha(req: Request, res: Response) { 12 | await waitTime(2000); 13 | return res.json('captcha-xxx'); 14 | } 15 | 16 | const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; 17 | 18 | /** 19 | * 当前用户的权限,如果为空代表没登录 20 | * current user access, if is '', user need login 21 | * 如果是 pro 的预览,默认是有权限的 22 | */ 23 | let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : ''; 24 | 25 | const getAccess = () => { 26 | return access; 27 | }; 28 | 29 | // 代码中会兼容本地 service mock 以及部署站点的静态数据 30 | export default { 31 | // 支持值为 Object 和 Array 32 | 'GET /api/currentUser': (req: Request, res: Response) => { 33 | if (!getAccess()) { 34 | res.status(401).send({ 35 | data: { 36 | isLogin: false, 37 | }, 38 | errorCode: '401', 39 | errorMessage: '请先登录!', 40 | success: true, 41 | }); 42 | return; 43 | } 44 | res.send({ 45 | success: true, 46 | data: { 47 | name: 'Serati Ma', 48 | avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', 49 | userid: '00000001', 50 | email: 'antdesign@alipay.com', 51 | signature: '海纳百川,有容乃大', 52 | title: '交互专家', 53 | group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', 54 | tags: [ 55 | { 56 | key: '0', 57 | label: '很有想法的', 58 | }, 59 | { 60 | key: '1', 61 | label: '专注设计', 62 | }, 63 | { 64 | key: '2', 65 | label: '辣~', 66 | }, 67 | { 68 | key: '3', 69 | label: '大长腿', 70 | }, 71 | { 72 | key: '4', 73 | label: '川妹子', 74 | }, 75 | { 76 | key: '5', 77 | label: '海纳百川', 78 | }, 79 | ], 80 | notifyCount: 12, 81 | unreadCount: 11, 82 | country: 'China', 83 | access: getAccess(), 84 | geographic: { 85 | province: { 86 | label: '浙江省', 87 | key: '330000', 88 | }, 89 | city: { 90 | label: '杭州市', 91 | key: '330100', 92 | }, 93 | }, 94 | address: '西湖区工专路 77 号', 95 | phone: '0752-268888888', 96 | }, 97 | }); 98 | }, 99 | // GET POST 可省略 100 | 'GET /api/users': [ 101 | { 102 | key: '1', 103 | name: 'John Brown', 104 | age: 32, 105 | address: 'New York No. 1 Lake Park', 106 | }, 107 | { 108 | key: '2', 109 | name: 'Jim Green', 110 | age: 42, 111 | address: 'London No. 1 Lake Park', 112 | }, 113 | { 114 | key: '3', 115 | name: 'Joe Black', 116 | age: 32, 117 | address: 'Sidney No. 1 Lake Park', 118 | }, 119 | ], 120 | 'POST /api/login/account': async (req: Request, res: Response) => { 121 | const { password, username, type } = req.body; 122 | await waitTime(2000); 123 | if (password === 'ant.design' && username === 'admin') { 124 | res.send({ 125 | status: 'ok', 126 | type, 127 | currentAuthority: 'admin', 128 | }); 129 | access = 'admin'; 130 | return; 131 | } 132 | if (password === 'ant.design' && username === 'user') { 133 | res.send({ 134 | status: 'ok', 135 | type, 136 | currentAuthority: 'user', 137 | }); 138 | access = 'user'; 139 | return; 140 | } 141 | if (type === 'mobile') { 142 | res.send({ 143 | status: 'ok', 144 | type, 145 | currentAuthority: 'admin', 146 | }); 147 | access = 'admin'; 148 | return; 149 | } 150 | 151 | res.send({ 152 | status: 'error', 153 | type, 154 | currentAuthority: 'guest', 155 | }); 156 | access = 'guest'; 157 | }, 158 | 'POST /api/login/outLogin': (req: Request, res: Response) => { 159 | access = ''; 160 | res.send({ data: {}, success: true }); 161 | }, 162 | 'POST /api/register': (req: Request, res: Response) => { 163 | res.send({ status: 'ok', currentAuthority: 'user', success: true }); 164 | }, 165 | 'GET /api/500': (req: Request, res: Response) => { 166 | res.status(500).send({ 167 | timestamp: 1513932555104, 168 | status: 500, 169 | error: 'error', 170 | message: 'error', 171 | path: '/base/category/list', 172 | }); 173 | }, 174 | 'GET /api/404': (req: Request, res: Response) => { 175 | res.status(404).send({ 176 | timestamp: 1513932643431, 177 | status: 404, 178 | error: 'Not Found', 179 | message: 'No message available', 180 | path: '/base/category/list/2121212', 181 | }); 182 | }, 183 | 'GET /api/403': (req: Request, res: Response) => { 184 | res.status(403).send({ 185 | timestamp: 1513932555104, 186 | status: 403, 187 | error: 'Forbidden', 188 | message: 'Forbidden', 189 | path: '/base/category/list', 190 | }); 191 | }, 192 | 'GET /api/401': (req: Request, res: Response) => { 193 | res.status(401).send({ 194 | timestamp: 1513932555104, 195 | status: 401, 196 | error: 'Unauthorized', 197 | message: 'Unauthorized', 198 | path: '/base/category/list', 199 | }); 200 | }, 201 | 202 | 'GET /api/login/captcha': getFakeCaptcha, 203 | }; 204 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ant-design-pro", 3 | "version": "6.0.0-beta.1", 4 | "private": true, 5 | "description": "An out-of-box UI solution for enterprise applications", 6 | "scripts": { 7 | "analyze": "cross-env ANALYZE=1 max build", 8 | "build": "max build", 9 | "deploy": "npm run build && npm run gh-pages", 10 | "dev": "npm run start:dev", 11 | "gh-pages": "gh-pages -d dist", 12 | "i18n-remove": "pro i18n-remove --locale=zh-CN --write", 13 | "postinstall": "max setup", 14 | "lint": "npm run lint:js && npm run lint:prettier && npm run tsc", 15 | "lint-staged": "lint-staged", 16 | "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", 17 | "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ", 18 | "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", 19 | "lint:prettier": "prettier -c --write \"src/**/*\" --end-of-line auto", 20 | "openapi": "max openapi", 21 | "prepare": "husky install", 22 | "prettier": "prettier -c --write \"src/**/*\"", 23 | "serve": "umi-serve", 24 | "start": "cross-env UMI_ENV=dev max dev", 25 | "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev", 26 | "start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev", 27 | "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev", 28 | "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev", 29 | "test:e2e": "node ./tests/run-tests.js", 30 | "tsc": "tsc --noEmit" 31 | }, 32 | "lint-staged": { 33 | "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", 34 | "**/*.{js,jsx,tsx,ts,less,md,json}": [ 35 | "prettier --write" 36 | ] 37 | }, 38 | "browserslist": [ 39 | "> 1%", 40 | "last 2 versions", 41 | "not ie <= 10" 42 | ], 43 | "dependencies": { 44 | "@ant-design/icons": "^4.7.0", 45 | "@ant-design/pro-components": "^2.3.13", 46 | "@antfu/utils": "^0.7.2", 47 | "@umijs/route-utils": "^2.1.3", 48 | "antd": "^4.23.3", 49 | "classnames": "^2.3.2", 50 | "echarts-for-react": "^3.0.2", 51 | "lodash": "^4.17.21", 52 | "moment": "^2.29.4", 53 | "omit.js": "^2.0.2", 54 | "rc-menu": "^9.6.4", 55 | "rc-util": "^5.24.4", 56 | "react": "^17.0.0", 57 | "react-dev-inspector": "^1.8.1", 58 | "react-dom": "^17.0.0", 59 | "react-helmet-async": "^1.3.0" 60 | }, 61 | "devDependencies": { 62 | "@ant-design/pro-cli": "^2.1.0", 63 | "@types/classnames": "^2.3.1", 64 | "@types/express": "^4.17.14", 65 | "@types/history": "^4.7.11", 66 | "@types/lodash": "^4.14.186", 67 | "@types/react": "^17.0.0", 68 | "@types/react-dom": "^17.0.0", 69 | "@types/react-helmet": "^6.1.5", 70 | "@umijs/fabric": "^2.11.1", 71 | "@umijs/max": "^4.0.24", 72 | "@umijs/openapi": "^1.7.0", 73 | "cross-env": "^7.0.3", 74 | "cross-port-killer": "^1.4.0", 75 | "detect-installer": "^1.0.2", 76 | "eslint": "^7.32.0", 77 | "husky": "^7.0.4", 78 | "lint-staged": "^10.0.0", 79 | "mockjs": "^1.1.0", 80 | "prettier": "^2.7.1", 81 | "swagger-ui-dist": "^4.14.2", 82 | "typescript": "^4.8.4", 83 | "umi-presets-pro": "^1.0.5", 84 | "umi-serve": "^1.9.11" 85 | }, 86 | "engines": { 87 | "node": ">=12.0.0" 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /public/CNAME: -------------------------------------------------------------------------------- 1 | preview.pro.ant.design -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishuaige/binapi-frontend/df24c89b1cf1b2a1107e20b614bb3e8323f61263/public/favicon.ico -------------------------------------------------------------------------------- /public/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishuaige/binapi-frontend/df24c89b1cf1b2a1107e20b614bb3e8323f61263/public/icons/icon-128x128.png -------------------------------------------------------------------------------- /public/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishuaige/binapi-frontend/df24c89b1cf1b2a1107e20b614bb3e8323f61263/public/icons/icon-192x192.png -------------------------------------------------------------------------------- /public/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishuaige/binapi-frontend/df24c89b1cf1b2a1107e20b614bb3e8323f61263/public/icons/icon-512x512.png -------------------------------------------------------------------------------- /public/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ishuaige/binapi-frontend/df24c89b1cf1b2a1107e20b614bb3e8323f61263/public/logo.jpg -------------------------------------------------------------------------------- /public/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/pro_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/access.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://umijs.org/zh-CN/plugins/plugin-access 3 | * */ 4 | export default function access(initialState: InitialState | undefined) { 5 | const { loginUser } = initialState ?? {}; 6 | return { 7 | canUser: loginUser, 8 | canAdmin: loginUser && loginUser.userRole === 'admin', 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /src/api/binapi-backend/analysisController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** listTopBuyInterfaceInfo GET /api/analysis/top/interface/buy */ 6 | export async function listTopBuyInterfaceInfoUsingGET(options?: { [key: string]: any }) { 7 | return request('/api/analysis/top/interface/buy', { 8 | method: 'GET', 9 | ...(options || {}), 10 | }); 11 | } 12 | 13 | /** topBuyInterfaceInfoExcel GET /api/analysis/top/interface/buy/excel */ 14 | export async function topBuyInterfaceInfoExcelUsingGET(options?: { [key: string]: any }) { 15 | return request('/api/analysis/top/interface/buy/excel', { 16 | method: 'GET', 17 | ...(options || {}), 18 | }); 19 | } 20 | 21 | /** listTopInvokeInterfaceInfo GET /api/analysis/top/interface/invoke */ 22 | export async function listTopInvokeInterfaceInfoUsingGET(options?: { [key: string]: any }) { 23 | return request('/api/analysis/top/interface/invoke', { 24 | method: 'GET', 25 | ...(options || {}), 26 | }); 27 | } 28 | 29 | /** topInvokeInterfaceInfoExcel GET /api/analysis/top/interface/invoke/excel */ 30 | export async function topInvokeInterfaceInfoExcelUsingGET(options?: { [key: string]: any }) { 31 | return request('/api/analysis/top/interface/invoke/excel', { 32 | method: 'GET', 33 | ...(options || {}), 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /src/api/binapi-backend/index.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | // API 更新时间: 4 | // API 唯一标识: 5 | import * as analysisController from './analysisController'; 6 | import * as interfaceAuditController from './interfaceAuditController'; 7 | import * as interfaceChargingController from './interfaceChargingController'; 8 | import * as interfaceInfoController from './interfaceInfoController'; 9 | import * as userController from './userController'; 10 | import * as userInterfaceController from './userInterfaceController'; 11 | export default { 12 | analysisController, 13 | interfaceAuditController, 14 | interfaceChargingController, 15 | interfaceInfoController, 16 | userController, 17 | userInterfaceController, 18 | }; 19 | -------------------------------------------------------------------------------- /src/api/binapi-backend/interfaceAuditController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** auditInterface POST /api/interfaceAudit/auditInterface */ 6 | export async function auditInterfaceUsingPOST( 7 | body: API.InterfaceAuditRequest, 8 | options?: { [key: string]: any }, 9 | ) { 10 | return request('/api/interfaceAudit/auditInterface', { 11 | method: 'POST', 12 | headers: { 13 | 'Content-Type': 'application/json', 14 | }, 15 | data: body, 16 | ...(options || {}), 17 | }); 18 | } 19 | 20 | /** getInterfaceAuditList POST /api/interfaceAudit/getInterfaceAuditList */ 21 | export async function getInterfaceAuditListUsingPOST( 22 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 23 | params: API.getInterfaceAuditListUsingPOSTParams, 24 | options?: { [key: string]: any }, 25 | ) { 26 | return request( 27 | '/api/interfaceAudit/getInterfaceAuditList', 28 | { 29 | method: 'POST', 30 | params: { 31 | ...params, 32 | }, 33 | ...(options || {}), 34 | }, 35 | ); 36 | } 37 | 38 | /** userAdd POST /api/interfaceAudit/userAdd */ 39 | export async function userAddUsingPOST( 40 | body: API.InterfaceInfoAddRequest, 41 | options?: { [key: string]: any }, 42 | ) { 43 | return request('/api/interfaceAudit/userAdd', { 44 | method: 'POST', 45 | headers: { 46 | 'Content-Type': 'application/json', 47 | }, 48 | data: body, 49 | ...(options || {}), 50 | }); 51 | } 52 | -------------------------------------------------------------------------------- /src/api/binapi-backend/interfaceChargingController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** addInterfaceCharging POST /api/interfaceCharging/add */ 6 | export async function addInterfaceChargingUsingPOST( 7 | body: API.InterfaceChargingAddRequest, 8 | options?: { [key: string]: any }, 9 | ) { 10 | return request('/api/interfaceCharging/add', { 11 | method: 'POST', 12 | headers: { 13 | 'Content-Type': 'application/json', 14 | }, 15 | data: body, 16 | ...(options || {}), 17 | }); 18 | } 19 | 20 | /** deleteInterfaceCharging POST /api/interfaceCharging/delete */ 21 | export async function deleteInterfaceChargingUsingPOST( 22 | body: API.DeleteRequest, 23 | options?: { [key: string]: any }, 24 | ) { 25 | return request('/api/interfaceCharging/delete', { 26 | method: 'POST', 27 | headers: { 28 | 'Content-Type': 'application/json', 29 | }, 30 | data: body, 31 | ...(options || {}), 32 | }); 33 | } 34 | 35 | /** getInterfaceChargingById GET /api/interfaceCharging/get */ 36 | export async function getInterfaceChargingByIdUsingGET( 37 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 38 | params: API.getInterfaceChargingByIdUsingGETParams, 39 | options?: { [key: string]: any }, 40 | ) { 41 | return request('/api/interfaceCharging/get', { 42 | method: 'GET', 43 | params: { 44 | ...params, 45 | }, 46 | ...(options || {}), 47 | }); 48 | } 49 | 50 | /** listInterfaceCharging GET /api/interfaceCharging/list */ 51 | export async function listInterfaceChargingUsingGET( 52 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 53 | params: API.listInterfaceChargingUsingGETParams, 54 | options?: { [key: string]: any }, 55 | ) { 56 | return request('/api/interfaceCharging/list', { 57 | method: 'GET', 58 | params: { 59 | ...params, 60 | }, 61 | ...(options || {}), 62 | }); 63 | } 64 | 65 | /** listInterfaceChargingByPage GET /api/interfaceCharging/list/page */ 66 | export async function listInterfaceChargingByPageUsingGET( 67 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 68 | params: API.listInterfaceChargingByPageUsingGETParams, 69 | options?: { [key: string]: any }, 70 | ) { 71 | return request('/api/interfaceCharging/list/page', { 72 | method: 'GET', 73 | params: { 74 | ...params, 75 | }, 76 | ...(options || {}), 77 | }); 78 | } 79 | 80 | /** updateInterfaceCharging POST /api/interfaceCharging/update */ 81 | export async function updateInterfaceChargingUsingPOST( 82 | body: API.InterfaceChargingUpdateRequest, 83 | options?: { [key: string]: any }, 84 | ) { 85 | return request('/api/interfaceCharging/update', { 86 | method: 'POST', 87 | headers: { 88 | 'Content-Type': 'application/json', 89 | }, 90 | data: body, 91 | ...(options || {}), 92 | }); 93 | } 94 | -------------------------------------------------------------------------------- /src/api/binapi-backend/interfaceInfoController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** addInterfaceInfo POST /api/interfaceInfo/add */ 6 | export async function addInterfaceInfoUsingPOST( 7 | body: API.InterfaceInfoAddRequest, 8 | options?: { [key: string]: any }, 9 | ) { 10 | return request('/api/interfaceInfo/add', { 11 | method: 'POST', 12 | headers: { 13 | 'Content-Type': 'application/json', 14 | }, 15 | data: body, 16 | ...(options || {}), 17 | }); 18 | } 19 | 20 | /** deleteInterfaceInfo POST /api/interfaceInfo/delete */ 21 | export async function deleteInterfaceInfoUsingPOST( 22 | body: API.DeleteRequest, 23 | options?: { [key: string]: any }, 24 | ) { 25 | return request('/api/interfaceInfo/delete', { 26 | method: 'POST', 27 | headers: { 28 | 'Content-Type': 'application/json', 29 | }, 30 | data: body, 31 | ...(options || {}), 32 | }); 33 | } 34 | 35 | /** getInterfaceInfoById GET /api/interfaceInfo/get */ 36 | export async function getInterfaceInfoByIdUsingGET( 37 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 38 | params: API.getInterfaceInfoByIdUsingGETParams, 39 | options?: { [key: string]: any }, 40 | ) { 41 | return request('/api/interfaceInfo/get', { 42 | method: 'GET', 43 | params: { 44 | ...params, 45 | }, 46 | ...(options || {}), 47 | }); 48 | } 49 | 50 | /** invokeInterfaceInfo POST /api/interfaceInfo/invoke */ 51 | export async function invokeInterfaceInfoUsingPOST( 52 | body: API.InterfaceInfoInvokeRequest, 53 | options?: { [key: string]: any }, 54 | ) { 55 | return request('/api/interfaceInfo/invoke', { 56 | method: 'POST', 57 | headers: { 58 | 'Content-Type': 'application/json', 59 | }, 60 | data: body, 61 | ...(options || {}), 62 | }); 63 | } 64 | 65 | /** listInterfaceInfo GET /api/interfaceInfo/list */ 66 | export async function listInterfaceInfoUsingGET( 67 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 68 | params: API.listInterfaceInfoUsingGETParams, 69 | options?: { [key: string]: any }, 70 | ) { 71 | return request('/api/interfaceInfo/list', { 72 | method: 'GET', 73 | params: { 74 | ...params, 75 | }, 76 | ...(options || {}), 77 | }); 78 | } 79 | 80 | /** listInterfaceInfoByPage GET /api/interfaceInfo/list/page */ 81 | export async function listInterfaceInfoByPageUsingGET( 82 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 83 | params: API.listInterfaceInfoByPageUsingGETParams, 84 | options?: { [key: string]: any }, 85 | ) { 86 | return request('/api/interfaceInfo/list/page', { 87 | method: 'GET', 88 | params: { 89 | ...params, 90 | }, 91 | ...(options || {}), 92 | }); 93 | } 94 | 95 | /** offlineInterfaceInfo POST /api/interfaceInfo/offline */ 96 | export async function offlineInterfaceInfoUsingPOST( 97 | body: API.IdRequest, 98 | options?: { [key: string]: any }, 99 | ) { 100 | return request('/api/interfaceInfo/offline', { 101 | method: 'POST', 102 | headers: { 103 | 'Content-Type': 'application/json', 104 | }, 105 | data: body, 106 | ...(options || {}), 107 | }); 108 | } 109 | 110 | /** onlineInterfaceInfo POST /api/interfaceInfo/online */ 111 | export async function onlineInterfaceInfoUsingPOST( 112 | body: API.IdRequest, 113 | options?: { [key: string]: any }, 114 | ) { 115 | return request('/api/interfaceInfo/online', { 116 | method: 'POST', 117 | headers: { 118 | 'Content-Type': 'application/json', 119 | }, 120 | data: body, 121 | ...(options || {}), 122 | }); 123 | } 124 | 125 | /** getSdk GET /api/interfaceInfo/sdk */ 126 | export async function getSdkUsingGET(options?: { [key: string]: any }) { 127 | return request('/api/interfaceInfo/sdk', { 128 | method: 'GET', 129 | ...(options || {}), 130 | }); 131 | } 132 | 133 | /** search POST /api/interfaceInfo/search */ 134 | export async function searchUsingPOST( 135 | body: API.InterfaceInfoSearchRequest, 136 | options?: { [key: string]: any }, 137 | ) { 138 | return request('/api/interfaceInfo/search', { 139 | method: 'POST', 140 | headers: { 141 | 'Content-Type': 'application/json', 142 | }, 143 | data: body, 144 | ...(options || {}), 145 | }); 146 | } 147 | 148 | /** updateInterfaceInfo POST /api/interfaceInfo/update */ 149 | export async function updateInterfaceInfoUsingPOST( 150 | body: API.InterfaceInfoUpdateRequest, 151 | options?: { [key: string]: any }, 152 | ) { 153 | return request('/api/interfaceInfo/update', { 154 | method: 'POST', 155 | headers: { 156 | 'Content-Type': 'application/json', 157 | }, 158 | data: body, 159 | ...(options || {}), 160 | }); 161 | } 162 | -------------------------------------------------------------------------------- /src/api/binapi-backend/userController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** addUser POST /api/user/add */ 6 | export async function addUserUsingPOST(body: API.UserAddRequest, options?: { [key: string]: any }) { 7 | return request('/api/user/add', { 8 | method: 'POST', 9 | headers: { 10 | 'Content-Type': 'application/json', 11 | }, 12 | data: body, 13 | ...(options || {}), 14 | }); 15 | } 16 | 17 | /** deleteUser POST /api/user/delete */ 18 | export async function deleteUserUsingPOST( 19 | body: API.DeleteRequest, 20 | options?: { [key: string]: any }, 21 | ) { 22 | return request('/api/user/delete', { 23 | method: 'POST', 24 | headers: { 25 | 'Content-Type': 'application/json', 26 | }, 27 | data: body, 28 | ...(options || {}), 29 | }); 30 | } 31 | 32 | /** genKey POST /api/user/gen/key */ 33 | export async function genKeyUsingPOST(options?: { [key: string]: any }) { 34 | return request('/api/user/gen/key', { 35 | method: 'POST', 36 | ...(options || {}), 37 | }); 38 | } 39 | 40 | /** getUserById GET /api/user/get */ 41 | export async function getUserByIdUsingGET( 42 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 43 | params: API.getUserByIdUsingGETParams, 44 | options?: { [key: string]: any }, 45 | ) { 46 | return request('/api/user/get', { 47 | method: 'GET', 48 | params: { 49 | ...params, 50 | }, 51 | ...(options || {}), 52 | }); 53 | } 54 | 55 | /** getLoginUser GET /api/user/get/login */ 56 | export async function getLoginUserUsingGET(options?: { [key: string]: any }) { 57 | return request('/api/user/get/login', { 58 | method: 'GET', 59 | ...(options || {}), 60 | }); 61 | } 62 | 63 | /** getCaptcha GET /api/user/getCaptcha */ 64 | export async function getCaptchaUsingGET(options?: { [key: string]: any }) { 65 | return request('/api/user/getCaptcha', { 66 | method: 'GET', 67 | ...(options || {}), 68 | }); 69 | } 70 | 71 | /** getKey GET /api/user/key */ 72 | export async function getKeyUsingGET(options?: { [key: string]: any }) { 73 | return request('/api/user/key', { 74 | method: 'GET', 75 | ...(options || {}), 76 | }); 77 | } 78 | 79 | /** listUser GET /api/user/list */ 80 | export async function listUserUsingGET( 81 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 82 | params: API.listUserUsingGETParams, 83 | options?: { [key: string]: any }, 84 | ) { 85 | return request('/api/user/list', { 86 | method: 'GET', 87 | params: { 88 | ...params, 89 | }, 90 | ...(options || {}), 91 | }); 92 | } 93 | 94 | /** listUserByPage GET /api/user/list/page */ 95 | export async function listUserByPageUsingGET( 96 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 97 | params: API.listUserByPageUsingGETParams, 98 | options?: { [key: string]: any }, 99 | ) { 100 | return request('/api/user/list/page', { 101 | method: 'GET', 102 | params: { 103 | ...params, 104 | }, 105 | ...(options || {}), 106 | }); 107 | } 108 | 109 | /** userLogin POST /api/user/login */ 110 | export async function userLoginUsingPOST( 111 | body: API.UserLoginRequest, 112 | options?: { [key: string]: any }, 113 | ) { 114 | return request('/api/user/login', { 115 | method: 'POST', 116 | headers: { 117 | 'Content-Type': 'application/json', 118 | }, 119 | data: body, 120 | ...(options || {}), 121 | }); 122 | } 123 | 124 | /** userLoginBySms POST /api/user/loginBySms */ 125 | export async function userLoginBySmsUsingPOST( 126 | body: API.UserLoginRequest, 127 | options?: { [key: string]: any }, 128 | ) { 129 | return request('/api/user/loginBySms', { 130 | method: 'POST', 131 | headers: { 132 | 'Content-Type': 'application/json', 133 | }, 134 | data: body, 135 | ...(options || {}), 136 | }); 137 | } 138 | 139 | /** userLogout POST /api/user/logout */ 140 | export async function userLogoutUsingPOST(options?: { [key: string]: any }) { 141 | return request('/api/user/logout', { 142 | method: 'POST', 143 | ...(options || {}), 144 | }); 145 | } 146 | 147 | /** userRegister POST /api/user/register */ 148 | export async function userRegisterUsingPOST( 149 | body: API.UserRegisterRequest, 150 | options?: { [key: string]: any }, 151 | ) { 152 | return request('/api/user/register', { 153 | method: 'POST', 154 | headers: { 155 | 'Content-Type': 'application/json', 156 | }, 157 | data: body, 158 | ...(options || {}), 159 | }); 160 | } 161 | 162 | /** smsCaptcha GET /api/user/smsCaptcha */ 163 | export async function smsCaptchaUsingGET( 164 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 165 | params: API.smsCaptchaUsingGETParams, 166 | options?: { [key: string]: any }, 167 | ) { 168 | return request('/api/user/smsCaptcha', { 169 | method: 'GET', 170 | params: { 171 | ...params, 172 | }, 173 | ...(options || {}), 174 | }); 175 | } 176 | 177 | /** updateUser POST /api/user/update */ 178 | export async function updateUserUsingPOST( 179 | body: API.UserUpdateRequest, 180 | options?: { [key: string]: any }, 181 | ) { 182 | return request('/api/user/update', { 183 | method: 'POST', 184 | headers: { 185 | 'Content-Type': 'application/json', 186 | }, 187 | data: body, 188 | ...(options || {}), 189 | }); 190 | } 191 | 192 | /** updateUserAvatar POST /api/user/update/avatar */ 193 | export async function updateUserAvatarUsingPOST(body: string, options?: { [key: string]: any }) { 194 | return request('/api/user/update/avatar', { 195 | method: 'POST', 196 | headers: { 197 | 'Content-Type': 'application/json', 198 | }, 199 | data: body, 200 | ...(options || {}), 201 | }); 202 | } 203 | -------------------------------------------------------------------------------- /src/api/binapi-backend/userInterfaceController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** addUserInterfaceInfo POST /api/userInterfaceInfo/add */ 6 | export async function addUserInterfaceInfoUsingPOST( 7 | body: API.UserInterfaceInfoAddRequest, 8 | options?: { [key: string]: any }, 9 | ) { 10 | return request('/api/userInterfaceInfo/add', { 11 | method: 'POST', 12 | headers: { 13 | 'Content-Type': 'application/json', 14 | }, 15 | data: body, 16 | ...(options || {}), 17 | }); 18 | } 19 | 20 | /** deleteUserInterfaceInfo POST /api/userInterfaceInfo/delete */ 21 | export async function deleteUserInterfaceInfoUsingPOST( 22 | body: API.DeleteRequest, 23 | options?: { [key: string]: any }, 24 | ) { 25 | return request('/api/userInterfaceInfo/delete', { 26 | method: 'POST', 27 | headers: { 28 | 'Content-Type': 'application/json', 29 | }, 30 | data: body, 31 | ...(options || {}), 32 | }); 33 | } 34 | 35 | /** getUserInterfaceInfoById GET /api/userInterfaceInfo/get */ 36 | export async function getUserInterfaceInfoByIdUsingGET( 37 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 38 | params: API.getUserInterfaceInfoByIdUsingGETParams, 39 | options?: { [key: string]: any }, 40 | ) { 41 | return request('/api/userInterfaceInfo/get', { 42 | method: 'GET', 43 | params: { 44 | ...params, 45 | }, 46 | ...(options || {}), 47 | }); 48 | } 49 | 50 | /** getFreeInterfaceCount POST /api/userInterfaceInfo/get/free */ 51 | export async function getFreeInterfaceCountUsingPOST( 52 | body: API.UpdateUserInterfaceInfoDTO, 53 | options?: { [key: string]: any }, 54 | ) { 55 | return request('/api/userInterfaceInfo/get/free', { 56 | method: 'POST', 57 | headers: { 58 | 'Content-Type': 'application/json', 59 | }, 60 | data: body, 61 | ...(options || {}), 62 | }); 63 | } 64 | 65 | /** listUserInterfaceInfo GET /api/userInterfaceInfo/list */ 66 | export async function listUserInterfaceInfoUsingGET( 67 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 68 | params: API.listUserInterfaceInfoUsingGETParams, 69 | options?: { [key: string]: any }, 70 | ) { 71 | return request('/api/userInterfaceInfo/list', { 72 | method: 'GET', 73 | params: { 74 | ...params, 75 | }, 76 | ...(options || {}), 77 | }); 78 | } 79 | 80 | /** listUserInterfaceInfoByPage GET /api/userInterfaceInfo/list/page */ 81 | export async function listUserInterfaceInfoByPageUsingGET( 82 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 83 | params: API.listUserInterfaceInfoByPageUsingGETParams, 84 | options?: { [key: string]: any }, 85 | ) { 86 | return request('/api/userInterfaceInfo/list/page', { 87 | method: 'GET', 88 | params: { 89 | ...params, 90 | }, 91 | ...(options || {}), 92 | }); 93 | } 94 | 95 | /** getInterfaceInfoByUserId GET /api/userInterfaceInfo/list/userId */ 96 | export async function getInterfaceInfoByUserIdUsingGET( 97 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 98 | params: API.getInterfaceInfoByUserIdUsingGETParams, 99 | options?: { [key: string]: any }, 100 | ) { 101 | return request('/api/userInterfaceInfo/list/userId', { 102 | method: 'GET', 103 | params: { 104 | ...params, 105 | }, 106 | ...(options || {}), 107 | }); 108 | } 109 | 110 | /** updateUserInterfaceInfo POST /api/userInterfaceInfo/update */ 111 | export async function updateUserInterfaceInfoUsingPOST( 112 | body: API.UserInterfaceInfoUpdateRequest, 113 | options?: { [key: string]: any }, 114 | ) { 115 | return request('/api/userInterfaceInfo/update', { 116 | method: 'POST', 117 | headers: { 118 | 'Content-Type': 'application/json', 119 | }, 120 | data: body, 121 | ...(options || {}), 122 | }); 123 | } 124 | -------------------------------------------------------------------------------- /src/api/binapi-order/basicErrorController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** errorHtml GET /api/order/error */ 6 | export async function errorHtmlUsingGET(options?: { [key: string]: any }) { 7 | return request('/api/order/error', { 8 | method: 'GET', 9 | ...(options || {}), 10 | }); 11 | } 12 | 13 | /** errorHtml PUT /api/order/error */ 14 | export async function errorHtmlUsingPUT(options?: { [key: string]: any }) { 15 | return request('/api/order/error', { 16 | method: 'PUT', 17 | ...(options || {}), 18 | }); 19 | } 20 | 21 | /** errorHtml POST /api/order/error */ 22 | export async function errorHtmlUsingPOST(options?: { [key: string]: any }) { 23 | return request('/api/order/error', { 24 | method: 'POST', 25 | ...(options || {}), 26 | }); 27 | } 28 | 29 | /** errorHtml DELETE /api/order/error */ 30 | export async function errorHtmlUsingDELETE(options?: { [key: string]: any }) { 31 | return request('/api/order/error', { 32 | method: 'DELETE', 33 | ...(options || {}), 34 | }); 35 | } 36 | 37 | /** errorHtml PATCH /api/order/error */ 38 | export async function errorHtmlUsingPATCH(options?: { [key: string]: any }) { 39 | return request('/api/order/error', { 40 | method: 'PATCH', 41 | ...(options || {}), 42 | }); 43 | } 44 | -------------------------------------------------------------------------------- /src/api/binapi-order/index.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | // API 更新时间: 4 | // API 唯一标识: 5 | import * as basicErrorController from './basicErrorController'; 6 | import * as orderController from './orderController'; 7 | export default { 8 | basicErrorController, 9 | orderController, 10 | }; 11 | -------------------------------------------------------------------------------- /src/api/binapi-order/orderController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** addOrder POST /api/order/addOrder */ 6 | export async function addOrderUsingPOST( 7 | body: API.OrderAddRequest, 8 | options?: { [key: string]: any }, 9 | ) { 10 | return request('/api/order/addOrder', { 11 | method: 'POST', 12 | headers: { 13 | 'Content-Type': 'application/json', 14 | }, 15 | data: body, 16 | ...(options || {}), 17 | }); 18 | } 19 | 20 | /** listPageOrder GET /api/order/list */ 21 | export async function listPageOrderUsingGET( 22 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 23 | params: API.listPageOrderUsingGETParams, 24 | options?: { [key: string]: any }, 25 | ) { 26 | return request('/api/order/list', { 27 | method: 'GET', 28 | params: { 29 | ...params, 30 | }, 31 | ...(options || {}), 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /src/api/binapi-order/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace API { 2 | type BaseResponseOrderVO = { 3 | code?: number; 4 | data?: OrderVO; 5 | message?: string; 6 | }; 7 | 8 | type BaseResponsePageOrderVO = { 9 | code?: number; 10 | data?: PageOrderVO; 11 | message?: string; 12 | }; 13 | 14 | type listPageOrderUsingGETParams = { 15 | current?: number; 16 | pageSize?: number; 17 | sortField?: string; 18 | sortOrder?: string; 19 | type?: string; 20 | }; 21 | 22 | type ModelAndView = { 23 | empty?: boolean; 24 | model?: Record; 25 | modelMap?: Record; 26 | reference?: boolean; 27 | status?: 28 | | 'ACCEPTED' 29 | | 'ALREADY_REPORTED' 30 | | 'BAD_GATEWAY' 31 | | 'BAD_REQUEST' 32 | | 'BANDWIDTH_LIMIT_EXCEEDED' 33 | | 'CHECKPOINT' 34 | | 'CONFLICT' 35 | | 'CONTINUE' 36 | | 'CREATED' 37 | | 'DESTINATION_LOCKED' 38 | | 'EXPECTATION_FAILED' 39 | | 'FAILED_DEPENDENCY' 40 | | 'FORBIDDEN' 41 | | 'FOUND' 42 | | 'GATEWAY_TIMEOUT' 43 | | 'GONE' 44 | | 'HTTP_VERSION_NOT_SUPPORTED' 45 | | 'IM_USED' 46 | | 'INSUFFICIENT_SPACE_ON_RESOURCE' 47 | | 'INSUFFICIENT_STORAGE' 48 | | 'INTERNAL_SERVER_ERROR' 49 | | 'I_AM_A_TEAPOT' 50 | | 'LENGTH_REQUIRED' 51 | | 'LOCKED' 52 | | 'LOOP_DETECTED' 53 | | 'METHOD_FAILURE' 54 | | 'METHOD_NOT_ALLOWED' 55 | | 'MOVED_PERMANENTLY' 56 | | 'MOVED_TEMPORARILY' 57 | | 'MULTIPLE_CHOICES' 58 | | 'MULTI_STATUS' 59 | | 'NETWORK_AUTHENTICATION_REQUIRED' 60 | | 'NON_AUTHORITATIVE_INFORMATION' 61 | | 'NOT_ACCEPTABLE' 62 | | 'NOT_EXTENDED' 63 | | 'NOT_FOUND' 64 | | 'NOT_IMPLEMENTED' 65 | | 'NOT_MODIFIED' 66 | | 'NO_CONTENT' 67 | | 'OK' 68 | | 'PARTIAL_CONTENT' 69 | | 'PAYLOAD_TOO_LARGE' 70 | | 'PAYMENT_REQUIRED' 71 | | 'PERMANENT_REDIRECT' 72 | | 'PRECONDITION_FAILED' 73 | | 'PRECONDITION_REQUIRED' 74 | | 'PROCESSING' 75 | | 'PROXY_AUTHENTICATION_REQUIRED' 76 | | 'REQUESTED_RANGE_NOT_SATISFIABLE' 77 | | 'REQUEST_ENTITY_TOO_LARGE' 78 | | 'REQUEST_HEADER_FIELDS_TOO_LARGE' 79 | | 'REQUEST_TIMEOUT' 80 | | 'REQUEST_URI_TOO_LONG' 81 | | 'RESET_CONTENT' 82 | | 'SEE_OTHER' 83 | | 'SERVICE_UNAVAILABLE' 84 | | 'SWITCHING_PROTOCOLS' 85 | | 'TEMPORARY_REDIRECT' 86 | | 'TOO_EARLY' 87 | | 'TOO_MANY_REQUESTS' 88 | | 'UNAUTHORIZED' 89 | | 'UNAVAILABLE_FOR_LEGAL_REASONS' 90 | | 'UNPROCESSABLE_ENTITY' 91 | | 'UNSUPPORTED_MEDIA_TYPE' 92 | | 'UPGRADE_REQUIRED' 93 | | 'URI_TOO_LONG' 94 | | 'USE_PROXY' 95 | | 'VARIANT_ALSO_NEGOTIATES'; 96 | view?: View; 97 | viewName?: string; 98 | }; 99 | 100 | type OrderAddRequest = { 101 | charging?: number; 102 | chargingId?: number; 103 | count?: number; 104 | interfaceId?: number; 105 | totalAmount?: number; 106 | userId?: number; 107 | }; 108 | 109 | type OrderItem = { 110 | asc?: boolean; 111 | column?: string; 112 | }; 113 | 114 | type OrderVO = { 115 | charging?: number; 116 | createTime?: string; 117 | expirationTime?: string; 118 | interfaceDesc?: string; 119 | interfaceId?: number; 120 | interfaceName?: string; 121 | orderNumber?: string; 122 | status?: number; 123 | total?: number; 124 | totalAmount?: number; 125 | userId?: number; 126 | }; 127 | 128 | type PageOrderVO = { 129 | countId?: string; 130 | current?: number; 131 | maxLimit?: number; 132 | optimizeCountSql?: boolean; 133 | orders?: OrderItem[]; 134 | pages?: number; 135 | records?: OrderVO[]; 136 | searchCount?: boolean; 137 | size?: number; 138 | total?: number; 139 | }; 140 | 141 | type View = { 142 | contentType?: string; 143 | }; 144 | } 145 | -------------------------------------------------------------------------------- /src/api/binapi-third/aliPayController.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | import { request } from '@umijs/max'; 4 | 5 | /** payNotify POST /api/third/alipay/notify */ 6 | export async function payNotifyUsingPOST(options?: { [key: string]: any }) { 7 | return request('/api/third/alipay/notify', { 8 | method: 'POST', 9 | ...(options || {}), 10 | }); 11 | } 12 | 13 | /** pay GET /api/third/alipay/pay */ 14 | export async function payUsingGET( 15 | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) 16 | params: API.payUsingGETParams, 17 | options?: { [key: string]: any }, 18 | ) { 19 | return request('/api/third/alipay/pay', { 20 | method: 'GET', 21 | params: { 22 | ...params, 23 | }, 24 | ...(options || {}), 25 | }); 26 | } 27 | 28 | /** payCode POST /api/third/alipay/payCode */ 29 | export async function payCodeUsingPOST(body: API.AlipayRequest, options?: { [key: string]: any }) { 30 | return request('/api/third/alipay/payCode', { 31 | method: 'POST', 32 | headers: { 33 | 'Content-Type': 'application/json', 34 | }, 35 | data: body, 36 | ...(options || {}), 37 | }); 38 | } 39 | 40 | /** tradeQuery POST /api/third/alipay/tradeQuery */ 41 | export async function tradeQueryUsingPOST(options?: { [key: string]: any }) { 42 | return request('/api/third/alipay/tradeQuery', { 43 | method: 'POST', 44 | ...(options || {}), 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /src/api/binapi-third/index.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | /* eslint-disable */ 3 | // API 更新时间: 4 | // API 唯一标识: 5 | import * as aliPayController from './aliPayController'; 6 | export default { 7 | aliPayController, 8 | }; 9 | -------------------------------------------------------------------------------- /src/api/binapi-third/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace API { 2 | type AlipayRequest = { 3 | alipayTraceNo?: string; 4 | subject?: string; 5 | totalAmount?: number; 6 | traceNo?: string; 7 | }; 8 | 9 | type ModelAndView = { 10 | empty?: boolean; 11 | model?: Record; 12 | modelMap?: Record; 13 | reference?: boolean; 14 | status?: 15 | | 'ACCEPTED' 16 | | 'ALREADY_REPORTED' 17 | | 'BAD_GATEWAY' 18 | | 'BAD_REQUEST' 19 | | 'BANDWIDTH_LIMIT_EXCEEDED' 20 | | 'CHECKPOINT' 21 | | 'CONFLICT' 22 | | 'CONTINUE' 23 | | 'CREATED' 24 | | 'DESTINATION_LOCKED' 25 | | 'EXPECTATION_FAILED' 26 | | 'FAILED_DEPENDENCY' 27 | | 'FORBIDDEN' 28 | | 'FOUND' 29 | | 'GATEWAY_TIMEOUT' 30 | | 'GONE' 31 | | 'HTTP_VERSION_NOT_SUPPORTED' 32 | | 'IM_USED' 33 | | 'INSUFFICIENT_SPACE_ON_RESOURCE' 34 | | 'INSUFFICIENT_STORAGE' 35 | | 'INTERNAL_SERVER_ERROR' 36 | | 'I_AM_A_TEAPOT' 37 | | 'LENGTH_REQUIRED' 38 | | 'LOCKED' 39 | | 'LOOP_DETECTED' 40 | | 'METHOD_FAILURE' 41 | | 'METHOD_NOT_ALLOWED' 42 | | 'MOVED_PERMANENTLY' 43 | | 'MOVED_TEMPORARILY' 44 | | 'MULTIPLE_CHOICES' 45 | | 'MULTI_STATUS' 46 | | 'NETWORK_AUTHENTICATION_REQUIRED' 47 | | 'NON_AUTHORITATIVE_INFORMATION' 48 | | 'NOT_ACCEPTABLE' 49 | | 'NOT_EXTENDED' 50 | | 'NOT_FOUND' 51 | | 'NOT_IMPLEMENTED' 52 | | 'NOT_MODIFIED' 53 | | 'NO_CONTENT' 54 | | 'OK' 55 | | 'PARTIAL_CONTENT' 56 | | 'PAYLOAD_TOO_LARGE' 57 | | 'PAYMENT_REQUIRED' 58 | | 'PERMANENT_REDIRECT' 59 | | 'PRECONDITION_FAILED' 60 | | 'PRECONDITION_REQUIRED' 61 | | 'PROCESSING' 62 | | 'PROXY_AUTHENTICATION_REQUIRED' 63 | | 'REQUESTED_RANGE_NOT_SATISFIABLE' 64 | | 'REQUEST_ENTITY_TOO_LARGE' 65 | | 'REQUEST_HEADER_FIELDS_TOO_LARGE' 66 | | 'REQUEST_TIMEOUT' 67 | | 'REQUEST_URI_TOO_LONG' 68 | | 'RESET_CONTENT' 69 | | 'SEE_OTHER' 70 | | 'SERVICE_UNAVAILABLE' 71 | | 'SWITCHING_PROTOCOLS' 72 | | 'TEMPORARY_REDIRECT' 73 | | 'TOO_EARLY' 74 | | 'TOO_MANY_REQUESTS' 75 | | 'UNAUTHORIZED' 76 | | 'UNAVAILABLE_FOR_LEGAL_REASONS' 77 | | 'UNPROCESSABLE_ENTITY' 78 | | 'UNSUPPORTED_MEDIA_TYPE' 79 | | 'UPGRADE_REQUIRED' 80 | | 'URI_TOO_LONG' 81 | | 'USE_PROXY' 82 | | 'VARIANT_ALSO_NEGOTIATES'; 83 | view?: View; 84 | viewName?: string; 85 | }; 86 | 87 | type payUsingGETParams = { 88 | /** outTradeNo */ 89 | outTradeNo: string; 90 | /** subject */ 91 | subject: string; 92 | /** totalAmount */ 93 | totalAmount: number; 94 | }; 95 | 96 | type View = { 97 | contentType?: string; 98 | }; 99 | } 100 | -------------------------------------------------------------------------------- /src/app.tsx: -------------------------------------------------------------------------------- 1 | import Footer from '@/components/Footer'; 2 | import RightContent from '@/components/RightContent'; 3 | import { LinkOutlined } from '@ant-design/icons'; 4 | import { SettingDrawer } from '@ant-design/pro-components'; 5 | import type { RunTimeLayoutConfig } from '@umijs/max'; 6 | import { history, Link } from '@umijs/max'; 7 | import { requestConfig } from './requestConfig'; 8 | import { getLoginUserUsingGET } from '@/api/binapi-backend/userController'; 9 | import Settings from '../config/defaultSettings' 10 | const isDev = process.env.NODE_ENV === 'development'; 11 | const loginPath = '/user/login'; 12 | 13 | /** 14 | * @see https://umijs.org/zh-CN/plugins/plugin-initial-state 15 | * */ 16 | export async function getInitialState(): Promise { 17 | //页面首次加载,获取全局信息,比如用户登录态 18 | const state: InitialState = { 19 | loginUser: undefined, 20 | }; 21 | try { 22 | const res = await getLoginUserUsingGET(); 23 | if (res.data) { 24 | state.loginUser = res.data; 25 | } 26 | } catch (error) { 27 | history.push(loginPath); 28 | } 29 | return state; 30 | } 31 | 32 | // ProLayout 支持的api https://procomponents.ant.design/components/layout 33 | export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => { 34 | return { 35 | rightContentRender: () => , 36 | waterMarkProps: { 37 | content: initialState?.loginUser?.userName, 38 | }, 39 | footerRender: () =>