Skip to content

Commit

Permalink
随机虚构地址
Browse files Browse the repository at this point in the history
  • Loading branch information
yindz committed May 20, 2023
1 parent 062993c commit 843ace1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/apifan/common/random/source/AreaSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@ public String randomFictionalCity() {
return Joiner.on("").join(ResourceUtils.getRandomElement(addressWordList, 2)) + "市";
}

/**
* 随机虚构地址
*
* @return 虚构地址
*/
public String randomFictionalAddress() {
String road = ResourceUtils.getRandomString(addressWordList, 2) + ResourceUtils.getRandomElement(directionList);
return randomFictionalProvince() + randomFictionalCity() + road + "路" + RandomUtils.nextInt(1, 1000) + "号";
}

/**
* 返回随机的国家或地区编码信息
*
Expand Down

0 comments on commit 843ace1

Please sign in to comment.