Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SkuciSe
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim 2 - 2022
SkuciSe
Commits
f37547c0
Commit
f37547c0
authored
Aug 31, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bogdan 1
parent
db383a6e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
0 deletions
+145
-0
SkuciSe/src/main/java/com/example/SkuciSe/model/Korisnik.java
+46
-0
SkuciSe/src/main/java/com/example/SkuciSe/model/Oglas.java
+49
-0
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
+25
-0
SkuciSe/src/main/java/com/example/SkuciSe/repository/OglasRepository.java
+25
-0
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/model/Korisnik.java
0 → 100644
View file @
f37547c0
package
com
.
example
.
SkuciSe
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public
class
Korisnik
{
int
korisnikId
;
String
ime
;
String
prezime
;
String
email
;
String
sifra
;
String
telefon
;
int
tipId
;
String
slika
;
public
Korisnik
(
String
ime
,
String
prezime
,
String
email
,
String
sifra
,
String
telefon
,
int
tipId
,
String
slika
)
{
this
.
ime
=
ime
;
this
.
prezime
=
prezime
;
this
.
email
=
email
;
this
.
sifra
=
sifra
;
this
.
telefon
=
telefon
;
this
.
tipId
=
tipId
;
this
.
slika
=
slika
;
}
@Override
public
String
toString
()
{
return
"Korisnik{"
+
"korisnikId="
+
korisnikId
+
", ime='"
+
ime
+
'\''
+
", prezime='"
+
prezime
+
'\''
+
", email='"
+
email
+
'\''
+
", sifra='"
+
sifra
+
'\''
+
", telefon='"
+
telefon
+
'\''
+
", tipId="
+
tipId
+
", slika='"
+
slika
+
'\''
+
'}'
;
}
}
SkuciSe/src/main/java/com/example/SkuciSe/model/Oglas.java
0 → 100644
View file @
f37547c0
package
com
.
example
.
SkuciSe
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public
class
Oglas
{
int
oglasId
;
int
korisnikId
;
String
naslov
;
String
opis
;
String
lokacija
;
int
gradId
;
double
cena
;
double
kvadratura
;
int
vrstaOglasaId
;
public
Oglas
(
int
korisnikId
,
String
naslov
,
String
opis
,
String
lokacija
,
int
gradId
,
double
cena
,
double
kvadratura
,
int
vrstaOglasaId
)
{
this
.
korisnikId
=
korisnikId
;
this
.
naslov
=
naslov
;
this
.
opis
=
opis
;
this
.
lokacija
=
lokacija
;
this
.
gradId
=
gradId
;
this
.
cena
=
cena
;
this
.
kvadratura
=
kvadratura
;
this
.
vrstaOglasaId
=
vrstaOglasaId
;
}
@Override
public
String
toString
()
{
return
"Oglas{"
+
"oglasId="
+
oglasId
+
", korisnikId="
+
korisnikId
+
", naslov='"
+
naslov
+
'\''
+
", opis='"
+
opis
+
'\''
+
", lokacija='"
+
lokacija
+
'\''
+
", gradId="
+
gradId
+
", cena="
+
cena
+
", kvadratura="
+
kvadratura
+
", vrstaOglasaId="
+
vrstaOglasaId
+
'}'
;
}
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
0 → 100644
View file @
f37547c0
package
com
.
example
.
SkuciSe
.
repository
;
import
org.springframework.stereotype.Component
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
@Component
public
class
KorisnikRepository
{
Connection
connection
=
null
;
Statement
statement
=
null
;
public
KorisnikRepository
()
{
try
{
connection
=
DriverManager
.
getConnection
(
"jdbc:mariadb://localhost/skucise"
,
"root"
,
""
);
statement
=
connection
.
createStatement
();
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/OglasRepository.java
0 → 100644
View file @
f37547c0
package
com
.
example
.
SkuciSe
.
repository
;
import
org.springframework.stereotype.Component
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
@Component
public
class
OglasRepository
{
Connection
connection
=
null
;
Statement
statement
=
null
;
public
OglasRepository
()
{
try
{
connection
=
DriverManager
.
getConnection
(
"jdbc:mariadb://localhost/skucise"
,
"root"
,
""
);
statement
=
connection
.
createStatement
();
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
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