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
416a6476
Commit
416a6476
authored
Oct 21, 2020
by
keita.onoguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ウォレット機能途中
parent
c363330c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
WalletsService.java
src/main/java/com/example/service/WalletsService.java
+1
-4
No files found.
src/main/java/com/example/service/WalletsService.java
View file @
416a6476
...
...
@@ -5,18 +5,14 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.example.domain.BadRequestException
;
import
com.example.domain.Wallets
;
import
com.example.repository.WalletsRepository
;
import
com.example.web.EcsiteController
;
//ユーザウォレットのサービス
@Service
public
class
WalletsService
{
@Autowired
WalletsRepository
walletsRepository
;
@Autowired
Wallets
wallet
;
public
List
<
Wallets
>
findAll
(){
return
walletsRepository
.
findAll
();
...
...
@@ -37,6 +33,7 @@ public class WalletsService {
//支払い処理
public
Wallets
pay
(
Integer
id
,
Integer
amount
){
//対象の財布情報を取得
Wallets
wallet
=
new
Wallets
();
wallet
=
this
.
findOne
(
id
);
wallet
.
setAmount
(
wallet
.
getAmount
()
-
amount
);
return
walletsRepository
.
save
(
wallet
);
...
...
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