forked from qiurunze123/miaosha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
qiurunze
committed
Jan 24, 2019
1 parent
dfac04a
commit 6482bed
Showing
63 changed files
with
1,825 additions
and
76 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
17 changes: 17 additions & 0 deletions
17
miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/admin/entity/BaseDomain.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,17 @@ | ||
package com.geekq.admin.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author qiurunze | ||
*/ | ||
@Getter | ||
@Setter | ||
public class BaseDomain implements Serializable { | ||
|
||
protected Long id; | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/admin/entity/IpLog.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,46 @@ | ||
package com.geekq.admin.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.apache.ibatis.type.Alias; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* 登陆日志 | ||
* @author Administrator | ||
*/ | ||
@Getter | ||
@Setter | ||
@Alias("IpLog") | ||
public class IpLog extends BaseDomain { | ||
public static int LOGINSTATE_FAILD = 0;//登陆失败 | ||
public static int LOGINSTATE_SUCCESS = 1;//登陆成功 | ||
|
||
private String username; | ||
private Date loginTime; | ||
private String ip; | ||
|
||
private int loginState; | ||
private int loginType; | ||
private Long loginInfoId; | ||
|
||
public String getDisplayState(){ | ||
return this.loginState==LOGINSTATE_FAILD?"登录失败":"登录成功"; | ||
} | ||
|
||
public IpLog() { | ||
super(); | ||
} | ||
|
||
public IpLog(String username, Date loginTime, String ip, int loginType, | ||
Long loginInfoId) { | ||
super(); | ||
this.username = username; | ||
this.loginTime = loginTime; | ||
this.ip = ip; | ||
this.loginState = IpLog.LOGINSTATE_FAILD; | ||
this.loginType = loginType; | ||
this.loginInfoId = loginInfoId; | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/admin/entity/SystemDictionary.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,34 @@ | ||
package com.geekq.admin.entity; | ||
|
||
import com.alibaba.fastjson.JSONObject; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.apache.ibatis.type.Alias; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* 数据字典 | ||
* | ||
* @author Stef | ||
* | ||
*/ | ||
@Getter | ||
@Setter | ||
@Alias("SystemDictionary") | ||
public class SystemDictionary extends BaseDomain { | ||
private static final long serialVersionUID = 3382007784095246946L; | ||
private String sn; // 编码 | ||
private String title; // 名称 | ||
private String intro; // 简介 | ||
|
||
public String getJsonString() { | ||
Map<String, Object> m = new HashMap<>(); | ||
m.put("id", getId()); | ||
m.put("sn", sn); | ||
m.put("title", title); | ||
m.put("intro", intro); | ||
return JSONObject.toJSONString(m); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...ha-admin/miaosha-admin-api/src/main/java/com/geekq/admin/entity/SystemDictionaryItem.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,38 @@ | ||
package com.geekq.admin.entity; | ||
|
||
import com.alibaba.fastjson.JSONObject; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.apache.ibatis.type.Alias; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* 数据字典明细 | ||
* | ||
* @author Stef | ||
*/ | ||
@Getter | ||
@Setter | ||
@Alias("SystemDictionaryItem") | ||
public class SystemDictionaryItem extends BaseDomain { | ||
|
||
private static final long serialVersionUID = 4520006109163647891L; | ||
private Long parentId; // 系统目录 | ||
private String title; // 名称 | ||
private String tvalue; // 值 | ||
private Integer sequence; // 序列 | ||
private String intro; // 说明 | ||
|
||
public String getJsonString() { | ||
Map<String, Object> m = new HashMap<>(); | ||
m.put("id", getId()); | ||
m.put("parentId", parentId); | ||
m.put("title", title); | ||
m.put("tvalue", tvalue); | ||
m.put("sequence", sequence); | ||
m.put("intro", intro); | ||
return JSONObject.toJSONString(m); | ||
} | ||
} |
217 changes: 217 additions & 0 deletions
217
miaosha-admin/miaosha-admin-api/src/main/java/com/geekq/admin/entity/Userinfo.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,217 @@ | ||
package com.geekq.admin.entity; | ||
|
||
import com.geekq.common.utils.numcal.BitStatesUtils; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.apache.ibatis.type.Alias; | ||
import org.springframework.util.StringUtils; | ||
|
||
/** | ||
* @author 邱润泽 | ||
*/ | ||
@Getter | ||
@Setter | ||
@Alias("UserInfo") | ||
public class Userinfo extends BaseDomain { | ||
|
||
private static final long serialVersionUID = -2194938919842714855L; | ||
/** | ||
* 版本号 | ||
*/ | ||
private int version; | ||
/** | ||
* 位状态 | ||
*/ | ||
private Long bitState = 0L; | ||
/** | ||
* 对应实名认证中的真实姓名 | ||
*/ | ||
private String realName; | ||
/** | ||
* 对应实名认证中的身份证号 | ||
*/ | ||
private String idNumber; | ||
/** | ||
* 用户邮箱 | ||
*/ | ||
private String email; | ||
/** | ||
* 手机号 | ||
*/ | ||
private String phoneNumber = ""; | ||
/** | ||
* 用户当前认证分数 | ||
*/ | ||
private int authScore = 0; | ||
/** | ||
* 用户有效的实名认证对象 | ||
*/ | ||
private Long realauthId; | ||
|
||
/** | ||
* 会员的基本资料 | ||
* 月收入 | ||
*/ | ||
private SystemDictionaryItem incomeGrade; | ||
/** | ||
* 婚姻情况 | ||
*/ | ||
private SystemDictionaryItem marriage; | ||
/** | ||
* 子女情况 | ||
*/ | ||
private SystemDictionaryItem kidCount; | ||
/** | ||
* 学历 | ||
*/ | ||
private SystemDictionaryItem educationBackground; | ||
/** | ||
* 住房条件 | ||
*/ | ||
private SystemDictionaryItem houseCondition; | ||
|
||
public static Userinfo empty(Long id) { | ||
Userinfo userinfo = new Userinfo(); | ||
userinfo.setId(id); | ||
userinfo.setBitState(BitStatesUtils.OP_BASIC_INFO); | ||
return userinfo; | ||
} | ||
|
||
public void addState(Long state) { | ||
this.bitState = BitStatesUtils.addState(this.bitState, state); | ||
} | ||
|
||
public void removeState(Long state) { | ||
this.bitState = BitStatesUtils.removeState(this.bitState, state); | ||
} | ||
|
||
public boolean getIsBindPhone() { | ||
return BitStatesUtils.hasState(bitState, BitStatesUtils.OP_BIND_PHONE); | ||
} | ||
|
||
public boolean getIsBindEmail() { | ||
return BitStatesUtils.hasState(bitState, BitStatesUtils.OP_BIND_EMAIL); | ||
} | ||
|
||
public boolean getBaseInfo() { | ||
return BitStatesUtils.hasState(bitState, BitStatesUtils.OP_BASE_INFO); | ||
} | ||
|
||
public boolean getRealAuth() { | ||
return BitStatesUtils.hasState(bitState, BitStatesUtils.OP_REAL_AUTH); | ||
} | ||
|
||
public boolean getVedioAuth() { | ||
return BitStatesUtils.hasState(bitState, BitStatesUtils.OP_VEDIO_AUTH); | ||
} | ||
|
||
public boolean getHasBidRequest(){ | ||
return BitStatesUtils.hasState(bitState, BitStatesUtils.OP_HAS_BIDRQUEST); | ||
} | ||
|
||
/** | ||
* 获取用户真实名字的隐藏字符串,只显示姓氏 | ||
* | ||
* @param 真实名字 | ||
* @return | ||
*/ | ||
public String getAnonymousRealName() { | ||
if (StringUtils.hasLength(realName)) { | ||
int len = realName.length(); | ||
String replace = ""; | ||
replace += realName.charAt(0); | ||
for (int i = 1; i < len; i++) { | ||
replace += "*"; | ||
} | ||
return replace; | ||
} | ||
return realName; | ||
} | ||
|
||
/** | ||
* 获取用户真实名字的隐藏字符串,只显示姓氏 | ||
* | ||
* @param realName | ||
* 真实名字 | ||
* @return | ||
*/ | ||
public static String getAnonymousRealName(String realName) { | ||
if (StringUtils.hasLength(realName)) { | ||
int len = realName.length(); | ||
String replace = ""; | ||
replace += realName.charAt(0); | ||
for (int i = 1; i < len; i++) { | ||
replace += "*"; | ||
} | ||
return replace; | ||
} | ||
return realName; | ||
} | ||
|
||
/** | ||
* 获取用户身份号码的隐藏字符串 | ||
* | ||
* @param idNumber | ||
* @return | ||
*/ | ||
public static String getAnonymousIdNumber(String idNumber) { | ||
if (StringUtils.hasLength(idNumber)) { | ||
int len = idNumber.length(); | ||
String replace = ""; | ||
for (int i = 0; i < len; i++) { | ||
if ((i > 5 && i < 10) || (i > len - 5)) { | ||
replace += "*"; | ||
} else { | ||
replace += idNumber.charAt(i); | ||
} | ||
} | ||
return replace; | ||
} | ||
return idNumber; | ||
} | ||
|
||
|
||
/** | ||
* 获取用户手机号码的隐藏字符串 | ||
* | ||
* @param phoneNumber | ||
* 用户手机号码 | ||
* @return | ||
*/ | ||
public static String getAnonymousPhoneNumber(String phoneNumber) { | ||
if (StringUtils.hasLength(phoneNumber)) { | ||
int len = phoneNumber.length(); | ||
String replace = ""; | ||
for (int i = 0; i < len; i++) { | ||
if (i > 2 && i < 7) { | ||
replace += "*"; | ||
} else { | ||
replace += phoneNumber.charAt(i); | ||
} | ||
} | ||
return replace; | ||
} | ||
return phoneNumber; | ||
} | ||
|
||
/** | ||
* 获取用户住址的隐藏字符串 | ||
* | ||
* @param currentAddress | ||
* 用户住址 | ||
* @return | ||
*/ | ||
public static String getAnonymousCurrentAddress(String currentAddress) { | ||
if (StringUtils.hasLength(currentAddress) | ||
&& currentAddress.length() > 4) { | ||
String last = currentAddress.substring(currentAddress.length() - 4, | ||
currentAddress.length()); | ||
String stars = ""; | ||
for (int i = 0; i < currentAddress.length() - 4; i++) { | ||
stars += "*"; | ||
} | ||
return stars + last; | ||
} | ||
return currentAddress; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ain/java/com/geekq/order/pojo/Orders.java → ...ain/java/com/geekq/admin/pojo/Orders.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.geekq.order.pojo; | ||
package com.geekq.admin.pojo; | ||
|
||
public class Orders { | ||
private String id; | ||
|
2 changes: 1 addition & 1 deletion
2
...a/com/geekq/order/pojo/OrdersExample.java → ...a/com/geekq/admin/pojo/OrdersExample.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.geekq.order.pojo; | ||
package com.geekq.admin.pojo; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
Oops, something went wrong.