easy-mock-core

easy-mock

License

License

GroupId

GroupId

com.github.lzj960515
ArtifactId

ArtifactId

easy-mock-core
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

easy-mock-core
easy-mock

Download easy-mock-core

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar 2.3.5.RELEASE
com.github.javafaker : javafaker jar 1.0.2

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.16

Project Modules

There are no modules declared in this project.

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