-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from yindz/dev
Dev
- Loading branch information
Showing
7 changed files
with
593 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
src/main/java/com/apifan/common/random/RandomSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package com.apifan.common.random; | ||
|
||
import com.apifan.common.random.source.*; | ||
|
||
/** | ||
* 统一入口类 | ||
* | ||
* @author yin | ||
* @since 1.0.19 | ||
*/ | ||
public class RandomSource { | ||
|
||
/** | ||
* 获取地区数据源 | ||
* | ||
* @return 地区数据源 | ||
*/ | ||
public static AreaSource areaSource() { | ||
return AreaSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取日期时间数据源 | ||
* | ||
* @return 日期时间数据源 | ||
*/ | ||
public static DateTimeSource dateTimeSource() { | ||
return DateTimeSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取教育信息数据源 | ||
* | ||
* @return 教育信息数据源 | ||
*/ | ||
public static EducationSource educationSource() { | ||
return EducationSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取金融相关数据源 | ||
* | ||
* @return 金融相关数据源 | ||
*/ | ||
public static FinancialSource financialSource() { | ||
return FinancialSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取互联网信息数据源 | ||
* | ||
* @return 互联网信息数据源 | ||
*/ | ||
public static InternetSource internetSource() { | ||
return InternetSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取数值数据源 | ||
* | ||
* @return 数值数据源 | ||
*/ | ||
public static NumberSource numberSource() { | ||
return NumberSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取个人信息数据源 | ||
* | ||
* @return 个人信息数据源 | ||
*/ | ||
public static PersonInfoSource personInfoSource() { | ||
return PersonInfoSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取体育竞技数据源 | ||
* | ||
* @return 体育竞技数据源 | ||
*/ | ||
public static SportSource sportSource() { | ||
return SportSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取语言文字数据源 | ||
* | ||
* @return 语言文字数据源 | ||
*/ | ||
public static LanguageSource languageSource() { | ||
return LanguageSource.getInstance(); | ||
} | ||
|
||
/** | ||
* 获取其它杂项数据源 | ||
* | ||
* @return 其它杂项数据源 | ||
*/ | ||
public static OtherSource otherSource() { | ||
return OtherSource.getInstance(); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/com/apifan/common/random/constant/Province.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.apifan.common.random.constant; | ||
|
||
/** | ||
* 省/直辖市/自治区/特别行政区名称枚举 | ||
* | ||
* @author yin | ||
* @since 1.0.19 | ||
*/ | ||
public enum Province { | ||
|
||
BJ("北京市", "京"), | ||
SH("上海市", "沪"), | ||
TJ("天津市", "津"), | ||
CQ("重庆市", "渝"), | ||
HE("河北省", "冀"), | ||
SX("山西省", "晋"), | ||
NM("内蒙古自治区", "蒙"), | ||
LN("辽宁省", "辽"), | ||
JL("吉林省", "吉"), | ||
HL("黑龙江省", "黑"), | ||
JS("江苏省", "苏"), | ||
ZJ("浙江省", "浙"), | ||
AH("安徽省", "皖"), | ||
FJ("福建省", "闽"), | ||
JX("江西省", "赣"), | ||
SD("山东省", "鲁"), | ||
HA("河南省", "豫"), | ||
HB("湖北省", "鄂"), | ||
HN("湖南省", "湘"), | ||
GD("广东省", "粤"), | ||
GX("广西壮族自治区", "桂"), | ||
HI("海南省", "琼"), | ||
SC("四川省", "川"), | ||
GZ("贵州省", "贵"), | ||
YN("云南省", "云"), | ||
XZ("西藏自治区", "藏"), | ||
SN("陕西省", "陕"), | ||
GS("甘肃省", "甘"), | ||
QH("青海省", "青"), | ||
NX("宁夏回族自治区", "宁"), | ||
XJ("新疆维吾尔自治区", "新"), | ||
TW("台湾省", "台"), | ||
HK("香港特别行政区", "港"), | ||
MO("澳门特别行政区", "澳"); | ||
|
||
private String name; | ||
private String prefix; | ||
|
||
Province(String n, String p) { | ||
this.name = n; | ||
this.prefix = p; | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
public String getPrefix() { | ||
return this.prefix; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.