diff --git a/chat-api/src/main/java/com/smartsense/api/constant/ContMessage.java b/chat-api/src/main/java/com/smartsense/api/constant/ContMessage.java index d9fbe45..fbf6fb2 100644 --- a/chat-api/src/main/java/com/smartsense/api/constant/ContMessage.java +++ b/chat-api/src/main/java/com/smartsense/api/constant/ContMessage.java @@ -30,5 +30,8 @@ public final class ContMessage { public static final String SOMETHING_WENT_WRONG = "something.went.wrong"; public static final String USER_CREATED = "user.created.successfully"; + public static final String EDC_CREATED = "edc.created.successfully"; + public static final String CHAT_CREATED = "chat.created.successfully"; public static final String VALIDATE_USER_CREATE_NAME_EXIST = "validate.user.create.name.exist"; + public static final String VALIDATE_EDC_CREATE_URL_EXIST = "validate.edc.create.url.exist"; } diff --git a/chat-api/src/main/java/com/smartsense/api/constant/ContURI.java b/chat-api/src/main/java/com/smartsense/api/constant/ContURI.java index d2c3430..8723984 100644 --- a/chat-api/src/main/java/com/smartsense/api/constant/ContURI.java +++ b/chat-api/src/main/java/com/smartsense/api/constant/ContURI.java @@ -27,11 +27,21 @@ */ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class ContURI { - //Test Resource + //User Management public static final String USER = "/common/user"; public static final String USER_WITH_ID = "/common/user/{userId}"; public static final String USER_FILTER = "/common/user/filter"; + // EDC Register + public static final String EDC_CREATE = "common/edc/create"; + public static final String EDC_UPDATE = "common/edc/update"; + public static final String EDC_FILTER = "common/edc/filter"; + public static final String GET_EDC = "common/edc/{edcId}"; + public static final String GET_EDC_USER = "/common/user/edc/{userId}"; + + // Chat + public static final String CHAT_REGISTER = "common/chat"; + //Context public static final String CONTEXT_AUTHENTICATED_ALL = "/common/**"; public static final String CONTEXT_AUTHENTICATED_WITH_NO_FILTER_ALL = "/common2/**"; diff --git a/chat-api/src/main/java/com/smartsense/api/model/request/ChatRequest.java b/chat-api/src/main/java/com/smartsense/api/model/request/ChatRequest.java new file mode 100644 index 0000000..4b81d66 --- /dev/null +++ b/chat-api/src/main/java/com/smartsense/api/model/request/ChatRequest.java @@ -0,0 +1,9 @@ +package com.smartsense.api.model.request; + +import java.util.UUID; + +public record ChatRequest(UUID senderId, + UUID receiverId, + String message, + String messageType) { +} diff --git a/chat-api/src/main/java/com/smartsense/api/model/request/EDCRegisterRequest.java b/chat-api/src/main/java/com/smartsense/api/model/request/EDCRegisterRequest.java new file mode 100644 index 0000000..6822946 --- /dev/null +++ b/chat-api/src/main/java/com/smartsense/api/model/request/EDCRegisterRequest.java @@ -0,0 +1,6 @@ +package com.smartsense.api.model.request; + +import java.util.UUID; + +public record EDCRegisterRequest(String edcUrl, UUID userId) { +} diff --git a/chat-api/src/main/java/com/smartsense/api/model/request/EDCUpdateRequest.java b/chat-api/src/main/java/com/smartsense/api/model/request/EDCUpdateRequest.java new file mode 100644 index 0000000..68cb7c3 --- /dev/null +++ b/chat-api/src/main/java/com/smartsense/api/model/request/EDCUpdateRequest.java @@ -0,0 +1,6 @@ +package com.smartsense.api.model.request; + +import java.util.UUID; + +public record EDCUpdateRequest(UUID edcId, EDCRegisterRequest request) { +} diff --git a/chat-api/src/main/java/com/smartsense/api/model/request/UserRequest.java b/chat-api/src/main/java/com/smartsense/api/model/request/UserRequest.java index 952b237..e37ed21 100644 --- a/chat-api/src/main/java/com/smartsense/api/model/request/UserRequest.java +++ b/chat-api/src/main/java/com/smartsense/api/model/request/UserRequest.java @@ -15,22 +15,18 @@ */ package com.smartsense.api.model.request; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotEmpty; import com.smartsense.api.model.BaseModel; +import jakarta.validation.constraints.NotEmpty; + /** - * User request + * Create a new {@code UserRequest} with the given first name, last name, and email. * - * @param name name of user - * @param age age of user - * @param city city of user - * @param country country of city - * @author Sunil Kanzar - * @since 14th feb 2024 + * @param firstName the user's first name (must not be empty) + * @param lastName the user's last name (must not be empty) + * @param email the user's email (must not be empty) */ -public record UserRequest(@NotEmpty(message = "{please.enter.user.name}") String name, - @Min(value = 18, message = "{you.are.under.age}") Integer age, - @NotEmpty(message = "{please.enter.city}") String city, - @NotEmpty(message = "{please.enter.county}") String country) implements BaseModel { +public record UserRequest(@NotEmpty(message = "{please.enter.user.first.name}") String firstName, + String lastName, + @NotEmpty(message = "{please.enter.email}") String email) implements BaseModel { } diff --git a/chat-api/src/main/java/com/smartsense/api/model/response/ChatResponse.java b/chat-api/src/main/java/com/smartsense/api/model/response/ChatResponse.java new file mode 100644 index 0000000..36b2b7b --- /dev/null +++ b/chat-api/src/main/java/com/smartsense/api/model/response/ChatResponse.java @@ -0,0 +1,11 @@ +package com.smartsense.api.model.response; + +import java.util.UUID; + +public record ChatResponse(String id, + UUID senderId, + UUID receiverId, + String message, + String messageType, + String createdAt) { +} diff --git a/chat-api/src/main/java/com/smartsense/api/model/response/EDCRegisterResponse.java b/chat-api/src/main/java/com/smartsense/api/model/response/EDCRegisterResponse.java new file mode 100644 index 0000000..f9aa1b2 --- /dev/null +++ b/chat-api/src/main/java/com/smartsense/api/model/response/EDCRegisterResponse.java @@ -0,0 +1,10 @@ +package com.smartsense.api.model.response; + +import java.util.UUID; + +public record EDCRegisterResponse( + UUID id, + String edcUrl, + UserResponse userId +) { +} diff --git a/chat-api/src/main/java/com/smartsense/api/model/response/UserResponse.java b/chat-api/src/main/java/com/smartsense/api/model/response/UserResponse.java index 1e5c533..88b5d20 100644 --- a/chat-api/src/main/java/com/smartsense/api/model/response/UserResponse.java +++ b/chat-api/src/main/java/com/smartsense/api/model/response/UserResponse.java @@ -18,9 +18,10 @@ import com.smartsense.api.model.BaseModel; -public record UserResponse(String id, - String name, - Integer age, - String city, - String country) implements BaseModel { +import java.util.UUID; + +public record UserResponse(UUID id, + String firstName, + String lastName, + String email) implements BaseModel { } diff --git a/chat-api/src/main/java/com/smartsense/api/model/response/UsersEDCResponse.java b/chat-api/src/main/java/com/smartsense/api/model/response/UsersEDCResponse.java new file mode 100644 index 0000000..708a20c --- /dev/null +++ b/chat-api/src/main/java/com/smartsense/api/model/response/UsersEDCResponse.java @@ -0,0 +1,8 @@ +package com.smartsense.api.model.response; + +import java.util.List; +import java.util.UUID; + +public record UsersEDCResponse(UUID userId, + List edcUrl) { +} diff --git a/chat-dao/build.gradle b/chat-dao/build.gradle index f9f40f4..2b6216f 100644 --- a/chat-dao/build.gradle +++ b/chat-dao/build.gradle @@ -5,8 +5,8 @@ plugins { dependencies { - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' + api 'org.springframework.boot:spring-boot-starter-data-jpa' + api 'org.springframework.boot:spring-boot-starter-data-mongodb' api project(":chat-api") } diff --git a/chat-dao/src/main/java/com/smartsense/dao/entity/ChatMaster.java b/chat-dao/src/main/java/com/smartsense/dao/entity/ChatMaster.java new file mode 100644 index 0000000..73ae3fb --- /dev/null +++ b/chat-dao/src/main/java/com/smartsense/dao/entity/ChatMaster.java @@ -0,0 +1,27 @@ +package com.smartsense.dao.entity; + +import jakarta.persistence.Id; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.util.UUID; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Document(collection = "chat_master") +@Builder +public class ChatMaster extends BaseAuditEntity { + + @Id + private String id; + private UUID senderId; + private UUID receiverId; + private String message; + private String messageType; +} diff --git a/chat-dao/src/main/java/com/smartsense/dao/entity/EDCRegisterMaster.java b/chat-dao/src/main/java/com/smartsense/dao/entity/EDCRegisterMaster.java new file mode 100644 index 0000000..7db452d --- /dev/null +++ b/chat-dao/src/main/java/com/smartsense/dao/entity/EDCRegisterMaster.java @@ -0,0 +1,40 @@ +package com.smartsense.dao.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.UUID; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@Entity +@Table(name = "edc_register_master") +public class EDCRegisterMaster extends BaseAuditEntity { + + @Id + @GeneratedValue(strategy = GenerationType.UUID) + @Column(name = "id", nullable = false, updatable = false, insertable = false) + private UUID id = UUID.randomUUID(); + + @ManyToOne + @JoinColumn(name = "user_id_id", nullable = false) + private UserMaster userId; + + private String edcUrl; + + +} diff --git a/chat-dao/src/main/java/com/smartsense/dao/entity/UserMaster.java b/chat-dao/src/main/java/com/smartsense/dao/entity/UserMaster.java index a05ec31..fe881d5 100644 --- a/chat-dao/src/main/java/com/smartsense/dao/entity/UserMaster.java +++ b/chat-dao/src/main/java/com/smartsense/dao/entity/UserMaster.java @@ -18,6 +18,7 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; import lombok.AllArgsConstructor; @@ -25,7 +26,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.hibernate.annotations.GenericGenerator; + +import java.util.UUID; /** * UserMaster Represent user @@ -43,19 +45,20 @@ public class UserMaster extends BaseAuditEntity { @Id - @GeneratedValue(generator = "uuid2") - @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator") - private String id; + @GeneratedValue(strategy = GenerationType.UUID) + @Column(name = "id", nullable = false, updatable = false, insertable = false) + private UUID id = UUID.randomUUID(); - @Column(name = "name") - private String name; + @Column(name = "first_name") + private String firstName; - @Column(name = "age") - private Integer age; + @Column(name = "last_name") + private String lastName; - @Column(name = "city") - private String city; + @Column(name = "email") + private String email; - @Column(name = "country") - private String country; + public UserMaster(String id) { + this.id = UUID.fromString(id); + } } diff --git a/chat-dao/src/main/java/com/smartsense/dao/repository/ChatMasterRepository.java b/chat-dao/src/main/java/com/smartsense/dao/repository/ChatMasterRepository.java new file mode 100644 index 0000000..84425fe --- /dev/null +++ b/chat-dao/src/main/java/com/smartsense/dao/repository/ChatMasterRepository.java @@ -0,0 +1,10 @@ +package com.smartsense.dao.repository; + +import com.smartsense.dao.entity.ChatMaster; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface ChatMasterRepository extends MongoRepository { + +} diff --git a/chat-dao/src/main/java/com/smartsense/dao/repository/EDCRegisterMasterRepository.java b/chat-dao/src/main/java/com/smartsense/dao/repository/EDCRegisterMasterRepository.java new file mode 100644 index 0000000..a19ba75 --- /dev/null +++ b/chat-dao/src/main/java/com/smartsense/dao/repository/EDCRegisterMasterRepository.java @@ -0,0 +1,20 @@ +package com.smartsense.dao.repository; + + +import com.smartsense.dao.entity.EDCRegisterMaster; +import com.smartsensesolutions.commons.dao.base.BaseRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.UUID; + +@Repository +public interface EDCRegisterMasterRepository extends BaseRepository { + + boolean existsByEdcUrl(String edcUrl); + + @Query("select e from EDCRegisterMaster e where e.userId.id = ?1") + List findByUserId(UUID id); + +} diff --git a/chat-dao/src/main/java/com/smartsense/dao/repository/UserMasterRepository.java b/chat-dao/src/main/java/com/smartsense/dao/repository/UserMasterRepository.java index 8ec41ae..4aeadef 100644 --- a/chat-dao/src/main/java/com/smartsense/dao/repository/UserMasterRepository.java +++ b/chat-dao/src/main/java/com/smartsense/dao/repository/UserMasterRepository.java @@ -15,9 +15,11 @@ */ package com.smartsense.dao.repository; +import com.smartsense.dao.entity.UserMaster; import com.smartsensesolutions.commons.dao.base.BaseRepository; import org.springframework.stereotype.Repository; -import com.smartsense.dao.entity.UserMaster; + +import java.util.UUID; /** * Database operation related to {@link UserMaster} @@ -26,6 +28,7 @@ * @since 14th feb 2024 */ @Repository -public interface UserMasterRepository extends BaseRepository { - boolean existsByName(String name); +public interface UserMasterRepository extends BaseRepository { + + boolean existsByFirstName(String name); } diff --git a/chat-service-impl/build.gradle b/chat-service-impl/build.gradle index a7ee97c..784c598 100644 --- a/chat-service-impl/build.gradle +++ b/chat-service-impl/build.gradle @@ -7,7 +7,6 @@ plugins { dependencies { api project(":chat-dao") api project(":chat-service") - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}" implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' diff --git a/chat-service-impl/src/main/java/com/smartsense/service/entity/EDCService.java b/chat-service-impl/src/main/java/com/smartsense/service/entity/EDCService.java new file mode 100644 index 0000000..993d0ac --- /dev/null +++ b/chat-service-impl/src/main/java/com/smartsense/service/entity/EDCService.java @@ -0,0 +1,46 @@ +package com.smartsense.service.entity; + +import com.smartsense.api.constant.ContMessage; +import com.smartsense.api.model.request.EDCRegisterRequest; +import com.smartsense.api.model.response.UsersEDCResponse; +import com.smartsense.api.utils.Validate; +import com.smartsense.dao.entity.EDCRegisterMaster; +import com.smartsense.dao.entity.UserMaster; +import com.smartsense.dao.repository.EDCRegisterMasterRepository; +import com.smartsensesolutions.commons.dao.base.BaseRepository; +import com.smartsensesolutions.commons.dao.specification.SpecificationUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.UUID; + +@Service +public class EDCService extends BaseEntityService { + + @Autowired + private EDCRegisterMasterRepository edcRegisterMasterRepository; + @Autowired + private SpecificationUtil specificationUtil; + + public EDCRegisterMaster createEDC(EDCRegisterRequest request, UserMaster user) { + Validate.isTrue(edcRegisterMasterRepository.existsByEdcUrl(request.edcUrl())).launch(ContMessage.VALIDATE_EDC_CREATE_URL_EXIST); + EDCRegisterMaster edcRegisterMaster = EDCRegisterMaster.builder() + .edcUrl(request.edcUrl()) + .userId(user) + .build(); + return create(edcRegisterMaster); + } + + + @Override + protected BaseRepository getRepository() { + return edcRegisterMasterRepository; + } + + public UsersEDCResponse getEDCByUserid(UUID userId) { + List edcList = edcRegisterMasterRepository.findByUserId(userId); + List edcUrls = edcList.stream().map(EDCRegisterMaster::getEdcUrl).toList(); + return new UsersEDCResponse(userId, edcUrls); + } +} diff --git a/chat-service-impl/src/main/java/com/smartsense/service/entity/UserMasterService.java b/chat-service-impl/src/main/java/com/smartsense/service/entity/UserMasterService.java index d98e1b6..4f916f5 100644 --- a/chat-service-impl/src/main/java/com/smartsense/service/entity/UserMasterService.java +++ b/chat-service-impl/src/main/java/com/smartsense/service/entity/UserMasterService.java @@ -15,15 +15,19 @@ */ package com.smartsense.service.entity; -import com.smartsensesolutions.commons.dao.base.BaseRepository; -import com.smartsensesolutions.commons.dao.specification.SpecificationUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; import com.smartsense.api.constant.ContMessage; import com.smartsense.api.model.request.UserRequest; import com.smartsense.api.utils.Validate; import com.smartsense.dao.entity.UserMaster; import com.smartsense.dao.repository.UserMasterRepository; +import com.smartsensesolutions.commons.dao.base.BaseRepository; +import com.smartsensesolutions.commons.dao.specification.SpecificationUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Objects; +import java.util.UUID; /** * User master entity Service @@ -33,7 +37,8 @@ */ @Service -public class UserMasterService extends BaseEntityService { +@Slf4j +public class UserMasterService extends BaseEntityService { @Autowired private UserMasterRepository userMasterRepository; @@ -42,13 +47,28 @@ public class UserMasterService extends BaseEntityService { private SpecificationUtil specificationUtil; public UserMaster createUser(UserRequest userRequest) { - Validate.isTrue(userMasterRepository.existsByName(userRequest.name())).launch(ContMessage.VALIDATE_USER_CREATE_NAME_EXIST); + Validate.isTrue(userMasterRepository.existsByFirstName(userRequest.firstName())).launch(ContMessage.VALIDATE_USER_CREATE_NAME_EXIST); return create(toType(userRequest, UserMaster.class)); } @Override - protected BaseRepository getRepository() { + protected BaseRepository getRepository() { return userMasterRepository; } + public UserMaster getUser(UUID userId) { + UserMaster userMaster = userMasterRepository.findById(userId).orElse(null); + Validate.isTrue(Objects.isNull(userMaster)).launch("User not present for given userId: " + userId); + return userMaster; + } + + // public UserMaster getUser(EDCRegisterRequest request) { + // UserMaster referenceById = getRepository().getReferenceById(request.userId()); + // Validate.isTrue(referenceById!= null).launch(ContMessage.VALIDATE_USER_NOT_FOUND); + // UserMaster userMaster = userMasterRepository.findById(request.userId()).get(); + // if (userMaster == null) { + // log.error("User not found for given userId: {}", request.userId()); + // throw new IllegalArgumentException("User not found"); + // } + // } } diff --git a/chat-service-impl/src/main/java/com/smartsense/service/impl/ChatServiceImpl.java b/chat-service-impl/src/main/java/com/smartsense/service/impl/ChatServiceImpl.java new file mode 100644 index 0000000..daaf004 --- /dev/null +++ b/chat-service-impl/src/main/java/com/smartsense/service/impl/ChatServiceImpl.java @@ -0,0 +1,37 @@ +package com.smartsense.service.impl; + +import com.smartsense.api.model.request.ChatRequest; +import com.smartsense.api.model.response.ChatResponse; +import com.smartsense.api.utils.Validate; +import com.smartsense.dao.entity.ChatMaster; +import com.smartsense.dao.repository.ChatMasterRepository; +import com.smartsense.service.ChatService; +import com.smartsense.service.entity.BaseService; +import com.smartsense.service.entity.UserMasterService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@Slf4j +@RequiredArgsConstructor +public class ChatServiceImpl extends BaseService implements ChatService { + + private final ChatMasterRepository chatMasterRepository; + private final UserMasterService userMasterService; + + @Override + public ChatResponse createChat(ChatRequest request) { + Validate.isTrue(userMasterService.get(List.of(request.senderId(), request.receiverId())).size() != 2).launch("Sender or Receiver is not present"); + ChatMaster chatMaster = ChatMaster.builder() + .senderId(request.senderId()) + .receiverId(request.receiverId()) + .message(request.message()) + .messageType(request.messageType()) + .build(); + + return toType(chatMasterRepository.save(chatMaster), ChatResponse.class); + } +} diff --git a/chat-service-impl/src/main/java/com/smartsense/service/impl/EDCRegisterServiceImpl.java b/chat-service-impl/src/main/java/com/smartsense/service/impl/EDCRegisterServiceImpl.java new file mode 100644 index 0000000..2c9ac69 --- /dev/null +++ b/chat-service-impl/src/main/java/com/smartsense/service/impl/EDCRegisterServiceImpl.java @@ -0,0 +1,62 @@ +package com.smartsense.service.impl; + +import com.smartsense.api.model.request.EDCRegisterRequest; +import com.smartsense.api.model.request.EDCUpdateRequest; +import com.smartsense.api.model.response.EDCRegisterResponse; +import com.smartsense.api.model.response.PageResponse; +import com.smartsense.api.model.response.UsersEDCResponse; +import com.smartsense.api.utils.Validate; +import com.smartsense.dao.entity.EDCRegisterMaster; +import com.smartsense.dao.entity.UserMaster; +import com.smartsense.service.EDCRegisterService; +import com.smartsense.service.entity.BaseService; +import com.smartsense.service.entity.EDCService; +import com.smartsense.service.entity.UserMasterService; +import com.smartsensesolutions.commons.dao.filter.FilterRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.Page; +import org.springframework.stereotype.Service; + +import java.util.Objects; +import java.util.UUID; + +@Service +@Slf4j +@RequiredArgsConstructor +public class EDCRegisterServiceImpl extends BaseService implements EDCRegisterService { + + private final EDCService edcService; + private final UserMasterService userMasterService; + + @Override + public EDCRegisterResponse createEDCRegister(EDCRegisterRequest request) { + UserMaster userMaster = userMasterService.getUser(request.userId()); + return toType(edcService.createEDC(request, userMaster), EDCRegisterResponse.class); + } + + @Override + public EDCRegisterResponse updateEDCRegister(EDCUpdateRequest request) { + UserMaster user = userMasterService.getUser(request.request().userId()); + Validate.isTrue(Objects.isNull(getEDCById(request.edcId()))).launch("EDC not register for given edcId: " + request.edcId()); + return toType(edcService.createEDC(request.request(), user), EDCRegisterResponse.class); + } + + @Override + public EDCRegisterResponse getEDCById(UUID edcId) { + EDCRegisterMaster edcDetails = edcService.get(edcId); + Validate.isTrue(Objects.isNull(edcDetails)).launch("No EDC registered with EDC Id: " + edcId); + return toType(edcDetails, EDCRegisterResponse.class); + } + + @Override + public PageResponse filter(FilterRequest filterRequest) { + Page edcFilter = edcService.filter(filterRequest); + return toPageResponse(edcFilter, filterRequest, EDCRegisterResponse.class); + } + + @Override + public UsersEDCResponse getEDCUserById(UUID userId) { + return edcService.getEDCByUserid(userId); + } +} diff --git a/chat-service-impl/src/main/java/com/smartsense/service/impl/UserManagementServiceImpl.java b/chat-service-impl/src/main/java/com/smartsense/service/impl/UserManagementServiceImpl.java index 2c0a42d..092eb4a 100644 --- a/chat-service-impl/src/main/java/com/smartsense/service/impl/UserManagementServiceImpl.java +++ b/chat-service-impl/src/main/java/com/smartsense/service/impl/UserManagementServiceImpl.java @@ -15,11 +15,6 @@ */ package com.smartsense.service.impl; -import com.smartsensesolutions.commons.dao.filter.FilterRequest; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.Page; -import org.springframework.stereotype.Service; import com.smartsense.api.model.request.UserRequest; import com.smartsense.api.model.response.PageResponse; import com.smartsense.api.model.response.UserResponse; @@ -27,6 +22,13 @@ import com.smartsense.service.UserManagementService; import com.smartsense.service.entity.BaseService; import com.smartsense.service.entity.UserMasterService; +import com.smartsensesolutions.commons.dao.filter.FilterRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.Page; +import org.springframework.stereotype.Service; + +import java.util.UUID; /** * User management service Implementation @@ -42,7 +44,7 @@ public class UserManagementServiceImpl extends BaseService implements UserManage private final UserMasterService userMasterService; @Override - public UserResponse getUserById(String id) { + public UserResponse getUserById(UUID id) { return toType(userMasterService.get(id), UserResponse.class); } diff --git a/chat-service/src/main/java/com/smartsense/service/ChatService.java b/chat-service/src/main/java/com/smartsense/service/ChatService.java new file mode 100644 index 0000000..36bd890 --- /dev/null +++ b/chat-service/src/main/java/com/smartsense/service/ChatService.java @@ -0,0 +1,9 @@ +package com.smartsense.service; + +import com.smartsense.api.model.request.ChatRequest; +import com.smartsense.api.model.response.ChatResponse; + +public interface ChatService { + + ChatResponse createChat(ChatRequest request); +} diff --git a/chat-service/src/main/java/com/smartsense/service/EDCRegisterService.java b/chat-service/src/main/java/com/smartsense/service/EDCRegisterService.java new file mode 100644 index 0000000..cc1ff34 --- /dev/null +++ b/chat-service/src/main/java/com/smartsense/service/EDCRegisterService.java @@ -0,0 +1,23 @@ +package com.smartsense.service; + +import com.smartsense.api.model.request.EDCRegisterRequest; +import com.smartsense.api.model.request.EDCUpdateRequest; +import com.smartsense.api.model.response.EDCRegisterResponse; +import com.smartsense.api.model.response.PageResponse; +import com.smartsense.api.model.response.UsersEDCResponse; +import com.smartsensesolutions.commons.dao.filter.FilterRequest; + +import java.util.UUID; + +public interface EDCRegisterService { + + EDCRegisterResponse createEDCRegister(EDCRegisterRequest request); + + EDCRegisterResponse updateEDCRegister(EDCUpdateRequest request); + + EDCRegisterResponse getEDCById(UUID id); + + PageResponse filter(FilterRequest filterRequest); + + UsersEDCResponse getEDCUserById(UUID userId); +} diff --git a/chat-service/src/main/java/com/smartsense/service/UserManagementService.java b/chat-service/src/main/java/com/smartsense/service/UserManagementService.java index 9a7d387..b154a04 100644 --- a/chat-service/src/main/java/com/smartsense/service/UserManagementService.java +++ b/chat-service/src/main/java/com/smartsense/service/UserManagementService.java @@ -15,10 +15,12 @@ */ package com.smartsense.service; -import com.smartsensesolutions.commons.dao.filter.FilterRequest; import com.smartsense.api.model.request.UserRequest; import com.smartsense.api.model.response.PageResponse; import com.smartsense.api.model.response.UserResponse; +import com.smartsensesolutions.commons.dao.filter.FilterRequest; + +import java.util.UUID; /** * Abstract User management service @@ -27,7 +29,7 @@ * @since 14th feb 2024 */ public interface UserManagementService { - UserResponse getUserById(String id); + UserResponse getUserById(UUID id); UserResponse createUser(UserRequest userRequest); diff --git a/chat-web/src/main/java/com/smartsense/web/apidocs/ChatResourceApiDocs.java b/chat-web/src/main/java/com/smartsense/web/apidocs/ChatResourceApiDocs.java new file mode 100644 index 0000000..a91b268 --- /dev/null +++ b/chat-web/src/main/java/com/smartsense/web/apidocs/ChatResourceApiDocs.java @@ -0,0 +1,51 @@ +package com.smartsense.web.apidocs; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +public class ChatResourceApiDocs { + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @ApiResponses(value = { + @ApiResponse(responseCode = "400", description = "Invalid Sender OR Receiver", content = { + @Content(examples = { + @ExampleObject(name = "Invalid Sender OR Receiver", value = """ + { + "type": "about:blank", + "title": "BadDataException: Sender or Receiver is not present", + "status": 400, + "detail": "BadDataException: Sender or Receiver is not present", + "instance": "/api/app/common/chat", + "properties": { + "timestamp": 1732014474190 + } + } + """) + }) }), + @ApiResponse(responseCode = "200", description = "Chat Details", content = { + @Content(examples = { + @ExampleObject(name = "Chat details persist", value = """ + { + "message": "Chat saved successfully", + "body": { + "id": "673c70f3fa0440590274b497", + "senderId": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "receiverId": "0184ad20-0015-4cc3-8f14-fc635193e8e5", + "message": "Hii", + "messageType": "text" + } + } + """) + }) + }) }) + public @interface ChatCreated { + } +} diff --git a/chat-web/src/main/java/com/smartsense/web/apidocs/EDCRegisterResourceApiDocs.java b/chat-web/src/main/java/com/smartsense/web/apidocs/EDCRegisterResourceApiDocs.java new file mode 100644 index 0000000..3c6856d --- /dev/null +++ b/chat-web/src/main/java/com/smartsense/web/apidocs/EDCRegisterResourceApiDocs.java @@ -0,0 +1,182 @@ +package com.smartsense.web.apidocs; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +public class EDCRegisterResourceApiDocs { + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @ApiResponses(value = { + @ApiResponse(responseCode = "400", description = "Issue while creating the EDC", content = { + @Content(examples = { + @ExampleObject(name = "EDC url already exist", value = """ + { + "type": "about:blank", + "title": "BadDataException: validate.edc.create.url.exist", + "status": 400, + "detail": "BadDataException: validate.edc.create.url.exist", + "instance": "/api/app/common/edc/create", + "properties": { + "timestamp": 1732008491139 + } + } + """), + @ExampleObject(name = "User not exist", value = """ + { + "type": "about:blank", + "title": "BadDataException: User not present for given userId: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": 400, + "detail": "BadDataException: User not present for given userId: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "instance": "/api/app/common/edc/create", + "properties": { + "timestamp": 1732012098646 + } + } + """) + }) }), + @ApiResponse(responseCode = "200", description = "EDC Registered", content = { + @Content(examples = { + @ExampleObject(name = "EDC Registered", value = """ + { + "message": "User Created successfully", + "body": { + "id": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "firstName": "Bhautik", + "lastName": "Sakhiya", + "email": "bhautik@gmail.com" + } + } + """) + }) + }) }) + public @interface RegisterEDC { + } + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "EDC Registered with USer", content = { + @Content(examples = { + @ExampleObject(name = "EDC Registered with User", value = """ + { + "userId":"9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "edcUrl": [ + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC", + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC1", + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC2", + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC3", + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC4", + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC5", + "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createEDC6" + ] + } + """), + @ExampleObject(name = "No EDC register with USer", value = """ + { + "userId": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd3", + "edcUrl": [] + } + """) + }) + }) }) + public @interface GetEDCByUserId { + } + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @ApiResponses(value = { + @ApiResponse(responseCode = "400", description = "EDC Details not found", content = { + @Content(examples = { + @ExampleObject(name = "EDC Details not found", value = """ + { + "type": "about:blank", + "title": "BadDataException: No EDC registered with EDC Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": 400, + "detail": "BadDataException: No EDC registered with EDC Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "instance": "/api/app/common/edc/3fa85f64-5717-4562-b3fc-2c963f66afa6", + "properties": { + "timestamp": 1732012976729 + } + } + """) + }) }), + @ApiResponse(responseCode = "200", description = "Get EDC Details", content = { + @Content(examples = { + @ExampleObject(name = "Get EDC Details", value = """ + { + "id": "cd0d266c-6f42-4b37-b5ca-6ff14e8c1c06", + "edcUrl": "http://localhost:8080/api/app/ui/swagger-ui/index.html#/edc-register-resource/createUser_1", + "userId": { + "id": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "firstName": "Bhautik", + "lastName": "Sakhiya", + "email": "bhautik@gmail.com" + } + } + """) + }) + }) }) + public @interface GetEDCById { + } + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @ApiResponses(value = { + @ApiResponse(responseCode = "400", description = "Not able to Update the EDC", content = { + @Content(examples = { + @ExampleObject(name = "Invalid User", value = """ + { + "type": "about:blank", + "title": "BadDataException: User not present for given userId: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": 400, + "detail": "BadDataException: User not present for given userId: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "instance": "/api/app/common/edc/update", + "properties": { + "timestamp": 1732013440419 + } + } + """), + @ExampleObject(name = "EDC not registered with given EDC Id", value = """ + { + "type":"about:blank", + "title":"BadDataException: No EDC registered with EDC Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status":400, + "detail":"BadDataException: No EDC registered with EDC Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6", + "instance":"/api/app/common/edc/update", + "properties":{ + timestamp":1732013532531 + } + }""" + ) + }) }), + @ApiResponse(responseCode = "200", description = "EDC Updated", content = { + @Content(examples = { + @ExampleObject(name = "EDC Updated", value = """ + { + "message": "EDC Created successfully", + "body": { + "id": "f949a7a9-9423-498c-99cc-543697398df0", + "edcUrl": "google.com", + "userId": { + "id": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "firstName": "Bhautik", + "lastName": "Sakhiya", + "email": "bhautik@gmail.com" + } + } + } + """) + }) + }) }) + public @interface UpdateEDC { + + } +} diff --git a/chat-web/src/main/java/com/smartsense/web/apidocs/UserManagementResourceApiDocs.java b/chat-web/src/main/java/com/smartsense/web/apidocs/UserManagementResourceApiDocs.java index 931b063..63fc28c 100644 --- a/chat-web/src/main/java/com/smartsense/web/apidocs/UserManagementResourceApiDocs.java +++ b/chat-web/src/main/java/com/smartsense/web/apidocs/UserManagementResourceApiDocs.java @@ -40,8 +40,8 @@ public class UserManagementResourceApiDocs { "message": "Invalid request content.", "status": 400, "errorParams": { - "age": [ - "You are underage" + "firstName": [ + "Please Enter first name" ] } } @@ -51,15 +51,14 @@ public class UserManagementResourceApiDocs { @Content(examples = { @ExampleObject(name = "User Detail", value = """ { - "message": "User Created successfully", - "body": { - "id": "248b97f0-6f3a-4f56-af04-c0da600125b1", - "name": "Name Surname", - "age": 19, - "city": "Some City", - "country": "Some Country" - } - } + "message": "User Created successfully", + "body": { + "id": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "firstName": "Bhautik", + "lastName": "Sakhiya", + "email": "bhautik@gmail.com" + } + } """) }) }) }) @@ -81,4 +80,21 @@ public class UserManagementResourceApiDocs { }) }) }) public @interface Common500 { } + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Get User by userId", content = { + @Content(examples = { + @ExampleObject(name = "User Detail", value = """ + { + "id": "9c745cb5-a5cd-41be-acbf-e7f739b8bfd7", + "firstName": "Bhautik", + "lastName": "Sakhiya", + "email": "bhautik@gmail.com" + } + """) + }) }) }) + public @interface GetUserDetails { + } } diff --git a/chat-web/src/main/java/com/smartsense/web/resource/ChatResource.java b/chat-web/src/main/java/com/smartsense/web/resource/ChatResource.java new file mode 100644 index 0000000..c993eb4 --- /dev/null +++ b/chat-web/src/main/java/com/smartsense/web/resource/ChatResource.java @@ -0,0 +1,32 @@ +package com.smartsense.web.resource; + +import com.smartsense.api.constant.ContMessage; +import com.smartsense.api.constant.ContURI; +import com.smartsense.api.model.request.ChatRequest; +import com.smartsense.api.model.response.ChatResponse; +import com.smartsense.api.model.response.ResponseBody; +import com.smartsense.service.ChatService; +import com.smartsense.web.apidocs.ChatResourceApiDocs.ChatCreated; +import io.swagger.v3.oas.annotations.Operation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Slf4j +@RequiredArgsConstructor +public class ChatResource extends BaseResource { + + private final ChatService chatService; + + @ChatCreated + @Operation(summary = "Chat") + @PostMapping(value = ContURI.CHAT_REGISTER, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseBody chat(@RequestBody ChatRequest request) { + ChatResponse chatResponse = chatService.createChat(request); + return ResponseBody.of(resolveMessage(ContMessage.CHAT_CREATED), chatResponse); + } +} diff --git a/chat-web/src/main/java/com/smartsense/web/resource/EDCRegisterResource.java b/chat-web/src/main/java/com/smartsense/web/resource/EDCRegisterResource.java new file mode 100644 index 0000000..78fdd98 --- /dev/null +++ b/chat-web/src/main/java/com/smartsense/web/resource/EDCRegisterResource.java @@ -0,0 +1,76 @@ +package com.smartsense.web.resource; + +import com.smartsense.api.constant.ContField; +import com.smartsense.api.constant.ContMessage; +import com.smartsense.api.constant.ContURI; +import com.smartsense.api.model.request.EDCRegisterRequest; +import com.smartsense.api.model.request.EDCUpdateRequest; +import com.smartsense.api.model.response.EDCRegisterResponse; +import com.smartsense.api.model.response.PageResponse; +import com.smartsense.api.model.response.ResponseBody; +import com.smartsense.api.model.response.UsersEDCResponse; +import com.smartsense.service.EDCRegisterService; +import com.smartsense.web.apidocs.EDCRegisterResourceApiDocs.GetEDCById; +import com.smartsense.web.apidocs.EDCRegisterResourceApiDocs.GetEDCByUserId; +import com.smartsense.web.apidocs.EDCRegisterResourceApiDocs.RegisterEDC; +import com.smartsense.web.apidocs.EDCRegisterResourceApiDocs.UpdateEDC; +import com.smartsensesolutions.commons.dao.filter.FilterRequest; +import io.swagger.v3.oas.annotations.Operation; +import jakarta.validation.Valid; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +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; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.UUID; + +@AllArgsConstructor +@RestController +@Slf4j +public class EDCRegisterResource extends BaseResource { + + private final EDCRegisterService edcRegisterService; + + + @RegisterEDC + @Operation(summary = "Create EDC") + @PostMapping(value = ContURI.EDC_CREATE, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseBody createEDC(@RequestBody EDCRegisterRequest request) { + EDCRegisterResponse edc = edcRegisterService.createEDCRegister(request); + return ResponseBody.of(resolveMessage(ContMessage.EDC_CREATED), edc); + } + + @UpdateEDC + @Operation(summary = "Update EDC") + @PutMapping(value = ContURI.EDC_UPDATE, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseBody updateEDC(@RequestBody EDCUpdateRequest request) { + EDCRegisterResponse edc = edcRegisterService.updateEDCRegister(request); + return ResponseBody.of(resolveMessage(ContMessage.EDC_CREATED), edc); + } + + @GetEDCById + @Operation(summary = "Get EDC") + @GetMapping(value = ContURI.GET_EDC, produces = MediaType.APPLICATION_JSON_VALUE) + public EDCRegisterResponse getUser(@PathVariable("edcId") UUID edcId) { + return edcRegisterService.getEDCById(edcId); + } + + @GetEDCByUserId + @Operation(summary = "Get User's all EDC") + @GetMapping(value = ContURI.GET_EDC_USER, produces = MediaType.APPLICATION_JSON_VALUE) + public UsersEDCResponse getEDCByUserId(@PathVariable(ContField.USER_ID) UUID userId) { + return edcRegisterService.getEDCUserById(userId); + } + + @Operation(summary = "EDC Register Filter") + @PostMapping(value = ContURI.EDC_FILTER, produces = MediaType.APPLICATION_JSON_VALUE, consumes = + MediaType.APPLICATION_JSON_VALUE) + public PageResponse userFilter(@Valid @RequestBody FilterRequest filterRequest) { + return edcRegisterService.filter(filterRequest); + } +} diff --git a/chat-web/src/main/java/com/smartsense/web/resource/UserManagementResource.java b/chat-web/src/main/java/com/smartsense/web/resource/UserManagementResource.java index 8f44399..23ac982 100644 --- a/chat-web/src/main/java/com/smartsense/web/resource/UserManagementResource.java +++ b/chat-web/src/main/java/com/smartsense/web/resource/UserManagementResource.java @@ -15,6 +15,17 @@ */ package com.smartsense.web.resource; +import com.smartsense.api.constant.ContField; +import com.smartsense.api.constant.ContMessage; +import com.smartsense.api.constant.ContURI; +import com.smartsense.api.model.request.UserRequest; +import com.smartsense.api.model.response.PageResponse; +import com.smartsense.api.model.response.ResponseBody; +import com.smartsense.api.model.response.UserResponse; +import com.smartsense.service.UserManagementService; +import com.smartsense.web.apidocs.UserManagementResourceApiDocs.Common500; +import com.smartsense.web.apidocs.UserManagementResourceApiDocs.CreateUserApiDocs; +import com.smartsense.web.apidocs.UserManagementResourceApiDocs.GetUserDetails; import com.smartsensesolutions.commons.dao.filter.FilterRequest; import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; @@ -26,16 +37,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import com.smartsense.api.constant.ContField; -import com.smartsense.api.constant.ContMessage; -import com.smartsense.api.constant.ContURI; -import com.smartsense.api.model.request.UserRequest; -import com.smartsense.api.model.response.PageResponse; -import com.smartsense.api.model.response.ResponseBody; -import com.smartsense.api.model.response.UserResponse; -import com.smartsense.service.UserManagementService; -import com.smartsense.web.apidocs.UserManagementResourceApiDocs.Common500; -import com.smartsense.web.apidocs.UserManagementResourceApiDocs.CreateUserApiDocs; + +import java.util.UUID; /** * Provide endpoint related to User management @@ -57,9 +60,10 @@ public ResponseBody createUser(@Valid @RequestBody UserRequest use return ResponseBody.of(resolveMessage(ContMessage.USER_CREATED), user); } + @GetUserDetails @Operation(summary = "Get User") @GetMapping(value = ContURI.USER_WITH_ID, produces = MediaType.APPLICATION_JSON_VALUE) - public UserResponse getUser(@PathVariable(ContField.USER_ID) String userId) { + public UserResponse getUser(@PathVariable(ContField.USER_ID) UUID userId) { return userManagementService.getUserById(userId); } diff --git a/chat-web/src/main/resources/application.yml b/chat-web/src/main/resources/application.yml index 8ff0844..f1a3ef8 100644 --- a/chat-web/src/main/resources/application.yml +++ b/chat-web/src/main/resources/application.yml @@ -95,6 +95,8 @@ spring: threads: virtual: enabled: true + main: + allow-bean-definition-overriding: true jpa: hibernate: ddl-auto: update diff --git a/chat-web/src/main/resources/i18n/messages.properties b/chat-web/src/main/resources/i18n/messages.properties index 8e7d892..7e40a01 100644 --- a/chat-web/src/main/resources/i18n/messages.properties +++ b/chat-web/src/main/resources/i18n/messages.properties @@ -1,10 +1,11 @@ #########################Success Message user.created.successfully=User Created successfully +edc.created.successfully=EDC Created successfully +chat.created.successfully=Chat saved successfully #########################Validation Message -please.enter.user.name=Please Enter name -you.are.under.age=You are underage -please.enter.city=Please enter city -please.enter.county=Please enter country +please.enter.user.first.name=Please Enter first name +please.enter.email=Please enter email address validate.user.create.name.exist=User with this name already exist +validate.edc.create.url.exist=EDC url already exist #########################Error message -something.went.wrong=Something went wrong \ No newline at end of file +something.went.wrong=Something went wrong diff --git a/chat-web/src/main/resources/i18n/messages_de.properties b/chat-web/src/main/resources/i18n/messages_de.properties index 7fd4da4..0589ab9 100644 --- a/chat-web/src/main/resources/i18n/messages_de.properties +++ b/chat-web/src/main/resources/i18n/messages_de.properties @@ -1,8 +1,9 @@ #Validation Message -please.enter.user.name=Bitte Namen eingeben -you.are.under.age=Du bist minderjährig -please.enter.city=Bitte geben Sie den Ort ein -please.enter.county=Bitte geben Sie das Land ein -validate.user.create.name.exist=User with this name already exist +please.enter.user.first.name=Bitte Namen eingeben +please.enter.email=Bitte geben Sie die E-Mail-Adresse ein +validate.user.create.name.exist=Benutzer mit diesem Namen sind bereits vorhanden +validate.edc.create.url.exist=Die EDC-URL existiert bereits #Success Message -user.created.successfully=Benutzer erfolgreich erstellt \ No newline at end of file +user.created.successfully=Benutzer erfolgreich erstellt +edc.created.successfully=EDC erfolgreich erstellt +chat.created.successfully=Chat erfolgreich gespeichert