summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java25
-rw-r--r--ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml6
3 files changed, 17 insertions, 16 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
index f3a79285..383e4720 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
@@ -32,7 +32,7 @@ public class LanguageController {
@Autowired
private LanguageService languageService;
- @RequestMapping(value = "/language",method = RequestMethod.GET)
+ @RequestMapping(value = "/language",method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public JSONObject getLanguageList() {
return languageService.getLanguages();
}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java
index b0d8c424..13d7097b 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageServiceImpl.java
@@ -55,21 +55,16 @@ public class LanguageServiceImpl implements LanguageService {
JSONObject result = new com.alibaba.fastjson.JSONObject();
HashMap params = new HashMap();
params.put("login_id",loginId);
+
+ EPUser user = (EPUser) dataAccessService.executeNamedQuery("getEPUserByLoginId",params,new HashMap()).get(0);
+ int languageId = user.getLanguageId();
+ HashMap<String,String> params1 = new HashMap();
+ params1.put("language_id", String.valueOf(languageId));
+ Language language = (Language) dataAccessService.executeNamedQuery("queryLanguageByLanguageId",params1,new HashMap());
+ result.put("languageId",languageId);
+ result.put("languageName",language.getLanguageName());
+ result.put("languageAlias",language.getLanguageAlias());
- List<EPUser> list = null;
- list = dataAccessService.executeNamedQuery("getEPUserByLoginId",params,new HashMap());
- for (EPUser user : list) {
- int languageId = user.getLanguageId();
- HashMap<String,String> params1 = new HashMap();
- params1.put("language_id", String.valueOf(languageId));
- List<Language> languages = dataAccessService.executeNamedQuery("queryLanguageByLanguageId",params1,new HashMap());
- for (Language language : languages) {
- result.put("languageId",languageId);
- result.put("languageName",language.getLanguageName());
- result.put("languageAlias",language.getLanguageAlias());
- }
- return result;
- }
- return null;
+ return result;
}
}
diff --git a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
index 4e8943ce..e38b398e 100644
--- a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
+++ b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
@@ -2548,4 +2548,10 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
]]>
</sql-query>
+
+ <sql-query name="updateFnUser">
+ <![CDATA[
+ UPDATE fn_user fu SET fu.language_id=:language_id WHERE fu.login_id=:login_id
+ ]]>
+ </sql-query>
</hibernate-mapping>