package net.ruifeng.app.cloud.web.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import net.ruifeng.app.cloud.core.Const;
import net.ruifeng.app.cloud.core.Enums;
import net.ruifeng.app.cloud.core.base.AbstractController;
import net.ruifeng.app.cloud.core.kit.CommonKit;
import net.ruifeng.app.cloud.core.kit.UserInfoVo;
import net.ruifeng.app.cloud.core.result.Result;
import net.ruifeng.app.cloud.core.utils.AuthUtil;
import net.ruifeng.app.cloud.domain.doc.MobileCaptcha;
import net.ruifeng.app.cloud.domain.doc.dao.CarLocationDao;
import net.ruifeng.app.cloud.domain.entity.*;
import net.ruifeng.app.cloud.domain.entity.dao.ApkVersionDao;
import net.ruifeng.app.cloud.domain.gps.Gpsrealdata;
import net.ruifeng.app.cloud.domain.moc.MocDriverEducate;
import net.ruifeng.app.cloud.service.gpsImpl.GpsrealdataService;
import net.ruifeng.app.cloud.service.impl.*;
import net.ruifeng.app.cloud.web.annotation.RequestAuth;
import net.ruifeng.app.cloud.web.annotation.RequestLock;
import net.ruifeng.app.cloud.web.kit.IpKit;
import net.ruifeng.app.cloud.web.kit.WechatDecryptDataUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.*;
@Api(tags = "通用接口")
@EnableSwagger2
@RestController
@Slf4j
public class CommonController extends AbstractController {
@Value("${app.base.serverurl}")
String rootUrl;
@Value("${companyId}")
String company;
@Value("${app.base.debug}")
boolean debug;
// @Value("${filePath}")
// String filePath;
@Value("${app.base.upload.path}")
String filePath;
@Value("${app.base.upload.uri}")
String uploadUri;
@Value("${app.base.apk.path}")
String pakPath;
@Value("${app.base.apk.uri}")
String apkUri;
@Autowired
private UserService userService;
@Autowired
private MobileCaptchaService captchaService;
@Autowired
private SenderService senderService;
@Autowired
private TokenService tokenService;
@Autowired
private ApkVersionDao apkVersionDao;
@Autowired
DriverService driverService;
@Autowired
MocCompanyInfoService companyInfoService;
@Autowired
PassengerService passengerService;
@Autowired
GaodeService gaodeService;
@Autowired
PriceInfoService priceInfoService;
@Autowired
AttachmentService attachmentService;
@Autowired
AlipayService alipayService;
@Autowired
WxpayService wxpayService;
@Autowired
CarLocationDao carLocationDao;
@Autowired
OrderService orderService;
@Autowired
PaymentService paymentService;
@Autowired
EventService eventService;
@Autowired
CarService carService;
@Autowired
MocDriverAppService driverAppService;
@Autowired
MocPassengerInfoService passengerInfoService;
@Autowired
MocService mocService;
@Autowired
MocCompanyFareService mocCompanyFareService;
@Autowired
MocDriverEducateService educateService;
@Autowired
RestTemplate restTemplate;
@Autowired
CouponService couponService;
@Autowired
MyCouponService myCouponService;
@Autowired
MyBalanceService myBalanceService;
@Autowired
GpsrealdataService gpsrealdataService;
@Autowired
DriverAndCarService driverAndCarService;
/**
* 手机号是否已注册
* @param mobile
* @param type
* @return
*/
@ApiOperation(value = "检测手机号是否可用", httpMethod = "POST", produces = "application/json;charset=UTF-8")
@ApiImplicitParams(value = {@ApiImplicitParam(value = "*手机号", name = "mobile",defaultValue ="18638800000", dataType = "String",paramType="query"),
@ApiImplicitParam(value = "*用户类型", name = "type",defaultValue ="(司机:Driver,乘客:Passenger,管理员:Admin)", dataType = "String",paramType="query")})
@PostMapping("/common/mobile/mobileCheck")
public Result mobileCheck(@NotBlank(message = "手机号[mobile]不能为空值") String mobile,@NotBlank(message = "用户类型[type]不能为空值")String type){
try {
User user = userService.findUser(mobile,type);
if (user != null) {
if ("Driver".equalsIgnoreCase(type)){
return Result.fail(202, "司机已存在");
}else if ("Passenger".equalsIgnoreCase(type)){
return Result.fail(202, "用户已存在");
}else if ("Admin".equalsIgnoreCase(type)){
return Result.fail(202, "管理员已存在");
}
}else {
if ("Driver".equalsIgnoreCase(type)){
Driver byPhone = driverService.findByPhone(mobile);
if (byPhone!=null){
return Result.fail(203, "该手机已绑定其他账号!");
}
}else if ("Passenger".equalsIgnoreCase(type)){
Passenger byPhone = passengerService.findByPhone(mobile);
if (byPhone!=null){
return Result.fail(203, "该手机已绑定其他账号!");
}
}
}
}catch (Exception e){
e.printStackTrace();
return Result.error(901,"请求失败!");
}
return Result.ok("可以使用!");
}
/**
* [120002] 获取手机验证码接口
*/
@RequestLock(value = "mobile")
@PostMapping(value = {"/common/mobile/captcha"})
@ApiOperation(value = "获取手机验证码", httpMethod = "POST", produces = "application/json;charset=UTF-8")
@ApiImplicitParams(value = {@ApiImplicitParam(value = "*手机号", name = "mobile",defaultValue ="18638800000", dataType = "String",paramType="query"),
@ApiImplicitParam(value = "*验证码类型", name = "type",defaultValue = "(司机:Driver,乘客:Passenger,管理员:Admin)", dataType = "String",paramType="query"),
@ApiImplicitParam(value = "*用途", name = "purpose",defaultValue = "(注册:0,登录或其他:1)", dataType = "String",paramType="query")})
public Result mobileCaptcha(@NotBlank(message = "手机号[mobile]不能为空值") @Pattern(regexp = Const.REGEXP_MOBILE, message = "手机号[mobile]格式不正确") String mobile,
@NotNull(message = "验证码类型[type]不能为空") String type, @NotNull(message = "用途[purpose]不能为空") Integer purpose,
HttpServletRequest request) {
Map<String, Object> data = new HashMap<>();
try {
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
NettingCar-real是一个采用Java语言开发的网约车系统设计源码,共计包含563个文件,主要涉及520个Java源代码文件,以及18个YAML配置文件、13个XML配置文件和12个IML项目配置文件。该系统旨在为网约车行业提供高效便捷的服务解决方案。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java开发的网约车系统NettingCar-real源码设计 (564个子文件)
eureka-server.iml 25KB
web.iml 24KB
pay-server.iml 22KB
passenger-server.iml 22KB
driver-server.iml 22KB
order-server.iml 22KB
car-server.iml 22KB
tool.iml 13KB
socket.iml 13KB
service.iml 13KB
core.iml 12KB
domain.iml 12KB
CommonController.java 60KB
ApiPassengerController.java 45KB
utils.java 36KB
ApiDriverController.java 33KB
ApiOrderController.java 32KB
PassengerController.java 23KB
OrderDao.java 21KB
AuditController.java 21KB
DriverController.java 19KB
InstructionsController.java 18KB
MocService.java 17KB
OrderService.java 17KB
ComplaintController.java 17KB
MocOperatePay.java 15KB
AutoRowMapper.java 15KB
MocUploadDataService.java 15KB
MocBatchUploadService.java 14KB
TerminalCmdService.java 14KB
MocDriverInfo.java 13KB
driver.java 13KB
ApiUserController.java 13KB
PaymentService.java 13KB
ApiRoleController.java 12KB
MessageCenterController.java 12KB
ValuationController.java 12KB
LostandFoundController.java 11KB
ApiMenuController.java 11KB
OrderController.java 11KB
MocVehicleInfo.java 11KB
ApiCouponController.java 11KB
MocCompanyFare.java 11KB
MocCompanyInfoController.java 10KB
TransferController.java 10KB
ApiCarController.java 10KB
CarService.java 10KB
MocDriverPunishController.java 10KB
Driver.java 10KB
WxpayService.java 10KB
CommonKit.java 10KB
car.java 9KB
FeedbackAndSuggestionController.java 9KB
ApiDriverAndCarController.java 9KB
passenger.java 8KB
CarController.java 8KB
ColumnTitleMap.java 8KB
ApiStatisticsController.java 8KB
ServiceConfig.java 8KB
Car.java 8KB
MocVehicleInsuranceController.java 8KB
TagRuleController.java 7KB
FinanceController.java 7KB
AlipayService.java 7KB
AndroidNotification.java 7KB
Demo.java 7KB
MocDriverEducateController.java 7KB
order.java 7KB
AbstractEntityDao.java 7KB
WebConfig.java 7KB
SignInterceptor.java 7KB
UserService.java 7KB
base.java 6KB
MocCompanyFareController.java 6KB
PayNotifyController.java 6KB
MocPositionVehicle.java 6KB
FeedbackAndSuggestionController.java 6KB
MocVehicleInfoController.java 6KB
MenuDao.java 6KB
MocPositionDriver.java 6KB
idcard.java 6KB
MocPassengerInfoController.java 6KB
SignRecordService.java 6KB
MocOrderCreate.java 6KB
MocDriverInfoController.java 6KB
ExportExcelUtil.java 5KB
MocCompanyServiceController.java 5KB
CommonProblemController.java 5KB
WeixinMNService.java 5KB
ApiContractController.java 5KB
MocCompanyInfo.java 5KB
Contract.java 5KB
DriverService.java 5KB
MocCompanyService.java 5KB
MocOperateDepart.java 5KB
MocCompanyPermitController.java 5KB
MocOrderCreateController.java 5KB
MocVehicleMileController.java 5KB
MocDriverAppController.java 5KB
MocDriverRatedController.java 5KB
共 564 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
lly202406
- 粉丝: 2625
- 资源: 5447
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python图片转字符
- 【java毕业设计】客户关系管理系统源码(ssm+mysql+说明文档).zip
- 【java毕业设计】酒店客房预定管理系统源码(ssm+mysql+说明文档+LW).zip
- 【java毕业设计】教师业务数据统计与分析系统源码(ssm+mysql+说明文档).zip
- cp105b,cp205,cp205w,cp215,cp215w寿命重置工具,解决091-402
- 【java毕业设计】健身房管理系统源码(ssm+mysql+说明文档).zip
- py test for self
- ui-auto test for self
- 【java毕业设计】基于推荐算法的图书购物网站源码(ssm+mysql+说明文档+LW).zip
- appium test for self
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功