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
10 changed files
with
204 additions
and
33 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
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
37 changes: 37 additions & 0 deletions
37
...al/src/main/java/com/ctrip/framework/apollo/portal/controller/OrganizationController.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,37 @@ | ||
package com.ctrip.framework.apollo.portal.controller; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.reflect.TypeToken; | ||
|
||
import com.ctrip.framework.apollo.portal.entity.po.ServerConfig; | ||
import com.ctrip.framework.apollo.portal.entity.vo.Organization; | ||
import com.ctrip.framework.apollo.portal.repository.ServerConfigRepository; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Jason Song([email protected]) | ||
*/ | ||
@RestController | ||
@RequestMapping("/organizations") | ||
public class OrganizationController { | ||
@Autowired | ||
private ServerConfigRepository serverConfigRepository; | ||
|
||
@Autowired | ||
private Gson gson; | ||
|
||
private Type responseType = new TypeToken<List<Organization>>() { | ||
}.getType(); | ||
|
||
@RequestMapping | ||
public List<Organization> loadOrganization() { | ||
ServerConfig config = serverConfigRepository.findByKey("organizations"); | ||
return gson.fromJson(config.getValue(), responseType); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/vo/Organization.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,25 @@ | ||
package com.ctrip.framework.apollo.portal.entity.vo; | ||
|
||
/** | ||
* @author Jason Song([email protected]) | ||
*/ | ||
public class Organization { | ||
private String orgId; | ||
private String orgName; | ||
|
||
public String getOrgId() { | ||
return orgId; | ||
} | ||
|
||
public void setOrgId(String orgId) { | ||
this.orgId = orgId; | ||
} | ||
|
||
public String getOrgName() { | ||
return orgName; | ||
} | ||
|
||
public void setOrgName(String orgName) { | ||
this.orgName = orgName; | ||
} | ||
} |
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
31 changes: 29 additions & 2 deletions
31
apollo-portal/src/main/resources/static/scripts/controller/CreateAppController.js
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
Oops, something went wrong.