Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
36321 vikas 1
package com.spice.profitmandi.web.v2.controller;
2
 
3
import com.spice.profitmandi.web.controller.OTPController;
4
import com.spice.profitmandi.web.v2.response.ApiResponse;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.http.ResponseEntity;
7
import org.springframework.web.bind.annotation.*;
8
 
9
@RestController
10
@RequestMapping("/v2")
11
public class V2OTPController extends V2BaseController {
12
 
13
    @Autowired
14
    private OTPController otpController;
15
 
16
    @GetMapping("/otp/generateOTP")
17
    public ResponseEntity<ApiResponse<?>> generateOtp(@RequestParam("mobile") String mobile) throws Throwable {
18
        return wrapResponse(otpController.generateOtp(mobile));
19
    }
20
 
21
    @GetMapping("/otp/verifyOTP")
22
    public ResponseEntity<ApiResponse<?>> validateOtp(@RequestParam String mobile,
23
                                                       @RequestParam int referenceId,
24
                                                       @RequestParam String otpCode) throws Throwable {
25
        return wrapResponse(otpController.validateOtp(mobile, referenceId, otpCode));
26
    }
27
 
28
    @PostMapping("/otp/parseOTP")
29
    public ResponseEntity<ApiResponse<?>> parseOTP(@RequestParam(name = "message") String message) throws Throwable {
30
        return wrapResponse(otpController.parseOTP(message));
31
    }
32
}