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
605dc3c8
Commit
605dc3c8
authored
Sep 02, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update back - finished
parent
7eff757e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
+7
-2
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
+0
-1
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
View file @
605dc3c8
...
...
@@ -75,8 +75,13 @@ public class AppController
return
"redirect:/profile"
;
}
@PostMapping
(
"/picture-update"
)
public
String
izmeniSliku
(
@AuthenticationPrincipal
KorisnikDetails
korisnik
,
@RequestParam
(
"image"
)
MultipartFile
file
)
throws
IOException
{
kRepo
.
updateSlika
(
korisnik
.
getKorisnik
(),
file
);
public
String
izmeniSliku
(
@AuthenticationPrincipal
KorisnikDetails
loggedUser
,
@RequestParam
(
"image"
)
MultipartFile
file
)
{
kRepo
.
updateSlika
(
loggedUser
.
getKorisnik
(),
file
);
try
{
loggedUser
.
setKorisnikSlika
(
Base64
.
getEncoder
().
encodeToString
(
file
.
getBytes
()));
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
"redirect:/profile"
;
}
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
View file @
605dc3c8
...
...
@@ -64,7 +64,6 @@ public class KorisnikRepository
slika
=
Base64
.
getEncoder
().
encodeToString
(
file
.
getBytes
());
sql
=
" update korisnik "
+
" set slika = '"
+
slika
+
"' where korisnikid = "
+
korisnik
.
getKorisnikId
();
System
.
out
.
println
(
sql
);
statement
.
executeUpdate
(
sql
);
}
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