summaryrefslogtreecommitdiffstats
path: root/portal-BE/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'portal-BE/src/main/java')
-rw-r--r--portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java4
-rw-r--r--portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java5
-rw-r--r--portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java6
3 files changed, 10 insertions, 5 deletions
diff --git a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java
index c73f7d57..b9e60334 100644
--- a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java
+++ b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java
@@ -83,7 +83,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.permitAll()
.and()
.logout()
- .permitAll();
+ .permitAll()
+ .and()
+ .httpBasic();
http.csrf().disable();
http.headers().frameOptions().disable();
diff --git a/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java b/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
index 2ea4ff24..97fe03da 100644
--- a/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
+++ b/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
@@ -54,6 +54,7 @@ import org.onap.portal.service.fn.FnUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@@ -102,8 +103,8 @@ public class LanguageController {
return new FnLanguage();
}
- @PostMapping(value = "/language")
- public PortalRestResponse<String> saveLanguage(final Principal principal, final FnLanguage fnLanguage){
+ @PostMapping(value = "/language", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
+ public PortalRestResponse<String> saveLanguage(final Principal principal, @RequestBody final FnLanguage fnLanguage){
PortalRestResponse<String> response = new PortalRestResponse<>();
try {
response.setMessage("SUCCESS");
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
index 09cb5a6e..996929e7 100644
--- a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
+++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
@@ -40,6 +40,7 @@
package org.onap.portal.domain.db.fn;
+import com.fasterxml.jackson.annotation.JsonInclude;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -72,6 +73,7 @@ CREATE TABLE `fn_language` (
@Getter
@Setter
@Entity
+@JsonInclude()
@SequenceGenerator(name="seq", initialValue=3, allocationSize=100)
public class FnLanguage {
@@ -82,12 +84,12 @@ public class FnLanguage {
private Long languageId;
@Column(name = "language_name", length = 100, nullable = false)
@Size(max = 100)
- @NotNull
+ @NotNull(message = "languageName must not be null")
@SafeHtml
private String languageName;
@Column(name = "language_alias", length = 100, nullable = false)
@Size(max = 100)
- @NotNull
+ @NotNull(message = "languageAlias must not be null")
@SafeHtml
private String languageAlias;