kevin-wang001 / mockj Goto Github PK
View Code? Open in Web Editor NEW:boom: generate mock data with specified template. 生成mock数据的利器,mockjs的java实现。同时内置随机 random 一个对象的功能。OSSRH-56437
License: Apache License 2.0
:boom: generate mock data with specified template. 生成mock数据的利器,mockjs的java实现。同时内置随机 random 一个对象的功能。OSSRH-56437
License: Apache License 2.0
[a-z][A-Z][0-9] 这样子的正则表达式支持么?
ArrayHandler的55-67行建议改成如下所示:
JSONArray jsonArray = new JSONArray();
for (int i = 0; i < option.getRule().getCount(); i++) {
JSONArray templates = (JSONArray) option.getTemplate();
if (templates.size() > 1) {
int index = 0;
for (Object template : templates) {
jsonArray.add(CatMockHandler.gen(template, Integer.toString(index), option.getContext()));
index++;
}
} else if (templates.size() == 1) {
jsonArray.add(CatMockHandler.gen(templates.get(0), "0", option.getContext()));
}
}
return jsonArray;
当前从gitee上拉的最新代码处理数组时会增加一层[]
,如下所示:
//input
{
"array|3": [{
"Hello":"Hello",
"Mock.js":"Mock.js",
"!":"!"
}]
}
//output
{
"array": [[{
"Hello":"Hello",
"Mock.js":"Mock.js",
"!":"!"
}],
[{
"Hello":"Hello",
"Mock.js":"Mock.js",
"!":"!"
}],
[{
"Hello":"Hello",
"Mock.js":"Mock.js",
"!":"!"
}]]
}
可以支持生成csv格式吗?这样我可以方便的为数据库添加测试数据。
比如常用的 @name
@address
@email
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.