Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "/entries/lastentrance",
- method = RequestMethod.GET,
- produces = MediaType.APPLICATION_JSON_VALUE)
- @Timed
- public ResponseEntity<Entry> getLastEntrance(@PathVariable Long id) {
- log.debug("REST request to get Entry : {}", id);
- Entry entry = entryRepository.findMostRecentEntrance(id);
- return Optional.ofNullable(entry)
- .map(result -> new ResponseEntity<>(
- result,
- HttpStatus.OK))
- .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
- }
- @Query("select e from Entry e WHERE id=(SELECT max(id) FROM Entry)")
- Entry findMostRecentEntrance(Long id);
- (function() {
- 'use strict';
- angular
- .module('rapidApp')
- .controller('HomeController', HomeController);
- HomeController.$inject = ['$scope', 'Principal', 'LoginService', 'Entry'];
- function HomeController ($scope, Principal, LoginService, Entry) {
- var vm = this;
- vm.account = null;
- vm.isAuthenticated = null;
- vm.login = LoginService.open;
- $scope.$on('authenticationSuccess', function() {
- getAccount();
- });
- getAccount();
- function getAccount() {
- Principal.identity().then(function(account) {
- vm.account = account;
- vm.isAuthenticated = Principal.isAuthenticated;
- });
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement