GithubHelp home page GithubHelp logo

kangjs7854 / react-ts-template Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 1.12 MB

通过操作可编辑表格,定义数据协议,生成数据接口,快速mock

JavaScript 11.82% HTML 1.74% TypeScript 82.86% SCSS 2.89% Less 0.69%

react-ts-template's Introduction

为什么这样一个mock的平台

在项目的开发过程中,接口的联调是至关重要的一环,所以需要进行数据mock;使用第三方mock平台时我遇到了下方几个问题:

  1. mock返回无意义的数据

使用第三方的mock功能,返回的数据字段大部分都是一堆没有意义的字符串;可以选择使用node来开发服务特别,让mock的场景更加真实

  1. 接口协议一般以表格的方式展示,有没有将表格数据直接生成数据接口的可能性

思路

  1. 前端操作表格定义好接口协议之后,获取数据名称、类型、默认值、api名称等信息;
  2. node端处理表格数据,生成schema及填充值,对复杂数据类型进行处理,根据主键插入或更新数据;
  3. 前端渲染node端返回的json数据在表格下方,对json数据进行操作,编辑或删除字段,提供更加灵活的mock功能;

难点

  • 动态定义模式,也就是定义我们所需要字段的名称,数据类型;
  • 处理复杂的数据类型,数组对象;
  • 多级对象嵌套的数据结构;
  • 支持修改响应的数据字段,提供更加灵活的mock;
  • 导入接口协议;

react-ts-template's People

Contributors

kangjs7854 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

wooodhead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.