Merge branch 'develop' into frontend/timo
This commit is contained in:
commit
d0c2852d4a
20
aaa.html
Normal file
20
aaa.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>BuGa Lageplan</title>
|
||||||
|
<script src="/config.js"></script>
|
||||||
|
<!--get local copy of openlayers javascript file-->
|
||||||
|
<script src="/scripts/ol.js"></script>
|
||||||
|
<!--get openlayers support javascript file-->
|
||||||
|
<script src="/scripts/mapScript.js"></script>
|
||||||
|
<link rel="stylesheet" href="/stylesheets/map.css">
|
||||||
|
<link rel="stylesheet" href="/stylesheets/style.css">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body class="fullscreen">
|
||||||
|
<div id="map" class="map fullscreen"></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
const map = createMapFromPoiSet([{"Name":"Wolfszipfel_Station1","Latitude":49.14709,"Longitude":9.208993,"CategoryID":0},{"Name":"Live Demo Cache_Station1","Latitude":49,"Longitude":9,"CategoryID":0},{"Name":"GeoCaching für alle_Station1","Latitude":49,"Longitude":9,"CategoryID":0},{"Name":"Test Cache_Station1","Latitude":49.1,"Longitude":9.207,"CategoryID":0},{"Name":"GeoCaching für alle_Station2","Latitude":49,"Longitude":9,"CategoryID":1},{"Name":"GeoCaching für alle_Station3","Latitude":49,"Longitude":9,"CategoryID":1},{"Name":"GeoCaching für alle_Station4","Latitude":49,"Longitude":9,"CategoryID":1},{"Name":"GeoCaching für alle_Station5","Latitude":49,"Longitude":9,"CategoryID":1}]);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -58,6 +58,9 @@ dependencies {
|
|||||||
|
|
||||||
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.0.2'
|
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.0.2'
|
||||||
|
|
||||||
|
// https://mvnrepository.com/artifact/com.mashape.unirest/unirest-java
|
||||||
|
compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.3.1'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
node {
|
node {
|
||||||
|
|||||||
@ -111,12 +111,12 @@ module.exports = function (ctx) {
|
|||||||
? { // Base URL for API-Calls: DEV
|
? { // Base URL for API-Calls: DEV
|
||||||
API: JSON.stringify('http://localhost:8080'),
|
API: JSON.stringify('http://localhost:8080'),
|
||||||
// API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19geocaching'),
|
// API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19geocaching'),
|
||||||
USER_API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19usermanagement')
|
USER_API: JSON.stringify('https://seserver.se.hs-heilbronn.de:9443/buga19usermanagement')
|
||||||
}
|
}
|
||||||
: { // Base URL for API-Calls: PRODUCTION (build)
|
: { // Base URL for API-Calls: PRODUCTION (build)
|
||||||
API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19geocaching'),
|
API: JSON.stringify('http://localhost:8080'),
|
||||||
USER_API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19usermanagement')
|
//API: JSON.stringify('https://seserver.se.hs-heilbronn.de:8443/buga19geocaching'),
|
||||||
//API: JSON.stringify('http://localhost:8080')
|
USER_API: JSON.stringify('https://seserver.se.hs-heilbronn.de:9443/buga19usermanagement')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<q-img transition="fade"
|
<iframe transition="fade"
|
||||||
class="q-mb-md "
|
class="q-mb-md "
|
||||||
:ratio="16/9"
|
height= "200px"
|
||||||
src="https://www.buga2019.de/we-bilder/3.Gartenausstellung/Gelaendeplan/190320_Gelaendeplan-quadratisch.jpg"
|
width= "100%"
|
||||||
v-if="!cameraActive"
|
v-if="!cameraActive"
|
||||||
></q-img>
|
:src= "iFrameURL" frameborder="0"></iframe>
|
||||||
<div v-if="!cameraActive" class="q-ma-md">
|
<div v-if="!cameraActive" class="q-ma-md">
|
||||||
<p class="text-h4">{{ cacheName }}</p>
|
<p class="text-h4">{{ cacheName }}</p>
|
||||||
<p>{{ instruction }}</p>
|
<p>{{ instruction }}</p>
|
||||||
@ -21,13 +21,27 @@
|
|||||||
name: "CacheStart",
|
name: "CacheStart",
|
||||||
components: {qrscanner},
|
components: {qrscanner},
|
||||||
data() {
|
data() {
|
||||||
return { //TODO Lageplan einbinden
|
return {
|
||||||
result: null,
|
result: null,
|
||||||
cameraActive: false,
|
cameraActive: false,
|
||||||
cacheID: "",
|
cacheID: "",
|
||||||
cacheName: "",
|
cacheName: "",
|
||||||
//code: "8/7",
|
//code: "8/7",
|
||||||
instruction: "Bitte begib Dich zu der auf der Karte angezeigten Position. An dieser Position wirst Du einen QR-Code finden. Wenn du ihn gefunden hast, drücke den Knopf zum Starten des QR-Scanners und gib uns die Berechtigung, Deine Kamera zu öffnen. Nachdem Du den QR-Code gescannt hast, erhältst du ein Rätsel zur Position der nächsten Station. Die Lösung zu dem Rätsel ist also das Versteck des nächsten QR-Codes.",
|
instruction: "Bitte begib Dich zu der auf der Karte angezeigten Position. An dieser Position wirst Du einen QR-Code finden. Wenn du ihn gefunden hast, drücke den Knopf zum Starten des QR-Scanners und gib uns die Berechtigung, Deine Kamera zu öffnen. Nachdem Du den QR-Code gescannt hast, erhältst du ein Rätsel zur Position der nächsten Station. Die Lösung zu dem Rätsel ist also das Versteck des nächsten QR-Codes.",
|
||||||
|
// Following Params belong to QR-Code Scanner
|
||||||
|
askForPermission: true,
|
||||||
|
activateCamera: false,
|
||||||
|
isValid: false,
|
||||||
|
validating: false,
|
||||||
|
loading: false,
|
||||||
|
paused: false,
|
||||||
|
params: null,
|
||||||
|
noStreamApiSupport: false,
|
||||||
|
lon: "",
|
||||||
|
lat: "",
|
||||||
|
stationID: [],
|
||||||
|
iFrameURL: ""
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -42,8 +56,40 @@
|
|||||||
const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache));
|
const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache));
|
||||||
this.cacheName = cache.name;
|
this.cacheName = cache.name;
|
||||||
this.cacheID = this.$route.params.cache;
|
this.cacheID = this.$route.params.cache;
|
||||||
|
this.stationID = cache.stationen[0];
|
||||||
|
this.lon = this.stationID.longitude;
|
||||||
|
this.lat = this.stationID.lattitude;
|
||||||
|
this.iFrameURL = `http://www.se.hs-heilbronn.de:3000/api/map/lon=${this.lon}&lat=${this.lat}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
checkStation() {
|
||||||
|
let params = this.setParams();
|
||||||
|
console.log(params);
|
||||||
|
this.$axios.get('/api/checkStation', {params})
|
||||||
|
.then((response) => {
|
||||||
|
console.log(response);
|
||||||
|
console.log("Anfrage erfolgreich");
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
console.log("Anfrage fehlgeschlagen");
|
||||||
|
})
|
||||||
|
this.$router.push({path: `/station/${params.cacheID}/${params.stationID}`})
|
||||||
|
},
|
||||||
|
|
||||||
|
setParams() {
|
||||||
|
console.log("setParams: ");
|
||||||
|
let params = {};
|
||||||
|
params.cacheID = this.result.split('/')[0];
|
||||||
|
params.stationID = this.result.split('/')[1];
|
||||||
|
params.durchgefuehrterCacheID = this.cacheID;
|
||||||
|
console.log("CacheID: " + params.cacheID + " und StationID: " + params.stationID);
|
||||||
|
console.log(params.durchgefuehrterCacheID);
|
||||||
|
if (localStorage.getItem('userToken')) {
|
||||||
|
params.token = JSON.parse(localStorage.getItem('userToken')).token;
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
},
|
||||||
|
|
||||||
updateResult(event) {
|
updateResult(event) {
|
||||||
console.log("updateResult()");
|
console.log("updateResult()");
|
||||||
|
|||||||
@ -93,6 +93,8 @@
|
|||||||
return {
|
return {
|
||||||
tab: 'list',
|
tab: 'list',
|
||||||
caches: [],
|
caches: [],
|
||||||
|
stations: [],
|
||||||
|
pois: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@ -116,8 +118,19 @@
|
|||||||
fetchAllCaches() {
|
fetchAllCaches() {
|
||||||
this.$axios.get('/api/allCaches')
|
this.$axios.get('/api/allCaches')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("Caches: " + this.caches);
|
|
||||||
this.caches = response.data;
|
this.caches = response.data;
|
||||||
|
for(let cache in this.caches) {
|
||||||
|
|
||||||
|
this.stations[cache]=(this.caches[cache].stationen[0]);
|
||||||
|
const poiItem = {
|
||||||
|
Name: this.caches[cache].name,
|
||||||
|
CategoryID: 3,
|
||||||
|
Latitude: this.stations[cache].lattitude,
|
||||||
|
Longitude: this.stations[cache].longitude
|
||||||
|
};
|
||||||
|
this.pois.push(poiItem);
|
||||||
|
}
|
||||||
|
this.initMap();
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
let message;
|
let message;
|
||||||
let header = "Fehler: ";
|
let header = "Fehler: ";
|
||||||
@ -146,9 +159,23 @@
|
|||||||
},
|
},
|
||||||
editCache() {
|
editCache() {
|
||||||
},
|
},
|
||||||
|
initMap(){
|
||||||
|
console.log("Signalwort: " + this.pois);
|
||||||
|
// this.$axios.post('http://seserver.se.hs-heilbronn.de:3000/api/map', {
|
||||||
|
// body: this.pois
|
||||||
|
// }).then((response)=>{
|
||||||
|
// console.log(response)
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
this.$axios.get('http://www.se.hs-heilbronn.de:3000/api/map/lon=9&lat=49', {
|
||||||
|
body: this.pois
|
||||||
|
}).then((response)=>{
|
||||||
|
console.log(response)
|
||||||
|
})
|
||||||
|
},
|
||||||
deleteCache(id) {
|
deleteCache(id) {
|
||||||
console.log('delete cache: ' + id);
|
console.log('delete cache: ' + id);
|
||||||
this.$axios.get('/api/deleteCache', {params: {cacheID: id}})
|
axios.get('/api/deleteCache', {params: {cacheID: id}})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.fetchAllCaches()
|
this.fetchAllCaches()
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
|||||||
@ -36,13 +36,13 @@
|
|||||||
|
|
||||||
<q-tab-panel name="team" class=" fit">
|
<q-tab-panel name="team" class=" fit">
|
||||||
<q-list>
|
<q-list>
|
||||||
<q-card class="q-mb-md">
|
<q-card class="q-mb-md" v-for="(team,index) in teamRankinglist" :key="team.id">
|
||||||
<q-item class="q-pr-sm ">
|
<q-item class="q-pr-sm ">
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>Single line item</q-item-label>
|
<q-item-label><a class="text-black" style="text-decoration: none"><span>{{index+1}}. {{team.teamname}}</span></a></q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<span class="text-grey"> Punkte </span>
|
<span class="text-grey">{{team.rankingPointsSum}} Punkte </span>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-card>
|
</q-card>
|
||||||
@ -68,12 +68,15 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tab: 'solo',
|
tab: 'solo',
|
||||||
rankinglist: []
|
rankinglist: [],
|
||||||
|
teamRankinglist: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function() {
|
created: function() {
|
||||||
console.log("created(): " + this.rankinglist);
|
console.log("created(): " + this.rankinglist);
|
||||||
|
console.log("created(): " + this.teamRankinglist);
|
||||||
this.fetchRankinglist();
|
this.fetchRankinglist();
|
||||||
|
this.fetchTeamRankinglist();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchRankinglist() {
|
fetchRankinglist() {
|
||||||
@ -104,6 +107,35 @@
|
|||||||
console.log(error.config);
|
console.log(error.config);
|
||||||
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
fetchTeamRankinglist() {
|
||||||
|
this.$axios.get('/api/getTeamRankingList')
|
||||||
|
.then((response) => {
|
||||||
|
console.log("Team-Rankinglist: ");
|
||||||
|
console.log(response.data);
|
||||||
|
this.teamRankinglist = response.data;
|
||||||
|
}).catch((error) => {
|
||||||
|
// Error
|
||||||
|
let msg;
|
||||||
|
let title;
|
||||||
|
if (error.response) {
|
||||||
|
// The request was made and the server responded with a status code
|
||||||
|
title = "Problem with response!";
|
||||||
|
msg = error.response;
|
||||||
|
} else if (error.request) {
|
||||||
|
// The request was made but no response was received
|
||||||
|
title = "Problem with request!";
|
||||||
|
msg = "Error occured due to wrong server request!"
|
||||||
|
console.log(error.request);
|
||||||
|
} else {
|
||||||
|
// Something happened in setting up the request that triggered an Error
|
||||||
|
title = "Error";
|
||||||
|
msg = error.message;
|
||||||
|
console.log('Error', error.message);
|
||||||
|
}
|
||||||
|
console.log(error.config);
|
||||||
|
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: msg, title: title, });
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package hhn.labsw.bugageocaching.controller;
|
package hhn.labsw.bugageocaching.controller;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.mashape.unirest.http.exceptions.UnirestException;
|
||||||
import hhn.labsw.bugageocaching.entities.*;
|
import hhn.labsw.bugageocaching.entities.*;
|
||||||
import hhn.labsw.bugageocaching.helper.POI;
|
import hhn.labsw.bugageocaching.helper.POI;
|
||||||
import hhn.labsw.bugageocaching.helper.RankingListHelper;
|
import hhn.labsw.bugageocaching.helper.RankingListHelper;
|
||||||
@ -57,7 +58,7 @@ public class Controller {
|
|||||||
TeamInviteRepository teamInviteRepository;
|
TeamInviteRepository teamInviteRepository;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init(){
|
||||||
fetchPublicKey();
|
fetchPublicKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +379,7 @@ public class Controller {
|
|||||||
@ApiResponse(code = 404, message = "Database error")
|
@ApiResponse(code = 404, message = "Database error")
|
||||||
})
|
})
|
||||||
@CrossOrigin(origins = "*", allowedHeaders = "*") // only for dev purpose
|
@CrossOrigin(origins = "*", allowedHeaders = "*") // only for dev purpose
|
||||||
@RequestMapping(value = "/api/deleteCache", method = RequestMethod.DELETE, produces = "application/json")
|
@RequestMapping(value = "/api/deleteCache", method = {RequestMethod.DELETE, RequestMethod.GET}, produces = "application/json")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity deleteCache(@RequestParam String cacheID) {
|
public ResponseEntity deleteCache(@RequestParam String cacheID) {
|
||||||
return deleteCacheUtil(cacheID);
|
return deleteCacheUtil(cacheID);
|
||||||
@ -544,6 +545,7 @@ public class Controller {
|
|||||||
|
|
||||||
Team team = new Team();
|
Team team = new Team();
|
||||||
team.setName(name);
|
team.setName(name);
|
||||||
|
team.setTeamStatus("");
|
||||||
teamRepository.save(team);
|
teamRepository.save(team);
|
||||||
|
|
||||||
user_info.setTeam(team);
|
user_info.setTeam(team);
|
||||||
@ -950,27 +952,8 @@ public class Controller {
|
|||||||
})
|
})
|
||||||
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
|
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
|
||||||
@RequestMapping(value = "/api/getRankingPlace", method = RequestMethod.GET, produces = "application/json")
|
@RequestMapping(value = "/api/getRankingPlace", method = RequestMethod.GET, produces = "application/json")
|
||||||
public ResponseEntity getRankingPlace(@RequestParam String token) {
|
public ResponseEntity getRankingPlace(@RequestParam String email) {
|
||||||
|
return ResponseEntity.status(200).body(userRepository.getRankingPlaceFromUser(email));
|
||||||
// verify user
|
|
||||||
ResponseEntity verifyToken = VerificationUtil.verifyToken(token);
|
|
||||||
|
|
||||||
if (verifyToken.getStatusCodeValue() != 200) {
|
|
||||||
return verifyToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
//get User
|
|
||||||
Claims claims = (Claims) verifyToken.getBody();
|
|
||||||
|
|
||||||
ResponseEntity getUser = FinderUtil.findUserFromClaim(claims);
|
|
||||||
|
|
||||||
if (getUser.getStatusCodeValue() != 200) {
|
|
||||||
return getUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
User user = (User) getUser.getBody();
|
|
||||||
|
|
||||||
return ResponseEntity.status(200).body(userRepository.getRankingPlaceFromUser(user.getUsername()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "Returns startstations and all other stations the user already visited as POIS")
|
@ApiOperation(value = "Returns startstations and all other stations the user already visited as POIS")
|
||||||
@ -1008,22 +991,26 @@ public class Controller {
|
|||||||
poisList.add(poi);
|
poisList.add(poi);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Bearbeitet bearbeitet : bearbeitetRepository.findAll()) {
|
for (Bearbeitet bearbeitet : bearbeitetRepository.findByUser(user)) {
|
||||||
if (bearbeitet.getUser() == user) {
|
Cache cache = bearbeitet.getCache();
|
||||||
Cache cache = bearbeitet.getCache();
|
Station aktuelleStation = bearbeitet.getAktuelleStation();
|
||||||
Station aktuelleStation = bearbeitet.getAktuelleStation();
|
int index = cache.getStationen().indexOf(aktuelleStation);
|
||||||
int index = cache.getStationen().indexOf(aktuelleStation);
|
for (int i = 1; i <= index; i++) {
|
||||||
for (int i = 1; i <= index; i++) {
|
Station station = cache.getStationen().get(i);
|
||||||
Station station = cache.getStationen().get(i);
|
int categoryID;
|
||||||
int categoryID;
|
if (i < cache.getStationen().size() - 1) { // isnt endstation
|
||||||
if (i < cache.getStationen().size() - 1) { // isnt endstation
|
categoryID = 201;
|
||||||
categoryID = 201;
|
if (i == index) {
|
||||||
} else { // is endstation
|
POI poi = new POI(cache.getName() + "_Station" + (i + 1), (float) station.getLattitude(), (float) station.getLongitude(), categoryID);
|
||||||
categoryID = 203;
|
poisList.add(poi);
|
||||||
}
|
}
|
||||||
|
} else { // is endstation
|
||||||
|
categoryID = 203;
|
||||||
POI poi = new POI(cache.getName() + "_Station" + (i + 1), (float) station.getLattitude(), (float) station.getLongitude(), categoryID);
|
POI poi = new POI(cache.getName() + "_Station" + (i + 1), (float) station.getLattitude(), (float) station.getLongitude(), categoryID);
|
||||||
poisList.add(poi);
|
poisList.add(poi);
|
||||||
}
|
}
|
||||||
|
//POI poi = new POI(cache.getName() + "_Station" + (i + 1), (float) station.getLattitude(), (float) station.getLongitude(), categoryID);
|
||||||
|
//poisList.add(poi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1042,7 +1029,7 @@ public class Controller {
|
|||||||
@ApiResponse(code = 400, message = "Something went wrong at verification")
|
@ApiResponse(code = 400, message = "Something went wrong at verification")
|
||||||
})
|
})
|
||||||
@RequestMapping(value = "/api/getTeamOfUser", method = RequestMethod.GET, produces = "application/json")
|
@RequestMapping(value = "/api/getTeamOfUser", method = RequestMethod.GET, produces = "application/json")
|
||||||
public ResponseEntity getTeamOfUser(@RequestParam String token){
|
public ResponseEntity getTeamOfUser(@RequestParam String token) {
|
||||||
|
|
||||||
// verify user
|
// verify user
|
||||||
ResponseEntity verifyToken = VerificationUtil.verifyToken(token);
|
ResponseEntity verifyToken = VerificationUtil.verifyToken(token);
|
||||||
|
|||||||
@ -6,6 +6,9 @@ import hhn.labsw.bugageocaching.entities.User;
|
|||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface BearbeitetRepository extends JpaRepository<Bearbeitet, Integer> {
|
public interface BearbeitetRepository extends JpaRepository<Bearbeitet, Integer> {
|
||||||
Bearbeitet findByUserAndCache(User user, Cache cache);
|
Bearbeitet findByUserAndCache(User user, Cache cache);
|
||||||
|
List<Bearbeitet> findByUser(User user);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,14 +14,10 @@ public interface TeamRepository extends JpaRepository<Team, Integer> {
|
|||||||
|
|
||||||
@Query(value = "SELECT *\n" +
|
@Query(value = "SELECT *\n" +
|
||||||
"FROM user\n" +
|
"FROM user\n" +
|
||||||
"WHERE id = (\n" +
|
"WHERE id IN (\n" +
|
||||||
" SELECT user_id\n" +
|
" SELECT user_id\n" +
|
||||||
" FROM user_info\n" +
|
" FROM user_info\n" +
|
||||||
" WHERE team_id = (SELECT team_id\n" +
|
" WHERE team_id = (SELECT team_id FROM team WHERE name = ?1))", nativeQuery = true)
|
||||||
" FROM team\n" +
|
|
||||||
" WHERE name = ?1\n" +
|
|
||||||
" )\n" +
|
|
||||||
")", nativeQuery = true)
|
|
||||||
List<Object[]> getTeammembers(String name);
|
List<Object[]> getTeammembers(String name);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,8 @@ public class FinderUtil {
|
|||||||
sendBack.add(tmp);
|
sendBack.add(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseEntity.status(200).body(sendBack);
|
|
||||||
|
return ResponseEntity.status(200).body(list);
|
||||||
} else {
|
} else {
|
||||||
return ResponseEntity.status(404).body("Couldnt find Team member of Team " + name);
|
return ResponseEntity.status(404).body("Couldnt find Team member of Team " + name);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import hhn.labsw.bugageocaching.fetchObjects.PublicKey;
|
|||||||
import io.jsonwebtoken.Claims;
|
import io.jsonwebtoken.Claims;
|
||||||
import io.jsonwebtoken.ExpiredJwtException;
|
import io.jsonwebtoken.ExpiredJwtException;
|
||||||
import io.jsonwebtoken.Jwts;
|
import io.jsonwebtoken.Jwts;
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
@ -17,10 +16,10 @@ public class VerificationUtil {
|
|||||||
|
|
||||||
public static Key publicKey;
|
public static Key publicKey;
|
||||||
|
|
||||||
public static void fetchPublicKey() {
|
public static void fetchPublicKey(){
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
try {
|
try {
|
||||||
PublicKey response = restTemplate.getForObject("http://seserver.se.hs-heilbronn.de:8090/buga19usermanagement/token/publickey", PublicKey.class);
|
PublicKey response = restTemplate.getForObject("http://seserver.se.hs-heilbronn.de:9080/buga19usermanagement/token/publickey", PublicKey.class);
|
||||||
byte[] decodedKey = Base64.getDecoder().decode(response.getMessage());
|
byte[] decodedKey = Base64.getDecoder().decode(response.getMessage());
|
||||||
KeyFactory factory = KeyFactory.getInstance("RSA");
|
KeyFactory factory = KeyFactory.getInstance("RSA");
|
||||||
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(decodedKey);
|
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(decodedKey);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user