Skip to content

Commit

Permalink
提交
Browse files Browse the repository at this point in the history
  • Loading branch information
qiurunze committed Jan 24, 2019
1 parent dfac04a commit 6482bed
Show file tree
Hide file tree
Showing 63 changed files with 1,825 additions and 76 deletions.
6 changes: 6 additions & 0 deletions miaosha-admin/miaosha-admin-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<artifactId>miaosha-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>


</project>
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;

}
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;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.geekq.common.entity;
package com.geekq.admin.entity;

import com.geekq.common.enums.Constants;
import lombok.AllArgsConstructor;
Expand All @@ -12,7 +12,7 @@
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class MiaoshaUser {
public class Logininfo {

private Long id;
private String nickname;
Expand Down
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);
}
}
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);
}
}
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;
}
}
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;
Expand Down
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;
Expand Down
Loading

0 comments on commit 6482bed

Please sign in to comment.