|
1 | 1 | package org.rest.sec.client; |
2 | 2 |
|
| 3 | +import org.rest.common.client.template.CommonPaths; |
3 | 4 | import org.rest.sec.web.common.URIMappingConstants; |
4 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | +import org.springframework.beans.factory.annotation.Value; |
5 | 7 | import org.springframework.context.annotation.Profile; |
6 | 8 | import org.springframework.stereotype.Component; |
7 | 9 |
|
8 | 10 | @Component |
9 | 11 | @Profile("client") |
10 | 12 | public final class SecBusinessPaths { |
11 | 13 |
|
| 14 | + @Value("${http.sec.path}") |
| 15 | + private String secPaths; |
| 16 | + |
12 | 17 | @Autowired |
13 | | - SecPaths secPaths; |
| 18 | + private CommonPaths commonPaths; |
14 | 19 |
|
15 | 20 | // API |
16 | 21 |
|
| 22 | + public final String getContext() { |
| 23 | + return commonPaths.getServerRoot() + secPaths; |
| 24 | + } |
| 25 | + |
| 26 | + public final String getRootUri() { |
| 27 | + return getContext() + "/api/"; |
| 28 | + } |
| 29 | + |
17 | 30 | public final String getUserUri() { |
18 | | - return secPaths.getRootUri() + URIMappingConstants.USERS; |
| 31 | + return getRootUri() + URIMappingConstants.USERS; |
19 | 32 | } |
20 | 33 |
|
21 | 34 | public final String getPrivilegeUri() { |
22 | | - return secPaths.getRootUri() + URIMappingConstants.PRIVILEGES; |
| 35 | + return getRootUri() + URIMappingConstants.PRIVILEGES; |
23 | 36 | } |
24 | 37 |
|
25 | 38 | public final String getRoleUri() { |
26 | | - return secPaths.getRootUri() + URIMappingConstants.ROLES; |
| 39 | + return getRootUri() + URIMappingConstants.ROLES; |
27 | 40 | } |
28 | 41 |
|
29 | 42 | public final String getAuthenticationUri() { |
30 | | - return secPaths.getRootUri() + "authentication"; |
| 43 | + return getRootUri() + "authentication"; |
31 | 44 | } |
32 | 45 |
|
33 | 46 | public final String getLoginUri() { |
34 | | - return secPaths.getContext() + "/j_spring_security_check"; |
35 | | - } |
36 | | - |
37 | | - public final String getRootUri() { |
38 | | - return secPaths.getRootUri(); |
| 47 | + return getContext() + "/j_spring_security_check"; |
39 | 48 | } |
40 | 49 |
|
41 | 50 | } |
0 commit comments