Subversion Repositories SmartDukaan

Rev

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

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