提交 a7b29c9e authored 作者: Whispa's avatar Whispa

commit

上级 d5eaa82a
......@@ -255,11 +255,12 @@ public class AuthController extends Controller {
Network top = networkRepository.findTopByOrderByIdDesc();
if( top != null ) {
if (!networkRepository.existsByUserInfo_CodeAndNetworkInfo_UserId(top.getNetworkId(), user.getUserId())){
if( top != null && !user.invited() ) {
if (!networkRepository.existsByUserInfo_UserIdAndNetworkInfo_UserId(top.getNetworkId(), user.getUserId())){
Network network = new Network();
network.setUserInfo(top.getNetworkInfo());
network.setNetworkInfo(user);
//network.setId(uid());
networkRepository.save(network);
user.setInvitation(1);
}
......
......@@ -10,7 +10,6 @@ import java.util.Date;
@MappedSuperclass
abstract class Model {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@JsonProperty
protected String id;
......@@ -18,13 +17,17 @@ abstract class Model {
Date createDate = new Date();
Model(){
this.id = IdUtil.createIdbyUUID();
setId(IdUtil.createIdbyUUID());
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@JsonIgnore
public String createdBy;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论