Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Álvaro Herrera Arjonilla
/
f1_spark
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Merge Requests
0
Pipelines
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4aa37afb
authored
Apr 13, 2023
by
Elena Carmona Vallecillo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Elena
parent
ce36df89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
src/main/java/com/example/demo/AppConfig.java
src/main/java/com/example/demo/CircuitoService.java
src/main/java/com/example/demo/SparkRest.java
src/main/java/com/example/demo/AppConfig.java
View file @
4aa37afb
...
@@ -18,6 +18,10 @@ public class AppConfig {
...
@@ -18,6 +18,10 @@ public class AppConfig {
modelo
.
put
(
"nombre"
,
nombre
);
modelo
.
put
(
"nombre"
,
nombre
);
return
new
ModelAndView
(
modelo
,
"hello.jsp"
);
return
new
ModelAndView
(
modelo
,
"hello.jsp"
);
});
});
get
(
"/hello/:name"
,
(
req
,
res
)
->
{
return
"Hello: "
+
req
.
params
(
":name"
);
});
}
}
}
}
src/main/java/com/example/demo/CircuitoService.java
View file @
4aa37afb
...
@@ -3,13 +3,13 @@ import java.util.Collection;
...
@@ -3,13 +3,13 @@ import java.util.Collection;
public
interface
CircuitoService
public
interface
CircuitoService
{
{
public
void
addCircuito
(
Circuito
user
);
public
void
addCircuito
(
Circuito
circuito
);
public
Collection
<
Circuito
>
getCircuitos
();
public
Collection
<
Circuito
>
getCircuitos
();
public
Circuito
getCircuito
(
String
id
);
public
Circuito
getCircuito
(
String
id
);
public
Circuito
editCircuito
(
Circuito
user
)
throws
CircuitoException
;
public
Circuito
editCircuito
(
Circuito
circuito
)
throws
CircuitoException
;
public
void
deleteCircuito
(
String
id
);
public
void
deleteCircuito
(
String
id
);
...
...
src/main/java/com/example/demo/SparkRest.java
View file @
4aa37afb
package
com
.
example
.
demo
;
package
com
.
example
.
demo
;
import
static
spark
.
Spark
.
delete
;
import
static
spark
.
Spark
.
get
;
import
static
spark
.
Spark
.
options
;
import
static
spark
.
Spark
.
post
;
import
static
spark
.
Spark
.
put
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
static
spark
.
Spark
.*;
public
class
SparkRest
public
class
SparkRest
{
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
port
(
8088
);
final
CircuitoService
circuitoService
=
new
CircuitoServiceMapImpl
()
final
CircuitoService
circuitoService
=
new
CircuitoServiceMapImpl
()
{};
{};
...
...
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