checkStation also adds the rankingPoints to the users current score after the cache is done and saves it in user_info
This commit is contained in:
parent
e235a72c08
commit
5845f85c65
@ -44,6 +44,9 @@ public class Controller {
|
|||||||
@Autowired
|
@Autowired
|
||||||
UserRepository userRepository;
|
UserRepository userRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
User_InfoRepository user_infoRepository;
|
||||||
|
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
@ -288,8 +291,20 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CacheAccesDefinition cacheAccesDefinition = (CacheAccesDefinition) getCacheAccesDefinition.getBody();
|
CacheAccesDefinition cacheAccesDefinition = (CacheAccesDefinition) getCacheAccesDefinition.getBody();
|
||||||
bearbeitet.setCacheAccesDefinition(cacheAccesDefinition);
|
|
||||||
//----------------------
|
//----------------------
|
||||||
|
bearbeitet.setCacheAccesDefinition(cacheAccesDefinition);
|
||||||
|
//Get User_Info
|
||||||
|
ResponseEntity getUser_Info = FinderUtil.findUser_InfoByID(String.valueOf(user.getId()));
|
||||||
|
|
||||||
|
if (getUser_Info.getStatusCodeValue() != 200) {
|
||||||
|
return getUser_Info;
|
||||||
|
}
|
||||||
|
|
||||||
|
User_Info user_info = (User_Info) getUser_Info.getBody();
|
||||||
|
//----------------------
|
||||||
|
user_info.setRankingPointsSum(user_info.getRankingPointsSum() + cache.getRankingPoints());
|
||||||
|
user_infoRepository.save(user_info);
|
||||||
|
bearbeitetRepository.save(bearbeitet);
|
||||||
}
|
}
|
||||||
return ResponseEntity.status(200).body(new Gson().toJson(bearbeitet));
|
return ResponseEntity.status(200).body(new Gson().toJson(bearbeitet));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user