parent
153bbac097
commit
36a5181b2b
@ -0,0 +1,35 @@
|
||||
package com.kaiupup.apipassenger.controller;
|
||||
|
||||
import com.kaiupup.apipassenger.service.VerificationCodeService;
|
||||
import com.kaiupup.internalcommon.dto.ResponseResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @projectName: online-taxi-public
|
||||
* @package: com.kaiupup.apipassenger.controller
|
||||
* @className: VerificationCodeController
|
||||
* @author: kaiupup
|
||||
* @description: TODO
|
||||
* @date: 2023/7/26 20:42
|
||||
* @version: 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class VerificationCodeController {
|
||||
|
||||
@Autowired
|
||||
private VerificationCodeService verificationCodeService;
|
||||
|
||||
|
||||
@GetMapping("numberCode/{size}")
|
||||
public ResponseResult getNumberCode(@PathVariable("size") int size){
|
||||
ResponseResult responseResult = verificationCodeService.numberCode(size);
|
||||
return responseResult;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.kaiupup.apipassenger.remote;
|
||||
|
||||
import com.kaiupup.internalcommon.dto.ResponseResult;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@FeignClient("service-verificationcode")
|
||||
public interface ServiceVerificationCodeClient {
|
||||
|
||||
@RequestMapping("/numberCode/{size}")
|
||||
ResponseResult numberCode(@PathVariable("size") int size);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.kaiupup.apipassenger.service;
|
||||
|
||||
import com.kaiupup.apipassenger.remote.ServiceVerificationCodeClient;
|
||||
import com.kaiupup.internalcommon.dto.ResponseResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @projectName: online-taxi-public
|
||||
* @package: com.kaiupup.apipassenger.service
|
||||
* @className: VerificationCodeService
|
||||
* @author: kaiupup
|
||||
* @description: TODO
|
||||
* @date: 2023/7/26 20:39
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class VerificationCodeService {
|
||||
|
||||
@Autowired
|
||||
private ServiceVerificationCodeClient serviceVerificationCodeClient;
|
||||
|
||||
public ResponseResult numberCode(int size){
|
||||
ResponseResult responseResult = serviceVerificationCodeClient.numberCode(size);
|
||||
System.out.println("responseResult = " + responseResult);
|
||||
return responseResult;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
artifactId=api-passenger
|
||||
groupId=com.kaiupup
|
||||
version=1.0-SNAPSHOT
|
@ -1,2 +0,0 @@
|
||||
com/kaiupup/ApiPassengerApplication.class
|
||||
com/kaiupup/controller/TestController.class
|
@ -1,2 +0,0 @@
|
||||
/Users/zhaokai/Desktop/study/java/code/online-taxi/online-taxi-public/api-passenger/src/main/java/com/kaiupup/controller/TestController.java
|
||||
/Users/zhaokai/Desktop/study/java/code/online-taxi/online-taxi-public/api-passenger/src/main/java/com/kaiupup/ApiPassengerApplication.java
|
@ -0,0 +1,20 @@
|
||||
package com.kaiupup.internalcommon.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @projectName: online-taxi-public
|
||||
* @package: com.kaiupup.internalcommon.response
|
||||
* @className: NumberCodeResponse
|
||||
* @author: kaiupup
|
||||
* @description: TODO
|
||||
* @date: 2023/7/26 07:54
|
||||
* @version: 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class NumberCodeResponse {
|
||||
|
||||
private int numberCode;
|
||||
|
||||
}
|
Loading…
Reference in new issue