Compare commits

..

No commits in common. 'f6c2a8ec5858a35748bd88bcd53640673701f14f' and '8789de157f9085ccfeee75458061ff255663bc52' have entirely different histories.

@ -1,25 +0,0 @@
package com.taxi.apidriver.controller;
import com.internal.dto.ResponseResult;
import com.internal.request.VerificationCodeDTO;
import com.taxi.apidriver.service.VerficationCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
public class VerficationCodeController {
@Autowired
private VerficationCodeService verficationCodeService;
@GetMapping("/verfication-code")
public ResponseResult verficationCode(@RequestBody VerificationCodeDTO verificationCodeDTO){
String driverPhone = verificationCodeDTO.getDriverPhone();
log.info("司机的号码"+driverPhone);
return verficationCodeService.checkSendVerficationCode(driverPhone);
}
}

@ -1,24 +0,0 @@
package com.taxi.apidriver.service;
import com.internal.dto.ResponseResult;
import com.internal.request.VerificationCodeDTO;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
@Service
public class VerficationCodeService {
public ResponseResult checkSendVerficationCode(String driverPhone){
//查询该手机号的司机是否存在
//获取验证码
//调用三方,获取验证码
//存入redis
return ResponseResult.success();
}
}

@ -32,8 +32,6 @@ CommonStatusEnum {
DRIVER_CAR_UNBIND_EXISTS(1503,"司机和车辆绑定关系已绑定"),
DRIVER_USER_NOT_EXITST(1501,"司机不存在"),
/**
*
*/

@ -13,12 +13,4 @@ public class DriverCarConstant {
*/
public static final int DRIVER_CAR_UNBIND = 2;
/**
* 1:
* 0
*
*/
public static final int DRIVER_USER_STATE_VALID = 1;
public static final int DRIVER_USER_STATE_INVALID = 0;
}

@ -9,7 +9,5 @@ public class VerificationCodeDTO {
private String verificationCode;
private String driverPhone;
}

@ -1,13 +0,0 @@
package com.internal.response;
import lombok.Data;
/**
*
*/
@Data
public class DriverUserExistsResponse {
private String driverPhone;
private int ifExits;
}

@ -2,11 +2,12 @@ package com.taxi.servicedriveruser.controller;
import com.internal.dto.DriverUser;
import com.internal.dto.ResponseResult;
import com.internal.response.DriverUserExistsResponse;
import com.taxi.servicedriveruser.service.DriverUserService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@ -15,46 +16,15 @@ public class DriverUserController {
@Autowired
private DriverUserService driverUserService;
/**
*
* @param driverUser
* @return
*/
@PostMapping("/users")
public ResponseResult addDriverUser(@RequestBody DriverUser driverUser){
return driverUserService.addDriverUser(driverUser);
}
/**
*
* @param driverUser
* @return
*/
@PutMapping("/user")
public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser){
return driverUserService.updateDriverUser(driverUser);
}
/**
*
* @param driverPhone
* @return
*/
@GetMapping("/check-driver/{driverPhone}")
public ResponseResult getUser(@PathVariable("driverPhone") String driverPhone){
DriverUser driverUserDB = driverUserService.getUser(driverPhone).getData();
DriverUserExistsResponse driverUserExistsResponse = new DriverUserExistsResponse();
int ifExists = 1;
if(driverUserDB == null){
ifExists = 0;
driverUserExistsResponse.setDriverPhone(driverPhone);
driverUserExistsResponse.setIfExits(ifExists);
}else{
driverUserExistsResponse.setDriverPhone(driverUserDB.getDriverPhone());
driverUserExistsResponse.setIfExits(ifExists);
}
return ResponseResult.success(driverUserExistsResponse);
}
}

@ -1,18 +1,12 @@
package com.taxi.servicedriveruser.service;
import com.internal.contant.CommonStatusEnum;
import com.internal.contant.DriverCarConstant;
import com.internal.dto.DriverUser;
import com.internal.dto.ResponseResult;
import com.taxi.servicedriveruser.controller.DriverUserController;
import com.taxi.servicedriveruser.mapper.DriverUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class DriverUserService {
@ -36,17 +30,4 @@ public class DriverUserService {
return ResponseResult.success();
}
public ResponseResult<DriverUser> getUser(String driverPhone){
Map<String,Object> queryMap = new HashMap<>();
queryMap.put("driver_phone",driverPhone);
queryMap.put("state", DriverCarConstant.DRIVER_USER_STATE_VALID);
List<DriverUser> driverList = driverUserMapper.selectByMap(queryMap);
if(driverList.isEmpty()){
return ResponseResult.fail(CommonStatusEnum.DRIVER_USER_NOT_EXITST);
}else{
return ResponseResult.success(driverList.get(0));
}
}
}

Loading…
Cancel
Save