forked from apolloconfig/apollo
-
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
Showing
28 changed files
with
916 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ protected void refresh() { | |
this.source.put(key, value); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
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
2 changes: 1 addition & 1 deletion
2
apollo-common/src/main/java/com/ctrip/framework/apollo/common/config/RefreshableConfig.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
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
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
20 changes: 20 additions & 0 deletions
20
...o-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SignInController.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,20 @@ | ||
package com.ctrip.framework.apollo.portal.controller; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
/** | ||
* @author lepdou 2017-08-30 | ||
*/ | ||
@Controller | ||
public class SignInController { | ||
|
||
@RequestMapping(value = "/signin", method = RequestMethod.GET) | ||
public String login(@RequestParam(value = "error", required = false) String error, | ||
@RequestParam(value = "logout", required = false) String logout) { | ||
return "login.html"; | ||
} | ||
|
||
} |
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
9 changes: 9 additions & 0 deletions
9
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/bo/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
68 changes: 68 additions & 0 deletions
68
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserPO.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,68 @@ | ||
package com.ctrip.framework.apollo.portal.entity.po; | ||
|
||
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
/** | ||
* @author lepdou 2017-04-08 | ||
*/ | ||
@Entity | ||
@Table(name = "users") | ||
public class UserPO { | ||
|
||
@Id | ||
@GeneratedValue | ||
@Column(name = "Id") | ||
private long id; | ||
@Column(name = "username", nullable = false) | ||
private String username; | ||
@Column(name = "password", nullable = false) | ||
private String password; | ||
@Column(name = "enabled", nullable = false) | ||
private int enabled; | ||
|
||
public long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public int getEnabled() { | ||
return enabled; | ||
} | ||
|
||
public void setEnabled(int enabled) { | ||
this.enabled = enabled; | ||
} | ||
|
||
public UserInfo toUserInfo() { | ||
UserInfo userInfo = new UserInfo(); | ||
userInfo.setName(this.getUsername()); | ||
userInfo.setUserId(this.getUsername()); | ||
userInfo.setEmail("[email protected]"); | ||
return userInfo; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/UserRepository.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.ctrip.framework.apollo.portal.repository; | ||
|
||
import com.ctrip.framework.apollo.portal.entity.po.UserPO; | ||
|
||
import org.springframework.data.repository.PagingAndSortingRepository; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author lepdou 2017-04-08 | ||
*/ | ||
public interface UserRepository extends PagingAndSortingRepository<UserPO, Long> { | ||
|
||
List<UserPO> findByUsernameLike(String username); | ||
|
||
UserPO findByUsername(String username); | ||
} |
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
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 |
---|---|---|
|
@@ -5,13 +5,8 @@ | |
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo; | ||
import com.ctrip.framework.apollo.portal.spi.UserService; | ||
|
||
import org.springframework.util.CollectionUtils; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Jason Song([email protected]) | ||
|
Oops, something went wrong.