Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #110 from Javaler/feature/backend/update-function_…
Browse files Browse the repository at this point in the history
…post

postテーブルのテーブル定義変更に伴って、本番環境でも元の挙動ができるように更新
  • Loading branch information
YutaSugino committed Mar 30, 2023
2 parents 3ada907 + ff352f8 commit ac93323
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 30 deletions.
14 changes: 10 additions & 4 deletions src/main/java/com/example/demo/entity/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@ public class Post {
@Column(name = "presentation")
private Integer presentation;

@Column(name = "work")
private String work;
@Column(name = "work_info")
private String workInfo;

@Column(name = "event")
private String event;
@Column(name = "event_info")
private String eventInfo;

@Column(name = "work_link")
private String workLink;

@Column(name = "event_link")
private String eventLink;

@Column(name = "comment")
private String comment;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/example/demo/form/PostForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public Post toEntity() {
post.setMachinelearning(machinelearning);
post.setPortfolio(portfolio);
post.setPresentation(presentation);
post.setWork(work);
post.setEvent(event);
post.setWorkInfo(work);
post.setEventInfo(event);
post.setWorkLink(work);
post.setEventLink(event);
post.setComment(comment);

return post;
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ label.name=投稿者名
label.event=参加したハッカソン
label.work=作品情報
label.comment=コメント
label.eventInfo=参加したいハッカソン
label.memberNum=募集人数
label.contactInfo=連絡先
text.hackathon=ハッカソン参加経験
text.team=チーム開発経験
text.portfolio=ツール(アプリ)開発経験
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
</tr>
<tr>
<th class="w-50" th:text="#{label.event}"></th>
<td th:text="${post.event}"></td>
<td th:text="${post.eventInfo}"></td>
</tr>
<tr>
<th class="w-50" th:text="#{label.work}"></th>
<td th:text="${post.work}"></td>
<td th:text="${post.workInfo}"></td>
</tr>
</table>
</button>
Expand Down Expand Up @@ -138,11 +138,11 @@
</tr>
<tr>
<th class="w-50" th:text="#{label.event}"></th>
<td th:text="${post.event}"></td>
<td th:text="${post.eventInfo}"></td>
</tr>
<tr>
<th class="w-50" th:text="#{label.work}"></th>
<td th:text="${post.work}"></td>
<td th:text="${post.workInfo}"></td>
</tr>
</table>
</button>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/postDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
</div>
<div class="col-12 col-sm-6 mb-3">
<h2 th:text="#{label.event}"></h2>
<p th:text="${post.event}"></p>
<p th:text="${post.eventInfo}"></p>
<h2 th:text="#{label.work}"></h2>
<p th:text="${post.work}"></p>
<p th:text="${post.workInfo}"></p>
<h2 th:text="#{label.comment}"></h2>
<p th:text="${post.comment}"></p>
</div>
Expand Down
26 changes: 14 additions & 12 deletions src/main/resources/templates/postForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
<body class="bg-form">
<nav th:replace="fragments :: navbar_area"></nav>

<!--<h1 class="text-center mt-5" th:text="#{text.postform_header}"></h1>-->

<div class="container">
<div class="row">
<div class="col-10 col-md-4 mx-auto">
<h4 class="mt-3">投稿</h4>
<h4 class="mt-3" th:text="#{text.postform_header}"></h4>
<div class="progress mb-5 bg-white">
<div id="progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>

<form class="needs-validated" th:action="@{/post}" th:object="${postForm}" method="post" novalidate>
<div id="question-page0" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
Expand All @@ -44,6 +43,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page1" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.team}"></p>
Expand All @@ -62,7 +62,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page2" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.portfolio}"></p>
Expand All @@ -85,6 +85,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page3" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.git}"></p>
Expand All @@ -111,7 +112,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page4" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.movie}"></p>
Expand All @@ -126,7 +127,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page5" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.presentation}"></p>
Expand All @@ -141,7 +142,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page6" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.design}"></p>
Expand All @@ -160,7 +161,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page7" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.frontend}"></p>
Expand All @@ -179,7 +180,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page8" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.backend}"></p>
Expand All @@ -199,7 +200,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page9" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.infrastructure}"></p>
Expand All @@ -214,7 +215,7 @@ <h4 class="mt-3">投稿</h4>
</div>
</div>
</div>

<div id="question-page10" class="question-page question-page-select" data-page-display="flex">
<div class="p-3 w-100 mx-auto bg-white rounded">
<p th:text="#{label.machinelearning}"></p>
Expand Down Expand Up @@ -259,6 +260,7 @@ <h4 class="mt-3">投稿</h4>
<strong th:text="#{text.not_entered_alart}"></strong>
</div>
</div>

<div id="buttons-first" class="buttons text-center mt-auto">
<button type="button" class="btn btn-primary px-4 m-3" onclick="nextPage()" th:text="#{button.next}"></button>
</div>
Expand All @@ -271,7 +273,7 @@ <h4 class="mt-3">投稿</h4>
<button type="submit" class="btn btn-primary px-4 m-3" th:text="#{button.post_form}"></button>
</div>
</form>

<div class="alert alert-danger alert-dismissible fade show" id="change-page-alert" role="alert">
<strong th:text="#{text.not_entered_alart}"></strong>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/postList.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ <h5 class="modal-title" id="filterModalLabel" th:text="#{text.filter}"></h5>
<p class="fw-bold" th:text="#{label.event}"></p>
</div>
<div class="col-12 col-sm-6 my-1">
<p th:text="${post.event}"></p>
<p th:text="${post.eventInfo}"></p>
</div>
</div>
<div class="row my-2">
<div class="col-12 col-sm-6 my-1">
<p class="fw-bold" th:text="#{label.work}"></p>
</div>
<div class="col-12 col-sm-6 my-1">
<p th:text="${post.work}"></p>
<p th:text="${post.workInfo}"></p>
</div>
</div>
</div>
Expand Down
Binary file modified target/classes/com/example/demo/entity/Post.class
Binary file not shown.
Binary file modified target/classes/com/example/demo/entity/Post_.class
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
public abstract class Post_ {

public static volatile SingularAttribute<Post, Integer> movie;
public static volatile SingularAttribute<Post, String> work;
public static volatile SingularAttribute<Post, String> workLink;
public static volatile SingularAttribute<Post, Integer> team;
public static volatile SingularAttribute<Post, String> eventLink;
public static volatile SingularAttribute<Post, Integer> presentation;
public static volatile SingularAttribute<Post, String> workInfo;
public static volatile SingularAttribute<Post, String> eventInfo;
public static volatile SingularAttribute<Post, Integer> git;
public static volatile SingularAttribute<Post, Integer> portfolio;
public static volatile SingularAttribute<Post, Integer> infrastructure;
Expand All @@ -22,13 +25,15 @@ public abstract class Post_ {
public static volatile SingularAttribute<Post, Integer> backend;
public static volatile SingularAttribute<Post, String> comment;
public static volatile SingularAttribute<Post, Integer> id;
public static volatile SingularAttribute<Post, String> event;
public static volatile SingularAttribute<Post, Integer> frontend;

public static final String MOVIE = "movie";
public static final String WORK = "work";
public static final String WORK_LINK = "workLink";
public static final String TEAM = "team";
public static final String EVENT_LINK = "eventLink";
public static final String PRESENTATION = "presentation";
public static final String WORK_INFO = "workInfo";
public static final String EVENT_INFO = "eventInfo";
public static final String GIT = "git";
public static final String PORTFOLIO = "portfolio";
public static final String INFRASTRUCTURE = "infrastructure";
Expand All @@ -39,7 +44,6 @@ public abstract class Post_ {
public static final String BACKEND = "backend";
public static final String COMMENT = "comment";
public static final String ID = "id";
public static final String EVENT = "event";
public static final String FRONTEND = "frontend";

}
Expand Down

0 comments on commit ac93323

Please sign in to comment.