easy-mock


License

License

GroupId

GroupId

com.github.lzj960515
ArtifactId

ArtifactId

easy-mock
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

pom
Description

Description

easy-mock
easy-mock
Project URL

Project URL

https://github.com/lzj960515/easycanal
Source Code Management

Source Code Management

https://github.com/lzj960515/easy-mock.git

Download easy-mock

Filename Size
easy-mock-0.0.1.pom 6 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.lzj960515/easy-mock/ -->
<dependency>
    <groupId>com.github.lzj960515</groupId>
    <artifactId>easy-mock</artifactId>
    <version>0.0.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.lzj960515/easy-mock/
implementation 'com.github.lzj960515:easy-mock:0.0.1'
// https://jarcasting.com/artifacts/com.github.lzj960515/easy-mock/
implementation ("com.github.lzj960515:easy-mock:0.0.1")
'com.github.lzj960515:easy-mock:pom:0.0.1'
<dependency org="com.github.lzj960515" name="easy-mock" rev="0.0.1">
  <artifact name="easy-mock" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.lzj960515', module='easy-mock', version='0.0.1')
)
libraryDependencies += "com.github.lzj960515" % "easy-mock" % "0.0.1"
[com.github.lzj960515/easy-mock "0.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • easy-mock-core

easy-mock

简单的mock工具,类似mock.js使用

使用方式

  • 引入easy-mock依赖

     <dependency>
           <groupId>com.github.lzj960515</groupId>
           <artifactId>easy-mock</artifactId>
           <version>0.0.1</version>
     </dependency>
  • 在类的属性名中增加注解

    @Data
    public class User {
    
        @Name
        private String name;
        @Age
        private String age;
        @Chinese
        private String hobby;
        @Gender
        private String gender;
        @Entity
        private Order order;
    
        private List<Order> orderList;
    
    }
    @Data
    public class Order {
    
        @Number
        private String number;
    
        @Price
        private String price;
    }
  • 使用MockUtil进行生成对象

    User user = MockUtil.mock(User.class);

支持的注解

  • Address
  • Age
  • Avatar
  • Birthday
  • Chinese
  • Date
  • DateTime
  • Disease
  • Entity
  • Gender
  • Hospital
  • IdNumber
  • Medicine
  • Name
  • Number
  • Phone
  • Price
  • Symptoms
  • University

Versions

Version
0.0.1