Skip to content

Commit

Permalink
Merge pull request #50 from hiroxpepe/develop
Browse files Browse the repository at this point in the history
refactor: #35 keeping codes clean.
  • Loading branch information
hiroxpepe authored Feb 3, 2023
2 parents 4898510 + b6afef3 commit 11c5111
Show file tree
Hide file tree
Showing 72 changed files with 208 additions and 251 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# blog-examproject
# expt-blog

---
## What's this?
Expand Down Expand Up @@ -35,17 +35,17 @@ to stop the application hit ctrl + c
---
## Repository on Github.
[hiroxpepe/blog-examproject](https://github.com/hiroxpepe/blog-examproject)
[hiroxpepe/expt-blog](https://github.com/hiroxpepe/expt-blog)
---
## Running on Heroku.
http://blog-examproject.herokuapp.com/
http://expt-blog.herokuapp.com/
---
## Author
[hiroxpepe](mailto:[email protected])
---
## License
The examproject is released under version 2.0 of the
The expt is released under version 2.0 of the
[Apache License](http://www.apache.org/licenses/LICENSE-2.0).
10 changes: 4 additions & 6 deletions model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.examproject.blog</groupId>
<artifactId>exmp-model</artifactId>
<groupId>org.expt.blog</groupId>
<artifactId>expt-model</artifactId>
<packaging>jar</packaging>
<version>1.0.3</version>
<version>1.0.4</version>
<name>model</name>

<properties>
<exmp-blog.version>${version}</exmp-blog.version>
<expt-blog.version>${version}</expt-blog.version>
<spring.data.jpa.version>2.3.0.RELEASE</spring.data.jpa.version>
<spring.version>5.2.6.RELEASE</spring.version>
<hibernate.version>5.4.17.Final</hibernate.version>
Expand Down Expand Up @@ -178,5 +177,4 @@
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.entity;
package org.expt.blog.entity;

import java.io.Serializable;
import javax.persistence.Column;
Expand Down Expand Up @@ -43,5 +43,4 @@ public class Category implements Serializable {

@Column(name="text", unique=true, length=24)
String text;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.entity;
package org.expt.blog.entity;

import java.io.Serializable;
import java.util.Date;
Expand Down Expand Up @@ -76,5 +76,4 @@ public class Entry implements Serializable {

// @OneToMany(mappedBy="entry", fetch=FetchType.EAGER)
// Set<EntryTag> entryTagSet = new HashSet<>();

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.entity;
package org.expt.blog.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
Expand Down Expand Up @@ -51,5 +51,4 @@ public class EntryTag {
@ManyToOne
@JoinColumn(name="tag_id")
Tag tag;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.entity;
package org.expt.blog.entity;

import java.io.Serializable;
import java.util.HashSet;
Expand Down Expand Up @@ -50,5 +50,4 @@ public class Tag implements Serializable {

// @OneToMany(mappedBy="tag", fetch=FetchType.EAGER)
// Set<EntryTag> entrySet = new HashSet<>();

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.entity;
package org.expt.blog.entity;

import java.io.Serializable;
import javax.persistence.Column;
Expand Down Expand Up @@ -52,5 +52,4 @@ public class User implements Serializable {

@Column(name="enable")
Boolean enable = true;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
* limitations under the License.
*/

package org.examproject.blog.repository;
package org.expt.blog.repository;

import org.springframework.data.jpa.repository.JpaRepository;

import org.examproject.blog.entity.Category;
import org.expt.blog.entity.Category;

/**
* @author h.adachi
*/
public interface CategoryRepository extends JpaRepository<Category, Long> {

Category findByText(String text);

}

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
* limitations under the License.
*/

package org.examproject.blog.repository;
package org.expt.blog.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import org.examproject.blog.entity.Entry;
import org.examproject.blog.entity.User;
import org.expt.blog.entity.Entry;
import org.expt.blog.entity.User;

/**
* @author h.adachi
Expand All @@ -29,5 +29,4 @@ public interface EntryRepository extends JpaRepository<Entry, Long> {
List<Entry> findByCode(String code);

List<Entry> findByUser(User user);

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
* limitations under the License.
*/

package org.examproject.blog.repository;
package org.expt.blog.repository;

import java.util.List;
import org.examproject.blog.entity.Entry;
import org.expt.blog.entity.Entry;

import org.springframework.data.jpa.repository.JpaRepository;

import org.examproject.blog.entity.EntryTag;
import org.examproject.blog.entity.Tag;
import org.expt.blog.entity.EntryTag;
import org.expt.blog.entity.Tag;

/**
* @author h.adachi
Expand All @@ -30,5 +30,4 @@ public interface EntryTagRepository extends JpaRepository<EntryTag, Long> {
List<EntryTag> findByEntryAndTag(Entry entry, Tag tag);

List<EntryTag> findByEntry(Entry entry);

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
* limitations under the License.
*/

package org.examproject.blog.repository;
package org.expt.blog.repository;

import org.springframework.data.jpa.repository.JpaRepository;

import org.examproject.blog.entity.Tag;
import org.expt.blog.entity.Tag;

/**
* @author h.adachi
*/
public interface TagRepository extends JpaRepository<Tag, Long> {

Tag findByText(String text);

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
* limitations under the License.
*/

package org.examproject.blog.repository;
package org.expt.blog.repository;

import java.lang.Long;

import org.springframework.data.jpa.repository.JpaRepository;

import org.examproject.blog.entity.User;
import org.expt.blog.entity.User;

/**
* @author h.adachi
*/
public interface UserRepository extends JpaRepository<User, Long> {

User findByUsername(String username);

}
2 changes: 1 addition & 1 deletion model/src/test/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source/>
<mapping-file>META-INF/orm.xml</mapping-file>
<class>org.examproject.blog.entity.Person</class>
<class>org.expt.blog.entity.Person</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
Expand Down
2 changes: 1 addition & 1 deletion model/src/test/resources/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<priority value="info"/>
</category>

<category name="org.examproject" >
<category name="org.expt" >
<priority value="trace"/>
</category>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

<context:component-scan base-package="org.examproject"/>
<context:component-scan base-package="org.expt"/>

<!--///////////////////////////////////////////////////////////////////////////////-->
<!-- ORM JPA configure -->
Expand Down Expand Up @@ -51,6 +51,6 @@
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<!-- for Spring Data JPA configure -->
<jpa:repositories base-package="org.examproject.repository" />
<jpa:repositories base-package="org.expt.repository" />

</beans>
13 changes: 6 additions & 7 deletions mvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.examproject.blog</groupId>
<artifactId>exmp-mvc</artifactId>
<groupId>org.expt.blog</groupId>
<artifactId>expt-mvc</artifactId>
<packaging>jar</packaging>
<version>1.0.3</version>
<version>1.0.4</version>
<name>mvc</name>

<properties>
Expand All @@ -23,10 +22,10 @@
<!--//////////////////////////////////////////////////////////////////////////-->
<!-- USER LIB -->

<!-- exmp-service -->
<!-- expt-service -->
<dependency>
<groupId>org.examproject.blog</groupId>
<artifactId>exmp-service</artifactId>
<groupId>org.expt.blog</groupId>
<artifactId>expt-service</artifactId>
<version>${version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.controller;
package org.expt.blog.controller;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -35,11 +35,11 @@
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import org.examproject.blog.dto.EntryDto;
import org.examproject.blog.form.EntryForm;
import org.examproject.blog.model.EntryModel;
import org.examproject.blog.service.EntryService;
import org.examproject.blog.response.EntryResponse;
import org.expt.blog.dto.EntryDto;
import org.expt.blog.form.EntryForm;
import org.expt.blog.model.EntryModel;
import org.expt.blog.service.EntryService;
import org.expt.blog.response.EntryResponse;

/**
* the entry controller class of the application.
Expand Down Expand Up @@ -75,11 +75,11 @@ public class EntryController {
method=RequestMethod.GET
)
public void doForm(
@CookieValue(value="__exmp_blog_username", defaultValue="anonymous")
@CookieValue(value="__expt_blog_username", defaultValue="anonymous")
String username,
@CookieValue(value="__exmp_blog_password", defaultValue="password")
@CookieValue(value="__expt_blog_password", defaultValue="password")
String password,
@CookieValue(value="__exmp_blog_email", defaultValue="[email protected]")
@CookieValue(value="__expt_blog_email", defaultValue="[email protected]")
String email,
Model model
) {
Expand Down Expand Up @@ -341,5 +341,4 @@ private void addToResponse(
false
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* limitations under the License.
*/

package org.examproject.blog.controller;
package org.expt.blog.controller;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -28,9 +28,9 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import org.examproject.blog.dto.EntryDto;
import org.examproject.blog.model.FeedModel;
import org.examproject.blog.service.FeedService;
import org.expt.blog.dto.EntryDto;
import org.expt.blog.model.FeedModel;
import org.expt.blog.service.FeedService;

/**
* the feed controller class of the application.
Expand Down Expand Up @@ -158,5 +158,4 @@ private List<FeedModel> getFeedModelList() {

return feedModelList;
}

}
Loading

0 comments on commit 11c5111

Please sign in to comment.