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
94b61059
Commit
94b61059
authored
Sep 20, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
obrisani souti i uredjen kod malo
parent
4ff6a1b9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
10 deletions
+24
-10
SkuciSe/src/main/java/com/example/SkuciSe/controller/AdminController.java
+6
-2
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
+2
-0
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppRestController.java
+2
-0
SkuciSe/src/main/java/com/example/SkuciSe/controller/KomentarController.java
+5
-1
SkuciSe/src/main/java/com/example/SkuciSe/controller/LajkController.java
+1
-0
SkuciSe/src/main/java/com/example/SkuciSe/controller/ProfileController.java
+2
-0
SkuciSe/src/main/java/com/example/SkuciSe/controller/ZahtevController.java
+5
-2
SkuciSe/src/main/java/com/example/SkuciSe/repository/LajkRepository.java
+0
-2
SkuciSe/src/main/java/com/example/SkuciSe/repository/OglasRepository.java
+1
-2
SkuciSe/src/main/java/com/example/SkuciSe/repository/ZahtevRepository.java
+0
-1
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/AdminController.java
View file @
94b61059
...
@@ -20,18 +20,22 @@ public class AdminController
...
@@ -20,18 +20,22 @@ public class AdminController
{
{
@Autowired
@Autowired
KomentarRepository
komRepo
;
KomentarRepository
komRepo
;
@Autowired
@Autowired
KorisnikRepository
kRepo
;
KorisnikRepository
kRepo
;
@Autowired
LokacijaRepository
lRepo
;
@Autowired
@Autowired
OglasRepository
oRepo
;
OglasRepository
oRepo
;
@Autowired
@Autowired
ZahtevRepository
zRepo
;
ZahtevRepository
zRepo
;
@Autowired
@Autowired
LajkRepository
lajkRepo
;
LajkRepository
lajkRepo
;
@Autowired
@Autowired
KomentarVlasnikRepository
komentarVlasnikRepo
;
KomentarVlasnikRepository
komentarVlasnikRepo
;
@GetMapping
(
"/lista-korisnika"
)
@GetMapping
(
"/lista-korisnika"
)
public
String
getListaKorisnika
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
public
String
getListaKorisnika
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
View file @
94b61059
...
@@ -24,6 +24,7 @@ public class AppController
...
@@ -24,6 +24,7 @@ public class AppController
{
{
@Autowired
@Autowired
KorisnikRepository
kRepo
;
KorisnikRepository
kRepo
;
@Autowired
@Autowired
LokacijaRepository
lRepo
;
LokacijaRepository
lRepo
;
...
@@ -68,6 +69,7 @@ public class AppController
...
@@ -68,6 +69,7 @@ public class AppController
return
(
"register"
);
return
(
"register"
);
}
}
}
}
@GetMapping
(
"/onama"
)
@GetMapping
(
"/onama"
)
public
String
getOnama
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
public
String
getOnama
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppRestController.java
View file @
94b61059
...
@@ -14,8 +14,10 @@ public class AppRestController
...
@@ -14,8 +14,10 @@ public class AppRestController
{
{
@Autowired
@Autowired
KorisnikRepository
kRepo
;
KorisnikRepository
kRepo
;
@Autowired
@Autowired
LokacijaRepository
lRepo
;
LokacijaRepository
lRepo
;
@GetMapping
(
"/listLokacija"
)
@GetMapping
(
"/listLokacija"
)
public
List
<
Lokacija
>
getRegister
()
public
List
<
Lokacija
>
getRegister
()
{
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/KomentarController.java
View file @
94b61059
...
@@ -10,13 +10,17 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -10,13 +10,17 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
@Controller
@Controller
public
class
KomentarController
{
public
class
KomentarController
{
@Autowired
@Autowired
KomentarRepository
komentarRepo
;
KomentarRepository
komentarRepo
;
@Autowired
@Autowired
ZahtevRepository
zRepo
;
ZahtevRepository
zRepo
;
@Autowired
@Autowired
KomentarVlasnikRepository
komentarVlasnikRepo
;
KomentarVlasnikRepository
komentarVlasnikRepo
;
@GetMapping
(
"/profile/moji-zahtevi/sacuvaj-komentar"
)
@GetMapping
(
"/profile/moji-zahtevi/sacuvaj-komentar"
)
public
String
postSacuvajKomentar
(
@RequestParam
(
"korisnikId"
)
int
korisnikId
,
public
String
postSacuvajKomentar
(
@RequestParam
(
"korisnikId"
)
int
korisnikId
,
@RequestParam
(
"oglasId"
)
int
oglasId
,
@RequestParam
(
"oglasId"
)
int
oglasId
,
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/LajkController.java
View file @
94b61059
...
@@ -16,6 +16,7 @@ public class LajkController
...
@@ -16,6 +16,7 @@ public class LajkController
{
{
@Autowired
@Autowired
LajkRepository
lajkRepo
;
LajkRepository
lajkRepo
;
@GetMapping
(
"/lajkuj-oglas/{oglasId}"
)
@GetMapping
(
"/lajkuj-oglas/{oglasId}"
)
public
String
postLajkujOglas
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@PathVariable
(
"oglasId"
)
int
oglasId
)
public
String
postLajkujOglas
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@PathVariable
(
"oglasId"
)
int
oglasId
)
{
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/ProfileController.java
View file @
94b61059
...
@@ -35,8 +35,10 @@ public class ProfileController
...
@@ -35,8 +35,10 @@ public class ProfileController
@Autowired
@Autowired
KomentarRepository
komRepo
;
KomentarRepository
komRepo
;
@Autowired
@Autowired
KomentarVlasnikRepository
komentarVlasnikRepo
;
KomentarVlasnikRepository
komentarVlasnikRepo
;
@GetMapping
(
"/profile"
)
@GetMapping
(
"/profile"
)
public
String
getProfile
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
public
String
getProfile
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/controller/ZahtevController.java
View file @
94b61059
...
@@ -26,14 +26,17 @@ import java.util.Date;
...
@@ -26,14 +26,17 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
@Controller
@Controller
public
class
ZahtevController
{
public
class
ZahtevController
{
@Autowired
@Autowired
ZahtevRepository
zRepo
;
ZahtevRepository
zRepo
;
@Autowired
@Autowired
OglasRepository
oRepo
;
OglasRepository
oRepo
;
@Autowired
@Autowired
SlikeRepository
sRepo
;
SlikeRepository
sRepo
;
@Autowired
@Autowired
KorisnikRepository
kRepo
;
KorisnikRepository
kRepo
;
...
...
SkuciSe/src/main/java/com/example/SkuciSe/repository/LajkRepository.java
View file @
94b61059
...
@@ -25,12 +25,10 @@ public class LajkRepository {
...
@@ -25,12 +25,10 @@ public class LajkRepository {
{
{
if
(
this
.
isLiked
(
lajk
))
if
(
this
.
isLiked
(
lajk
))
{
{
System
.
out
.
println
(
"delete "
+
lajk
.
toString
());
this
.
deleteLajk
(
lajk
);
this
.
deleteLajk
(
lajk
);
}
}
else
else
{
{
System
.
out
.
println
(
"insert "
+
lajk
.
toString
());
this
.
insertLajk
(
lajk
);
this
.
insertLajk
(
lajk
);
}
}
}
}
...
...
SkuciSe/src/main/java/com/example/SkuciSe/repository/OglasRepository.java
View file @
94b61059
...
@@ -226,8 +226,7 @@ public class OglasRepository
...
@@ -226,8 +226,7 @@ public class OglasRepository
if
(!(
pretraga
==
null
||
(
pretraga
!=
null
&&
oglas
.
getNaslov
().
toLowerCase
().
contains
(
pretraga
.
toLowerCase
())
)
)
)
continue
;
if
(!(
pretraga
==
null
||
(
pretraga
!=
null
&&
oglas
.
getNaslov
().
toLowerCase
().
contains
(
pretraga
.
toLowerCase
())
)
)
)
continue
;
else
if
(!(
pretraga
==
null
||
(
pretraga
!=
null
&&
oglas
.
getOpis
().
toLowerCase
().
contains
(
pretraga
.
toLowerCase
())
)
)
)
continue
;
else
if
(!(
pretraga
==
null
||
(
pretraga
!=
null
&&
oglas
.
getOpis
().
toLowerCase
().
contains
(
pretraga
.
toLowerCase
())
)
)
)
continue
;
;
System
.
out
.
println
(
oglas
.
toString
());
list
.
add
(
oglas
);
list
.
add
(
oglas
);
}
}
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
...
...
SkuciSe/src/main/java/com/example/SkuciSe/repository/ZahtevRepository.java
View file @
94b61059
...
@@ -26,7 +26,6 @@ public class ZahtevRepository {
...
@@ -26,7 +26,6 @@ public class ZahtevRepository {
provera
.
setInt
(
2
,
oglasId
);
provera
.
setInt
(
2
,
oglasId
);
ResultSet
rs
=
provera
.
executeQuery
();
ResultSet
rs
=
provera
.
executeQuery
();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
System
.
out
.
println
(
rs
.
getString
(
"stanje"
));
throw
new
AktivanZahtevPostoji
();
throw
new
AktivanZahtevPostoji
();
}
}
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
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