Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_mszczonow_3
Overview
Overview
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
Patryk Czarnik
alx_mszczonow_3
Commits
e26c03e2
Commit
e26c03e2
authored
Jul 25, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adres na poziomie klasy a @GetMapping w kodzie
parent
43f23650
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
KalkulatorController.java
src/main/java/alx/kalkulator/KalkulatorController.java
+4
-3
No files found.
src/main/java/alx/kalkulator/KalkulatorController.java
View file @
e26c03e2
...
@@ -7,14 +7,15 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -7,14 +7,15 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@Controller
@Controller
@RequestMapping
(
"/kalkulator"
)
public
class
KalkulatorController
{
public
class
KalkulatorController
{
@GetMapping
(
"/kalkulator"
)
@GetMapping
public
String
kalkulatorGet
()
{
public
String
kalkulatorGet
()
{
return
"kalkulator.html"
;
return
"kalkulator.html"
;
}
}
@PostMapping
@PostMapping
(
"/kalkulator"
)
public
String
kalkulator
(
Long
liczba1
,
Long
liczba2
,
String
operacja
,
Model
model
)
{
public
String
kalkulator
(
Long
liczba1
,
Long
liczba2
,
String
operacja
,
Model
model
)
{
Long
wynik
=
switch
(
operacja
)
{
Long
wynik
=
switch
(
operacja
)
{
case
"+"
->
liczba1
+
liczba2
;
case
"+"
->
liczba1
+
liczba2
;
...
...
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