Subversion Repositories SmartDukaan

Rev

Rev 25303 | Rev 25436 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25303 Rev 25380
Line 168... Line 168...
168
	}
168
	}
169
 
169
 
170
	private String getAndroidId(String emailId) throws Exception {
170
	private String getAndroidId(String emailId) throws Exception {
171
		User user = userRepository.selectByEmailId(emailId);
171
		User user = userRepository.selectByEmailId(emailId);
172
		List<Device> devices = deviceRepository.selectByUserIdAndModifiedTimestamp(Arrays.asList(user.getId()), LocalDateTime.now().minusYears(2), LocalDateTime.now());
172
		List<Device> devices = deviceRepository.selectByUserIdAndModifiedTimestamp(Arrays.asList(user.getId()), LocalDateTime.now().minusYears(2), LocalDateTime.now());
173
		Device device = devices.stream().sorted((x,y)->
173
		Device device = devices.get(0);
174
			(int)(
-
 
175
				y.getModified().toEpochSecond(ZoneOffset.ofHours(5))
-
 
176
				-x.getModified().toEpochSecond(ZoneOffset.ofHours(5))
-
 
177
			)
-
 
178
		).findFirst().get();
-
 
179
		return device.getAndroidId();
174
		return device.getAndroidId();
180
	}
175
	}
181
 
176
 
182
	private String getToken(String emailId) throws Exception {
177
	private String getToken(String emailId) throws Exception {
183
		List<NameValuePair> nameValuePairs = new ArrayList<>();
178
		List<NameValuePair> nameValuePairs = new ArrayList<>();