Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BudgetMaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
BudgetMaster
Commits
8b565bf2
Commit
8b565bf2
authored
May 1, 2019
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
cleanup and refactoring
parent
77fd837c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/deadlocker8/budgetmaster/transactions/TransactionController.java
+4
-6
4 additions, 6 deletions
...ker8/budgetmaster/transactions/TransactionController.java
with
4 additions
and
6 deletions
src/main/java/de/deadlocker8/budgetmaster/transactions/TransactionController.java
+
4
−
6
View file @
8b565bf2
...
@@ -35,7 +35,6 @@ import java.util.List;
...
@@ -35,7 +35,6 @@ import java.util.List;
@Controller
@Controller
public
class
TransactionController
extends
BaseController
public
class
TransactionController
extends
BaseController
{
{
private
final
TransactionRepository
transactionRepository
;
private
final
TransactionService
transactionService
;
private
final
TransactionService
transactionService
;
private
final
CategoryRepository
categoryRepository
;
private
final
CategoryRepository
categoryRepository
;
private
final
AccountService
accountService
;
private
final
AccountService
accountService
;
...
@@ -46,9 +45,8 @@ public class TransactionController extends BaseController
...
@@ -46,9 +45,8 @@ public class TransactionController extends BaseController
private
final
FilterHelpersService
filterHelpers
;
private
final
FilterHelpersService
filterHelpers
;
@Autowired
@Autowired
public
TransactionController
(
TransactionRepository
transactionRepository
,
TransactionService
transactionService
,
CategoryRepository
categoryRepository
,
AccountService
accountService
,
SettingsRepository
settingsRepository
,
TagRepository
tagRepository
,
RepeatingTransactionUpdater
repeatingTransactionUpdater
,
HelpersService
helpers
,
FilterHelpersService
filterHelpers
)
public
TransactionController
(
TransactionService
transactionService
,
CategoryRepository
categoryRepository
,
AccountService
accountService
,
SettingsRepository
settingsRepository
,
TagRepository
tagRepository
,
RepeatingTransactionUpdater
repeatingTransactionUpdater
,
HelpersService
helpers
,
FilterHelpersService
filterHelpers
)
{
{
this
.
transactionRepository
=
transactionRepository
;
this
.
transactionService
=
transactionService
;
this
.
transactionService
=
transactionService
;
this
.
categoryRepository
=
categoryRepository
;
this
.
categoryRepository
=
categoryRepository
;
this
.
accountService
=
accountService
;
this
.
accountService
=
accountService
;
...
@@ -81,7 +79,7 @@ public class TransactionController extends BaseController
...
@@ -81,7 +79,7 @@ public class TransactionController extends BaseController
DateTime
date
=
helpers
.
getDateTimeFromCookie
(
cookieDate
);
DateTime
date
=
helpers
.
getDateTimeFromCookie
(
cookieDate
);
prepareModelTransactions
(
request
,
model
,
date
);
prepareModelTransactions
(
request
,
model
,
date
);
model
.
addAttribute
(
"currentTransaction"
,
transactionRepository
.
getOne
(
ID
));
model
.
addAttribute
(
"currentTransaction"
,
transaction
Service
.
get
Repository
()
.
getOne
(
ID
));
return
"transactions/transactions"
;
return
"transactions/transactions"
;
}
}
...
@@ -245,14 +243,14 @@ public class TransactionController extends BaseController
...
@@ -245,14 +243,14 @@ public class TransactionController extends BaseController
return
url
;
return
url
;
}
}
transactionRepository
.
save
(
transaction
);
transaction
Service
.
get
Repository
()
.
save
(
transaction
);
return
"redirect:/transactions"
;
return
"redirect:/transactions"
;
}
}
@RequestMapping
(
"/transactions/{ID}/edit"
)
@RequestMapping
(
"/transactions/{ID}/edit"
)
public
String
editTransaction
(
Model
model
,
@CookieValue
(
"currentDate"
)
String
cookieDate
,
@PathVariable
(
"ID"
)
Integer
ID
)
public
String
editTransaction
(
Model
model
,
@CookieValue
(
"currentDate"
)
String
cookieDate
,
@PathVariable
(
"ID"
)
Integer
ID
)
{
{
Transaction
transaction
=
transactionRepository
.
findOne
(
ID
);
Transaction
transaction
=
transaction
Service
.
get
Repository
()
.
findOne
(
ID
);
if
(
transaction
==
null
)
if
(
transaction
==
null
)
{
{
throw
new
ResourceNotFoundException
();
throw
new
ResourceNotFoundException
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment