Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint6 97 pojo domain #98

Merged
merged 5 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
/domain/target/
/service/target/

.classpath
.project
.settings/
logs/
logs/
21 changes: 21 additions & 0 deletions domain/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>catalog-domain</artifactId>

<name>Catalog Domain</name>
<description>A domain for interfacing with Library Catalogs</description>

<parent>
<groupId>edu.tamu.catalog</groupId>
<artifactId>catalog-parent</artifactId>
<version>2.2.0</version>
</parent>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package edu.tamu.catalog.domain.model;

import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Data;

@AllArgsConstructor
This conversation was marked as resolved.
Show resolved Hide resolved
@Data
public class HoldingsRecord {
private String marcRecordLeader;
private String mfhd;
private String issn;
private String isbn;
private String title;
private String author;
private String publisher;
private String place;
private String year;
private String genre;
private String fallbackLocationCode;
private String edition;
private String oclc;
private String recordId;
private String callNumber;
private boolean largeVolume;

private Map<String, Map<String, String>> catalogItems;

public HoldingsRecord(String marcRecordLeader, String mfhd, String issn, String isbn, String title, String author,
String publisher, String place, String year, String genre, String edition, String fallBackLocationCode, String oclc, String recordId, String callNumber,
Map<String, Map<String, String>> catalogItems) {
this(marcRecordLeader, mfhd, issn, isbn, title, author, publisher, place, year, genre, edition, fallBackLocationCode, oclc, recordId, callNumber, false, catalogItems);
}

public boolean isMultiVolume() {
return (this.getCatalogItems().size() > 1);
}
}
110 changes: 21 additions & 89 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.tamu</groupId>
<artifactId>catalog-service</artifactId>
<groupId>edu.tamu.catalog</groupId>
<artifactId>catalog-parent</artifactId>
<version>2.2.0</version>
<name>Catalog-Service</name>
<description>A service for interfacing with Library Catalogs</description>

<name>Catalog Parent</name>
<description>A service and a domain for interfacing with Library Catalogs</description>

<parent>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to bring up to the team whether we should use weaver parent. CatalogService will not use anything from it and we should be getting away from the bad practices it prescribes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can drop it without consequence here, I would say we do so.

<groupId>edu.tamu.weaver</groupId>
<artifactId>webservice-parent</artifactId>
<version>2.0.2</version>
</parent>

<properties>
<start-class>edu.tamu.app.WebServerInit</start-class>
</properties>
<modules>
<module>domain</module>
<module>service</module>
</modules>

<packaging>war</packaging>
<packaging>pom</packaging>

<dependencies>
<dependency>
Expand All @@ -32,94 +34,13 @@
<version>2.0.2</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<quiet>true</quiet>
<instrumentation>
<ignoreTrivial>true</ignoreTrivial>
<ignores>
<ignore>java.util.logging.*</ignore>
<ignore>edu.tamu.app.config.AppEmailConfig</ignore>
</ignores>
<excludes>
<exclude>**/ProjectInitialization.class</exclude>
</excludes>
</instrumentation>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/ProjectInitialization.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<configuration>
<repoToken></repoToken>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>tamu-releases</id>
Expand All @@ -135,4 +56,15 @@
</repository>
</repositories>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
112 changes: 112 additions & 0 deletions service/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>catalog-service</artifactId>

<name>Catalog Service</name>
<description>A service for interfacing with Library Catalogs</description>

<parent>
<groupId>edu.tamu.catalog</groupId>
<artifactId>catalog-parent</artifactId>
<version>2.2.0</version>
</parent>

<properties>
<start-class>edu.tamu.catalog.WebServerInit</start-class>
</properties>

<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>edu.tamu.catalog</groupId>
<artifactId>catalog-domain</artifactId>
<version>2.2.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
</dependencies>

<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<quiet>true</quiet>
<instrumentation>
<ignoreTrivial>true</ignoreTrivial>
<ignores>
<ignore>java.util.logging.*</ignore>
<ignore>edu.tamu.catalog.config.AppEmailConfig</ignore>
</ignores>
<excludes>
<exclude>**/ProjectInitialization.class</exclude>
</excludes>
</instrumentation>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/ProjectInitialization.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<configuration>
<repoToken></repoToken>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.tamu.app;
package edu.tamu.catalog;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.tamu.app.auth.model;
package edu.tamu.catalog.auth.model;

import edu.tamu.app.model.User;
import edu.tamu.catalog.model.User;

public class AppUserDetails extends User {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package edu.tamu.app.auth.service;
package edu.tamu.catalog.auth.service;

import java.util.Optional;

import org.springframework.stereotype.Service;

import edu.tamu.app.enums.Role;
import edu.tamu.app.model.User;
import edu.tamu.app.model.repo.UserRepo;
import edu.tamu.catalog.enums.Role;
import edu.tamu.catalog.model.User;
import edu.tamu.catalog.model.repo.UserRepo;
import edu.tamu.weaver.auth.model.Credentials;
import edu.tamu.weaver.auth.service.UserCredentialsService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package edu.tamu.app.auth.service;
package edu.tamu.catalog.auth.service;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;

import edu.tamu.app.auth.model.AppUserDetails;
import edu.tamu.app.model.User;
import edu.tamu.app.model.repo.UserRepo;
import edu.tamu.catalog.auth.model.AppUserDetails;
import edu.tamu.catalog.model.User;
import edu.tamu.catalog.model.repo.UserRepo;
import edu.tamu.weaver.auth.service.AbstractWeaverUserDetailsService;

@Service
Expand Down
Loading