Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shoei.kanno
Ecsite
Commits
81815122
Commit
81815122
authored
Oct 21, 2020
by
DESKTOP-FI5PFC1\tevir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
編集途中
parent
5cdd3b62
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
14 deletions
+19
-14
EcsiteRestController.java
src/main/java/com/example/api/EcsiteRestController.java
+5
-0
EcsiteController.java
src/main/java/com/example/web/EcsiteController.java
+7
-7
application.properties
src/main/resources/application.properties
+1
-1
cart.html
src/main/resources/templates/cart.html
+1
-1
log.html
src/main/resources/templates/log.html
+4
-4
logDetails.html
src/main/resources/templates/logDetails.html
+1
-1
No files found.
src/main/java/com/example/api/EcsiteRestController.java
View file @
81815122
...
@@ -129,6 +129,11 @@ public class EcsiteRestController {
...
@@ -129,6 +129,11 @@ public class EcsiteRestController {
}
else
{
}
else
{
cart
.
put
(
id
,
itemsService
.
findOne
(
data
.
getShoesId
(),
data
.
getQuantity
()));
cart
.
put
(
id
,
itemsService
.
findOne
(
data
.
getShoesId
(),
data
.
getQuantity
()));
}
}
if
(
cart
.
size
()
==
0
)
{
session
.
removeAttribute
(
"cart"
);
session
.
removeAttribute
(
"cartValue"
);
return
cart
;
}
session
.
setAttribute
(
"cart"
,
cart
);
session
.
setAttribute
(
"cart"
,
cart
);
return
cart
;
return
cart
;
}
}
...
...
src/main/java/com/example/web/EcsiteController.java
View file @
81815122
...
@@ -133,13 +133,13 @@ public class EcsiteController {
...
@@ -133,13 +133,13 @@ public class EcsiteController {
public
String
history
(
@PathVariable
Integer
id
,
Model
model
,
SalesLog
salesLog
,
@AuthenticationPrincipal
LoginUser
userDetails
)
{
public
String
history
(
@PathVariable
Integer
id
,
Model
model
,
SalesLog
salesLog
,
@AuthenticationPrincipal
LoginUser
userDetails
)
{
User
user
=
userDetails
.
getUser
();
User
user
=
userDetails
.
getUser
();
model
.
addAttribute
(
"user"
,
user
);
model
.
addAttribute
(
"user"
,
user
);
List
<
SalesLog
>
list
=
salesLogService
.
history
(
id
);
model
.
addAttribute
(
"log"
,
list
);
if
(
session
.
getAttribute
(
"cartValue"
)
==
null
)
{
if
(
session
.
getAttribute
(
"cartValue"
)
==
null
)
{
model
.
addAttribute
(
"cartValue"
,
0
);
model
.
addAttribute
(
"cartValue"
,
0
);
}
else
{
}
else
{
model
.
addAttribute
(
"cartValue"
,
session
.
getAttribute
(
"cartValue"
));
model
.
addAttribute
(
"cartValue"
,
session
.
getAttribute
(
"cartValue"
));
}
}
List
<
SalesLog
>
list
=
salesLogService
.
history
(
id
);
model
.
addAttribute
(
"log"
,
list
);
return
"log"
;
return
"log"
;
}
}
...
@@ -148,16 +148,16 @@ public class EcsiteController {
...
@@ -148,16 +148,16 @@ public class EcsiteController {
public
String
historyDetails
(
@PathVariable
Date
created
,
Model
model
,
@AuthenticationPrincipal
LoginUser
userDetails
)
{
public
String
historyDetails
(
@PathVariable
Date
created
,
Model
model
,
@AuthenticationPrincipal
LoginUser
userDetails
)
{
User
user
=
userDetails
.
getUser
();
User
user
=
userDetails
.
getUser
();
model
.
addAttribute
(
"user"
,
user
);
model
.
addAttribute
(
"user"
,
user
);
if
(
salesLogService
.
historyDetails
(
created
,
user
.
getId
())
==
null
){
return
"logDetails"
;
}
List
<
SalesLog
>
list
=
salesLogService
.
historyDetails
(
created
,
user
.
getId
());
model
.
addAttribute
(
"logDetails"
,
list
);
if
(
session
.
getAttribute
(
"cartValue"
)
==
null
)
{
if
(
session
.
getAttribute
(
"cartValue"
)
==
null
)
{
model
.
addAttribute
(
"cartValue"
,
0
);
model
.
addAttribute
(
"cartValue"
,
0
);
}
else
{
}
else
{
model
.
addAttribute
(
"cartValue"
,
session
.
getAttribute
(
"cartValue"
));
model
.
addAttribute
(
"cartValue"
,
session
.
getAttribute
(
"cartValue"
));
}
}
if
(
salesLogService
.
historyDetails
(
created
,
user
.
getId
())
==
null
){
return
"logDetails"
;
}
List
<
SalesLog
>
list
=
salesLogService
.
historyDetails
(
created
,
user
.
getId
());
model
.
addAttribute
(
"logDetails"
,
list
);
return
"logDetails"
;
return
"logDetails"
;
}
}
...
...
src/main/resources/application.properties
View file @
81815122
spring.datasource.url
=
jdbc:mysql://localhost:3306/limited
spring.datasource.url
=
jdbc:mysql://localhost:3306/limited
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
spring.datasource.password
=
kanikani7
security.basic.enabled
=
false
security.basic.enabled
=
false
spring.datasource.driverClassName
=
com.mysql.jdbc.Driver
spring.datasource.driverClassName
=
com.mysql.jdbc.Driver
src/main/resources/templates/cart.html
View file @
81815122
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
<td
class=
"tdCart"
><p
th:text=
"${cart.shoesName}"
class=
"textP"
>
Convers All Star
</p></td>
<td
class=
"tdCart"
><p
th:text=
"${cart.shoesName}"
class=
"textP"
>
Convers All Star
</p></td>
<td
class=
"tdCart"
><input
type=
"number"
min=
"0"
th:value=
"${cart.quantity}"
class=
"textP itemCount"
></input></td>
<td
class=
"tdCart"
><input
type=
"number"
min=
"0"
th:value=
"${cart.quantity}"
class=
"textP itemCount"
></input></td>
<td
class=
"tdCart"
><p
th:text=
"${cart.price}"
class=
"textP"
>
¥
10000
</p></td>
<td
class=
"tdCart"
><p
th:text=
"${cart.price}"
class=
"textP"
>
¥
10000
</p></td>
<td
class=
"tdCart"
><button
type=
"button"
class=
"itemCountChange"
>
数変更確定
</button></td>
<td
class=
"tdCart"
><button
type=
"button"
class=
"itemCountChange"
>
Change
</button></td>
</tr>
</tr>
</div>
</div>
</tbody>
</tbody>
...
...
src/main/resources/templates/log.html
View file @
81815122
<!doctype html>
<!doctype html>
<html
class=
"no-js"
lang=
"
en
"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
class=
"no-js"
lang=
"
ja
"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
/>
...
@@ -70,8 +70,8 @@
...
@@ -70,8 +70,8 @@
</ul>
</ul>
<ul
class=
"nav navbar-nav navbar-right cart-menu"
>
<ul
class=
"nav navbar-nav navbar-right cart-menu"
>
<li><a
class=
"search-btn"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></a></li>
<li><a
class=
"search-btn"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></a></li>
<li><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
th:text=
"${cartValue}"
>
0
</span></a></li>
<li><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
id=
"shoping-cart-span"
th:text=
"${cartValue}"
>
0
</span></a></li>
</ul>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</div>
<!-- /.container -->
</nav>
</nav>
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
<!-- ログインフォーム -->
<!-- ログインフォーム -->
<div
class=
"container"
>
<div
class=
"container"
>
<p
id=
"log-p-text"
><span
id=
"log-text"
>
Purchase History
</span></p>
<p
id=
"log-p-text"
><span
id=
"log-text"
>
Purchase History
</span></p>
<!--<form id="login-form" method="post" th:action="@{/login}">
<!--<form id="login-form" method="post" th:action="@{/login}">
<div id="email-form">
<div id="email-form">
<label for="login-email">Email</label>
<label for="login-email">Email</label>
...
...
src/main/resources/templates/logDetails.html
View file @
81815122
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
</ul>
</ul>
<ul
class=
"nav navbar-nav navbar-right cart-menu"
>
<ul
class=
"nav navbar-nav navbar-right cart-menu"
>
<li><a
class=
"search-btn"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></a></li>
<li><a
class=
"search-btn"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></a></li>
<li><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
th:text=
"${cartValue}"
>
0
</span></a></li>
<li
class=
"active"
><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
th:text=
"${cartValue}"
>
0
</span></a></li>
</ul>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</div>
<!-- /.container -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment