10 changed files with 50 additions and 616 deletions
@ -1,72 +0,0 @@ |
|||
package bc.mm.mis.bean; |
|||
|
|||
import javax.persistence.*; |
|||
|
|||
@Entity |
|||
@Table(name = "country") |
|||
public class Country { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Integer id; |
|||
private String code; |
|||
private String name; |
|||
|
|||
@Column(name = "country_code") |
|||
private String countryCode; |
|||
|
|||
private Integer order; |
|||
|
|||
@Column(name = "en_name") |
|||
private String enName; |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(String code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getCountryCode() { |
|||
return countryCode; |
|||
} |
|||
|
|||
public void setCountryCode(String countryCode) { |
|||
this.countryCode = countryCode; |
|||
} |
|||
|
|||
public Integer getOrder() { |
|||
return order; |
|||
} |
|||
|
|||
public void setOrder(Integer order) { |
|||
this.order = order; |
|||
} |
|||
|
|||
public String getEnName() { |
|||
return enName; |
|||
} |
|||
|
|||
public void setEnName(String enName) { |
|||
this.enName = enName; |
|||
} |
|||
|
|||
public Country() { |
|||
} |
|||
} |
|||
@ -1,412 +0,0 @@ |
|||
package bc.mm.mis.bean; |
|||
|
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.Table; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* user bean |
|||
*/ |
|||
@Entity |
|||
@Table(name = "users") |
|||
public class Users { |
|||
@Id |
|||
@Column(name = "user_id") |
|||
private Long userId; |
|||
private Long id; //for agent
|
|||
private String name; // angent name
|
|||
private String account; // major account
|
|||
@Column(name = "account_type") |
|||
private Integer accountTpe; // 1:phone 2:email
|
|||
private String username; // user name
|
|||
private Integer referrer; // agent refer userid
|
|||
private Long pid; //parent id
|
|||
private Integer deep; // agent deep length
|
|||
private String path; |
|||
@Column(name = "country_id") |
|||
private Integer countryIdd; //
|
|||
@Column(name = "country_code") |
|||
private String countryCode; //
|
|||
private String phone; |
|||
@Column(name = "phone_status") |
|||
private Integer phoneStatus; // verfied or no
|
|||
private String email; //
|
|||
@Column(name = "email_status") |
|||
private Integer emailStatus; |
|||
private String avatar; //
|
|||
@Column(name = "google_token") |
|||
private String googleToken; // google authontion
|
|||
@Column(name = "google_status") |
|||
private Integer googleStatus; //
|
|||
@Column(name = "second_verify") |
|||
private Integer secondVerify; |
|||
private String password; //
|
|||
private String payword; |
|||
@Column(name = "invite_code") |
|||
private String inviteCode; |
|||
@Column(name = "purchase_code") |
|||
private String purchaseCode; |
|||
@Column(name = "user_grade") |
|||
private Integer userGrade; // default value 1
|
|||
@Column(name = "user_identity") |
|||
private Integer userIdentity; // user type defalt 1
|
|||
@Column(name = "is_agency") |
|||
private Integer isAgency; |
|||
@Column(name = "is_palce") |
|||
private Integer isPalce; |
|||
@Column(name = "user_auth_level") |
|||
private Integer userAuthLevel; //
|
|||
@Column(name = "is_system") |
|||
private Integer isSystem; |
|||
@Column(name = "contract_deal") |
|||
private Integer contractDeal; |
|||
@Column(name = "login_code") |
|||
private String loginCode; |
|||
private Integer status; |
|||
@Column(name = "trade_status") |
|||
private Integer tradeStatus; |
|||
@Column(name = "trade_verify") |
|||
private Integer tradeVerify; |
|||
@Column(name = "contract_anomaly") |
|||
private Integer contractAnomaly; |
|||
@Column(name = "reg_ip") |
|||
private String regIp; |
|||
@Column(name = "last_login_time") |
|||
private Date lastLoginTime; |
|||
@Column(name = "last_login_ip") |
|||
private String lastLoginIp; |
|||
@Column(name = "created_at") |
|||
private Date createdAt; |
|||
@Column(name = "update_at") |
|||
private Date updatedAt; |
|||
|
|||
public Long getUserId() { |
|||
return userId; |
|||
} |
|||
|
|||
public void setUserId(Long userId) { |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Long id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getAccount() { |
|||
return account; |
|||
} |
|||
|
|||
public void setAccount(String account) { |
|||
this.account = account; |
|||
} |
|||
|
|||
public Integer getAccountTpe() { |
|||
return accountTpe; |
|||
} |
|||
|
|||
public void setAccountTpe(Integer accountTpe) { |
|||
this.accountTpe = accountTpe; |
|||
} |
|||
|
|||
public String getUsername() { |
|||
return username; |
|||
} |
|||
|
|||
public void setUsername(String username) { |
|||
this.username = username; |
|||
} |
|||
|
|||
public Integer getReferrer() { |
|||
return referrer; |
|||
} |
|||
|
|||
public void setReferrer(Integer referrer) { |
|||
this.referrer = referrer; |
|||
} |
|||
|
|||
public Long getPid() { |
|||
return pid; |
|||
} |
|||
|
|||
public void setPid(Long pid) { |
|||
this.pid = pid; |
|||
} |
|||
|
|||
public Integer getDeep() { |
|||
return deep; |
|||
} |
|||
|
|||
public void setDeep(Integer deep) { |
|||
this.deep = deep; |
|||
} |
|||
|
|||
public String getPath() { |
|||
return path; |
|||
} |
|||
|
|||
public void setPath(String path) { |
|||
this.path = path; |
|||
} |
|||
|
|||
public Integer getCountryIdd() { |
|||
return countryIdd; |
|||
} |
|||
|
|||
public void setCountryIdd(Integer countryIdd) { |
|||
this.countryIdd = countryIdd; |
|||
} |
|||
|
|||
public String getCountryCode() { |
|||
return countryCode; |
|||
} |
|||
|
|||
public void setCountryCode(String countryCode) { |
|||
this.countryCode = countryCode; |
|||
} |
|||
|
|||
public String getPhone() { |
|||
return phone; |
|||
} |
|||
|
|||
public void setPhone(String phone) { |
|||
this.phone = phone; |
|||
} |
|||
|
|||
public Integer getPhoneStatus() { |
|||
return phoneStatus; |
|||
} |
|||
|
|||
public void setPhoneStatus(Integer phoneStatus) { |
|||
this.phoneStatus = phoneStatus; |
|||
} |
|||
|
|||
public String getEmail() { |
|||
return email; |
|||
} |
|||
|
|||
public void setEmail(String email) { |
|||
this.email = email; |
|||
} |
|||
|
|||
public Integer getEmailStatus() { |
|||
return emailStatus; |
|||
} |
|||
|
|||
public void setEmailStatus(Integer emailStatus) { |
|||
this.emailStatus = emailStatus; |
|||
} |
|||
|
|||
public String getAvatar() { |
|||
return avatar; |
|||
} |
|||
|
|||
public void setAvatar(String avatar) { |
|||
this.avatar = avatar; |
|||
} |
|||
|
|||
public String getGoogleToken() { |
|||
return googleToken; |
|||
} |
|||
|
|||
public void setGoogleToken(String googleToken) { |
|||
this.googleToken = googleToken; |
|||
} |
|||
|
|||
public Integer getGoogleStatus() { |
|||
return googleStatus; |
|||
} |
|||
|
|||
public void setGoogleStatus(Integer googleStatus) { |
|||
this.googleStatus = googleStatus; |
|||
} |
|||
|
|||
public Integer getSecondVerify() { |
|||
return secondVerify; |
|||
} |
|||
|
|||
public void setSecondVerify(Integer secondVerify) { |
|||
this.secondVerify = secondVerify; |
|||
} |
|||
|
|||
public String getPassword() { |
|||
return password; |
|||
} |
|||
|
|||
public void setPassword(String password) { |
|||
this.password = password; |
|||
} |
|||
|
|||
public String getPayword() { |
|||
return payword; |
|||
} |
|||
|
|||
public void setPayword(String payword) { |
|||
this.payword = payword; |
|||
} |
|||
|
|||
public String getInviteCode() { |
|||
return inviteCode; |
|||
} |
|||
|
|||
public void setInviteCode(String inviteCode) { |
|||
this.inviteCode = inviteCode; |
|||
} |
|||
|
|||
public String getPurchaseCode() { |
|||
return purchaseCode; |
|||
} |
|||
|
|||
public void setPurchaseCode(String purchaseCode) { |
|||
this.purchaseCode = purchaseCode; |
|||
} |
|||
|
|||
public Integer getUserGrade() { |
|||
return userGrade; |
|||
} |
|||
|
|||
public void setUserGrade(Integer userGrade) { |
|||
this.userGrade = userGrade; |
|||
} |
|||
|
|||
public Integer getUserIdentity() { |
|||
return userIdentity; |
|||
} |
|||
|
|||
public void setUserIdentity(Integer userIdentity) { |
|||
this.userIdentity = userIdentity; |
|||
} |
|||
|
|||
public Integer getIsAgency() { |
|||
return isAgency; |
|||
} |
|||
|
|||
public void setIsAgency(Integer isAgency) { |
|||
this.isAgency = isAgency; |
|||
} |
|||
|
|||
public Integer getIsPalce() { |
|||
return isPalce; |
|||
} |
|||
|
|||
public void setIsPalce(Integer isPalce) { |
|||
this.isPalce = isPalce; |
|||
} |
|||
|
|||
public Integer getUserAuthLevel() { |
|||
return userAuthLevel; |
|||
} |
|||
|
|||
public void setUserAuthLevel(Integer userAuthLevel) { |
|||
this.userAuthLevel = userAuthLevel; |
|||
} |
|||
|
|||
public Integer getIsSystem() { |
|||
return isSystem; |
|||
} |
|||
|
|||
public void setIsSystem(Integer isSystem) { |
|||
this.isSystem = isSystem; |
|||
} |
|||
|
|||
public Integer getContractDeal() { |
|||
return contractDeal; |
|||
} |
|||
|
|||
public void setContractDeal(Integer contractDeal) { |
|||
this.contractDeal = contractDeal; |
|||
} |
|||
|
|||
public String getLoginCode() { |
|||
return loginCode; |
|||
} |
|||
|
|||
public void setLoginCode(String loginCode) { |
|||
this.loginCode = loginCode; |
|||
} |
|||
|
|||
public Integer getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(Integer status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getTradeStatus() { |
|||
return tradeStatus; |
|||
} |
|||
|
|||
public void setTradeStatus(Integer tradeStatus) { |
|||
this.tradeStatus = tradeStatus; |
|||
} |
|||
|
|||
public Integer getTradeVerify() { |
|||
return tradeVerify; |
|||
} |
|||
|
|||
public void setTradeVerify(Integer tradeVerify) { |
|||
this.tradeVerify = tradeVerify; |
|||
} |
|||
|
|||
public Integer getContractAnomaly() { |
|||
return contractAnomaly; |
|||
} |
|||
|
|||
public void setContractAnomaly(Integer contractAnomaly) { |
|||
this.contractAnomaly = contractAnomaly; |
|||
} |
|||
|
|||
public String getRegIp() { |
|||
return regIp; |
|||
} |
|||
|
|||
public void setRegIp(String regIp) { |
|||
this.regIp = regIp; |
|||
} |
|||
|
|||
public Date getLastLoginTime() { |
|||
return lastLoginTime; |
|||
} |
|||
|
|||
public void setLastLoginTime(Date lastLoginTime) { |
|||
this.lastLoginTime = lastLoginTime; |
|||
} |
|||
|
|||
public String getLastLoginIp() { |
|||
return lastLoginIp; |
|||
} |
|||
|
|||
public void setLastLoginIp(String lastLoginIp) { |
|||
this.lastLoginIp = lastLoginIp; |
|||
} |
|||
|
|||
public Date getCreatedAt() { |
|||
return createdAt; |
|||
} |
|||
|
|||
public void setCreatedAt(Date createdAt) { |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
public Date getUpdatedAt() { |
|||
return updatedAt; |
|||
} |
|||
|
|||
public void setUpdatedAt(Date updatedAt) { |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
package bc.mm.mis.dao; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface CountryDao extends JpaRepository<Country,Integer> { |
|||
// find all
|
|||
List<Country> findAll(); |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package bc.mm.mis.service; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface CountryService { |
|||
List<Country> findAll(); |
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
package bc.mm.mis.service.impl; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import bc.mm.mis.dao.CountryDao; |
|||
import bc.mm.mis.service.CountryService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class CountryServiceImpl implements CountryService { |
|||
@Autowired |
|||
CountryDao countryDao; |
|||
|
|||
@Override |
|||
public List<Country> findAll() { |
|||
return countryDao.findAll(); |
|||
} |
|||
} |
|||
@ -1,81 +0,0 @@ |
|||
package bc.mm.mis.utils; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
public class AjaxResult { |
|||
/** |
|||
* 接口返回数据 |
|||
* @param msg |
|||
* @param dataList |
|||
* @return |
|||
*/ |
|||
public static JSONObject success(String msg, List dataList){ |
|||
JSONObject result = new JSONObject(); |
|||
result.put("status",200); |
|||
result.put("msg",msg); |
|||
result.put("data",dataList); |
|||
return result; |
|||
} |
|||
|
|||
public static JSONObject success(String token){ |
|||
JSONObject result= new JSONObject(); |
|||
result.put("code",200); |
|||
result.put("token",token); |
|||
return result; |
|||
} |
|||
|
|||
public static JSONObject success(String msg, Map map){ |
|||
JSONObject result = new JSONObject(); |
|||
result.put("code",200); |
|||
result.put("msg",msg); |
|||
result.put("data",map); |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 异常信息 |
|||
* @param msg |
|||
* @return |
|||
*/ |
|||
public static JSONObject error(String msg){ |
|||
JSONObject result = new JSONObject(); |
|||
result.put("code",500); |
|||
result.put("msg",msg); |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 格式异常返回 |
|||
* @param code |
|||
* @param msg |
|||
* @return |
|||
*/ |
|||
public static JSONObject exception(int code, String msg){ |
|||
Map rmap = new HashMap(); |
|||
rmap.put("message",msg); |
|||
rmap.put("time",System.currentTimeMillis()/1000l); |
|||
|
|||
//
|
|||
JSONObject rjson = new JSONObject(); |
|||
rjson.put("status",code); |
|||
rjson.put("message",msg); |
|||
// rjson.put("data",rmap);
|
|||
|
|||
return rjson; |
|||
} |
|||
|
|||
public static JSONObject error500(String msg){ |
|||
Map rmap = new HashMap(); |
|||
rmap.put("message",msg); |
|||
//
|
|||
JSONObject rjson = new JSONObject(); |
|||
rjson.put("data",rmap); |
|||
rjson.put("status",500); |
|||
return rjson; |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package bc.mm.mis.service; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import org.junit.jupiter.api.Test; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
|
|||
import java.util.List; |
|||
|
|||
import static org.junit.jupiter.api.Assertions.*; |
|||
|
|||
@SpringBootTest |
|||
class CountryServiceTest { |
|||
@Autowired |
|||
private CountryService countryService; |
|||
|
|||
@Test |
|||
void findAll() { |
|||
} |
|||
|
|||
@Test |
|||
void pagers() { |
|||
// List<Country> countryList = countryService
|
|||
// String aa = countryService.
|
|||
} |
|||
} |
|||
@ -1,11 +1,22 @@ |
|||
package bc.mm.mis.service; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public interface CountryService { |
|||
List<Country> findAll(); |
|||
//带分页
|
|||
List<Country> pagers(int page,int size); |
|||
|
|||
/** |
|||
* 分页显示数据列表 |
|||
* @param page |
|||
* @param size |
|||
* @return |
|||
*/ |
|||
List<Country> findAllByPage(int page,int size); |
|||
|
|||
String atest(); |
|||
} |
|||
|
|||
Loading…
Reference in new issue