Subversion Repositories SmartDukaan

Rev

Rev 35435 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35435 Rev 35458
Line 88... Line 88...
88
 
88
 
89
	@RequestMapping(value = ProfitMandiConstants.URL_MY_WALLET, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
89
	@RequestMapping(value = ProfitMandiConstants.URL_MY_WALLET, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
90
	@ApiImplicitParams({
90
	@ApiImplicitParams({
91
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
91
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
92
	@ApiOperation(value = "")
92
	@ApiOperation(value = "")
93
	@Transactional(readOnly = true)
-
 
94
	public ResponseEntity<?> getMyWallet(HttpServletRequest request) throws ProfitMandiBusinessException {
93
	public ResponseEntity<?> getMyWallet(HttpServletRequest request) throws ProfitMandiBusinessException {
95
		int userId = (int) request.getAttribute("userId");
94
		int userId = (int) request.getAttribute("userId");
96
		return responseSender.ok(walletService.getUserWalletByUserId(userId));
95
		return responseSender.ok(walletService.getUserWalletByUserId(userId));
97
	}
96
	}
98
 
97
 
99
	@RequestMapping(value = ProfitMandiConstants.URL_MY_WALLET_HISTORY, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
98
	@RequestMapping(value = ProfitMandiConstants.URL_MY_WALLET_HISTORY, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
100
	@ApiImplicitParams({
99
	@ApiImplicitParams({
101
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
100
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
102
	@Transactional(readOnly = true)
-
 
103
	public ResponseEntity<?> getMyWalletHistory(HttpServletRequest request) throws ProfitMandiBusinessException {
101
	public ResponseEntity<?> getMyWalletHistory(HttpServletRequest request) throws ProfitMandiBusinessException {
104
		int userId = (int) request.getAttribute("userId");
102
		int userId = (int) request.getAttribute("userId");
105
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
103
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
106
		try {
104
		try {
107
			return responseSender.ok(walletService.getPaginatedUserWalletHistoryByRetailerId(retailerId, null, null, 0, 150));
105
			return responseSender.ok(walletService.getPaginatedUserWalletHistoryByRetailerId(retailerId, null, null, 0, 150));
Line 189... Line 187...
189
	}
187
	}
190
	
188
	
191
	@RequestMapping(value = "/wallet/add-money/{loanId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
189
	@RequestMapping(value = "/wallet/add-money/{loanId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
192
	@ApiImplicitParams({
190
	@ApiImplicitParams({
193
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
191
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
194
	@Transactional(readOnly = true)
-
 
195
	public ResponseEntity<?> addMoneyToWallet(HttpServletRequest request,@PathVariable int loanId) throws Exception {
192
	public ResponseEntity<?> addMoneyToWallet(HttpServletRequest request,@PathVariable int loanId) throws Exception {
196
		int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
193
		int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
197
		log.info("user_id" + userId);
194
		log.info("user_id" + userId);
198
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
195
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
199
		
196
		
Line 219... Line 216...
219
	}
216
	}
220
 
217
 
221
	@RequestMapping(value = ProfitMandiConstants.URL_ADD_MONEY_TO_WALLET_HISTORY, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
218
	@RequestMapping(value = ProfitMandiConstants.URL_ADD_MONEY_TO_WALLET_HISTORY, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
222
	@ApiImplicitParams({
219
	@ApiImplicitParams({
223
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
220
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
224
	@Transactional(readOnly = true)
-
 
225
	public ResponseEntity<?> getAddMoneyToWalletHistory(HttpServletRequest request,
221
	public ResponseEntity<?> getAddMoneyToWalletHistory(HttpServletRequest request,
226
			@RequestParam(name = "offset", defaultValue = "0") int offset,
222
			@RequestParam(name = "offset", defaultValue = "0") int offset,
227
			@RequestParam(name = "limit", defaultValue = "10") int limit) throws ProfitMandiBusinessException {
223
			@RequestParam(name = "limit", defaultValue = "10") int limit) throws ProfitMandiBusinessException {
228
		int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
224
		int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
229
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
225
		int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
Line 232... Line 228...
232
	}
228
	}
233
	
229
	
234
	
230
	
235
	
231
	
236
	@RequestMapping(value = "/getPaymentOptions", method = RequestMethod.GET)
232
	@RequestMapping(value = "/getPaymentOptions", method = RequestMethod.GET)
237
	@Transactional(readOnly = true)
-
 
238
	public ResponseEntity<?> getPaymentOptions(HttpServletRequest request, Model model) throws Exception {
233
	public ResponseEntity<?> getPaymentOptions(HttpServletRequest request, Model model) throws Exception {
239
		return responseSender.ok(ccAvenuePaymentService.getPaymentOptionModelMap());
234
		return responseSender.ok(ccAvenuePaymentService.getPaymentOptionModelMap());
240
	}
235
	}
241
 
236
 
242
}
237
}
243
238