| | |
| | | }) |
| | | public ResultUtil queryCaptcha(String phone, Integer type, Integer language){ |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | try { |
| | | return driverService.queryCaptcha(phone, type, language); |
| | | }catch (Exception e){ |
| | |
| | | @ApiImplicitParam(value = "邮箱", name = "email", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil checkCaptcha(String email, String code){ |
| | | public ResultUtil checkCaptcha(String email, String code, Integer language){ |
| | | try { |
| | | boolean b = driverService.checkCaptcha(email, code); |
| | | return b ? ResultUtil.success() : ResultUtil.error("验证码无效"); |
| | | return b ? ResultUtil.success() : ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/registeredDriver") |
| | | @ApiOperation(value = "司机提交注册申请", tags = {"分享专用"}, notes = "") |
| | | @ApiOperation(value = "司机提交注册申请【1.1】", tags = {"分享专用"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码运营商", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "密码", name = "password", required = true, dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | public ResultUtil registeredDriver(String phoneOperator, String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType, language); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.registeredDriver(phoneOperator, phone, code, password, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/registeredDriver_") |
| | | @ApiOperation(value = "司机提交注册申请", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "司机提交注册申请【1.1】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码运营商", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "密码", name = "password", required = true, dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phoneOperator, String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType, language); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.registeredDriver(phoneOperator, phone, code, password, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/updateDriver") |
| | | @ApiOperation(value = "司机注册后完善个人信息【1.0】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "司机注册后完善个人信息【1.1】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int") |
| | | }) |
| | |
| | | @ApiImplicitParam(value = "车辆id", name = "carId", required = false, dataType = "int") |
| | | }) |
| | | public ResultUtil addDriverCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicenseNumber, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId, String peopleAndCarsPhone){ |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId, String peopleAndCarsPhone, Integer language){ |
| | | try { |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicenseNumber, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone); |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicenseNumber, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | }) |
| | | public ResultUtil resetPassword(String phone, String code, String password, Integer language){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.resetPassword(phone, code, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "密码", name = "password", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil<LoginWarpper> driverLogin(String phone, String password){ |
| | | public ResultUtil<LoginWarpper> driverLogin(String phone, String password, Integer language){ |
| | | try { |
| | | return driverService.driverLogin(phone, password); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.driverLogin(phone, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,4=小件物流-同城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work(String type, HttpServletRequest request){ |
| | | public ResultUtil work(String type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.work(uid, type); |
| | | return driverService.work(uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,4=小件物流-同城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work2(String type, HttpServletRequest request){ |
| | | public ResultUtil work2(String type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.work2(uid, type); |
| | | return driverService.work2(uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/updatePhone") |
| | | @ApiOperation(value = "修改手机号码", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "修改手机号码【1.1】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码运营商", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "新电话号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updatePhone(String phone, String code, HttpServletRequest request){ |
| | | public ResultUtil updatePhone(String phoneOperator, String phone, String code, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.updatePhone(phone, code, uid); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.updatePhone(phoneOperator, phone, code, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateOrders(Integer type, HttpServletRequest request){ |
| | | public ResultUtil updateOrders(Integer type, Integer language, HttpServletRequest request){ |
| | | try{ |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverOrdersService.updateOrders(uid, type); |
| | | return driverOrdersService.updateOrders(uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "车辆id", name = "carId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil replaceCar(Integer carId, HttpServletRequest request){ |
| | | public ResultUtil replaceCar(Integer carId, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.replaceCar(carId, uid); |
| | | return driverService.replaceCar(carId, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "工号", name = "jobNum", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil loginByJobNumber(String jobNum){ |
| | | public ResultUtil loginByJobNumber(String jobNum, Integer language){ |
| | | try { |
| | | return driverService.loginByJobNumber(jobNum); |
| | | return driverService.loginByJobNumber(jobNum, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "身份证号码", name = "identification", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil loginByIdentification(String identification){ |
| | | public ResultUtil loginByIdentification(String identification, Integer language){ |
| | | try { |
| | | return driverService.loginByIdentification(identification); |
| | | return driverService.loginByIdentification(identification, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "出租车资格证号", name = "taxiAptitudeCard", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil loginByTaxiAptitudeCard(String taxiAptitudeCard){ |
| | | public ResultUtil loginByTaxiAptitudeCard(String taxiAptitudeCard, Integer language){ |
| | | try { |
| | | return driverService.loginByTaxiAptitudeCard(taxiAptitudeCard); |
| | | return driverService.loginByTaxiAptitudeCard(taxiAptitudeCard, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "登录密码", name = "password", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil verificationPassword(String password, HttpServletRequest request){ |
| | | public ResultUtil verificationPassword(String password, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.verificationPassword(password, driverId); |
| | | return driverService.verificationPassword(password, driverId, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "提现密码", name = "withdrawPassword", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil setWithdrawPassword(String withdrawPassword, HttpServletRequest request){ |
| | | public ResultUtil setWithdrawPassword(String withdrawPassword, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.setWithdrawPassword(withdrawPassword, driverId); |
| | | return driverService.setWithdrawPassword(withdrawPassword, driverId, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "提现密码", name = "withdrawPassword", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil verificationWithdrawPassword(String withdrawPassword, HttpServletRequest request){ |
| | | public ResultUtil verificationWithdrawPassword(String withdrawPassword, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.verificationWithdrawPassword(withdrawPassword, driverId); |
| | | return driverService.verificationWithdrawPassword(withdrawPassword, driverId, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/updateName") |
| | | @ApiOperation(value = "修改姓名【1.1】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "姓", name = "lastName", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "名", name = "firstName", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateName(String lastName, String firstName, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | driver.setLastName(lastName); |
| | | driver.setFirstName(firstName); |
| | | driverService.updateById(driver); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |