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

commit

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