├── .DS_Store ├── .gitignore ├── README.md ├── doc ├── .DS_Store ├── Redis的key过期事件.md ├── Redis绑定Token.md ├── RocketMQ最终一致性.md ├── api.md ├── meeting.md ├── sql.md ├── 上线遇到的bug.md ├── 业务逻辑SQL语句.md ├── 支付服务.md ├── 环境搭建文档.md ├── 班车服务.md ├── 用户服务.md └── 订单服务.md ├── imgs ├── .DS_Store ├── 下单服务页面.png ├── 个人中心.png ├── 前端我的订单.png ├── 前端支付页面.png ├── 前端班车服务.png ├── 前端用户服务页面.png ├── 后端环境启动.png ├── 已评价订单.png ├── 待支付订单.png ├── 待评价订单.png ├── 总架构路线.png ├── 技术选型.png ├── 搭建后端环境.png ├── 支付金额.png ├── 未乘坐订单.png ├── 用户注册.png ├── 用户登录.png ├── 申请退款.png ├── 确认订单.png ├── 订单详情.png ├── 车次信息.png └── 车次列表.png ├── school-bus-cloud ├── .gitignore ├── bus-api │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dream │ │ │ └── bus │ │ │ ├── auth │ │ │ ├── AuthClient.java │ │ │ └── param │ │ │ │ ├── AuthRequest.java │ │ │ │ └── AuthResponse.java │ │ │ ├── bus │ │ │ ├── BusClient.java │ │ │ └── param │ │ │ │ ├── BusDto.java │ │ │ │ ├── CountDetailDto.java │ │ │ │ ├── CountDetailRequest.java │ │ │ │ ├── CountDetailResponse.java │ │ │ │ ├── CountDto.java │ │ │ │ ├── CountPageInfo.java │ │ │ │ ├── CountSimpleDto.java │ │ │ │ ├── PageBusRequest.java │ │ │ │ ├── PageBusResponse.java │ │ │ │ ├── PageCountRequest.java │ │ │ │ └── PageCountResponse.java │ │ │ ├── mq │ │ │ └── MQDto.java │ │ │ ├── order │ │ │ ├── OrderClient.java │ │ │ └── param │ │ │ │ ├── AddOrderForm.java │ │ │ │ ├── AddOrderRequest.java │ │ │ │ ├── AddOrderResponse.java │ │ │ │ ├── EvaluateDto.java │ │ │ │ ├── EvaluateRequest.java │ │ │ │ ├── EvaluateResponse.java │ │ │ │ ├── NoPayDto.java │ │ │ │ ├── NoPayRequest.java │ │ │ │ ├── NoPayResponse.java │ │ │ │ ├── NoTakeBusRequest.java │ │ │ │ ├── NoTakeBusResponse.java │ │ │ │ ├── NoTakeDto.java │ │ │ │ ├── OrderDto.java │ │ │ │ ├── OrderPageInfo.java │ │ │ │ ├── OrderRequest.java │ │ │ │ ├── OrderResponse.java │ │ │ │ └── OrderUpdateForm.java │ │ │ ├── param │ │ │ ├── AbstractRequest.java │ │ │ ├── AbstractResponse.java │ │ │ ├── CommonBindingResult.java │ │ │ ├── CommonResponse.java │ │ │ ├── ResponseData.java │ │ │ └── ResponseUtil.java │ │ │ ├── pay │ │ │ ├── PayBackForm.java │ │ │ ├── PayBackRequest.java │ │ │ ├── PayForm.java │ │ │ ├── PayRequset.java │ │ │ └── PayResponse.java │ │ │ └── user │ │ │ ├── UserClient.java │ │ │ └── param │ │ │ ├── UserCheckRequest.java │ │ │ ├── UserCheckResponse.java │ │ │ ├── UserDto.java │ │ │ ├── UserLoginRequst.java │ │ │ ├── UserLoginResponse.java │ │ │ ├── UserRegisterRequest.java │ │ │ ├── UserRegisterResponse.java │ │ │ ├── UserRegstierForm.java │ │ │ ├── UserRequest.java │ │ │ ├── UserResponse.java │ │ │ ├── UserUpdateForm.java │ │ │ └── UserUpdateInfoRequest.java │ │ └── resources │ │ └── application.properties ├── bus-auth │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dream │ │ │ │ └── bus │ │ │ │ ├── BusAuthApplication.java │ │ │ │ └── controller │ │ │ │ └── AuthController.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── dream │ │ └── bus │ │ └── BusAuthApplicationTests.java ├── bus-bus │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dream │ │ │ │ └── bus │ │ │ │ ├── BusBusApplication.java │ │ │ │ ├── common │ │ │ │ └── converter │ │ │ │ │ ├── BusConverter.java │ │ │ │ │ └── CountConverter.java │ │ │ │ ├── controller │ │ │ │ └── BusController.java │ │ │ │ ├── dao │ │ │ │ ├── BusMapper.java │ │ │ │ ├── CountMapper.java │ │ │ │ └── mapping │ │ │ │ │ ├── BusMapper.xml │ │ │ │ │ └── CountMapper.xml │ │ │ │ ├── model │ │ │ │ ├── Bus.java │ │ │ │ └── Count.java │ │ │ │ ├── mq │ │ │ │ └── OrderSeatsCancleListener.java │ │ │ │ ├── schedule │ │ │ │ └── BusSchedule.java │ │ │ │ └── service │ │ │ │ ├── IBusService.java │ │ │ │ └── impl │ │ │ │ └── BusServiceImpl.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── dream │ │ └── bus │ │ ├── BusBusApplicationTests.java │ │ └── CountMapperTest.java ├── bus-common │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── dream │ │ │ └── bus │ │ │ ├── BusCommonApplication.java │ │ │ ├── common │ │ │ ├── CastException.java │ │ │ ├── CurrentUser.java │ │ │ ├── DateUtil.java │ │ │ ├── RedisUtils.java │ │ │ └── UUIDUtils.java │ │ │ ├── config │ │ │ └── RedisConfig.java │ │ │ ├── constants │ │ │ ├── MqTags.java │ │ │ ├── RedisConstants.java │ │ │ └── SbCode.java │ │ │ ├── convert │ │ │ └── DateMapper.java │ │ │ ├── jwt │ │ │ ├── JwtProperties.java │ │ │ └── JwtTokenUtil.java │ │ │ └── param │ │ │ ├── AbstractRequest.java │ │ │ ├── AbstractResponse.java │ │ │ ├── CommonResponse.java │ │ │ ├── ResponseData.java │ │ │ └── ResponseUtil.java │ │ └── resources │ │ └── application.yml ├── bus-gateway │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dream │ │ │ │ └── bus │ │ │ │ ├── BusGatewayApplication.java │ │ │ │ ├── config │ │ │ │ └── RedisConfig.java │ │ │ │ ├── filter │ │ │ │ ├── AuthFilter.java │ │ │ │ ├── RedisUtils.java │ │ │ │ └── SbCode.java │ │ │ │ └── jwt │ │ │ │ ├── JwtProperties.java │ │ │ │ └── JwtTokenUtil.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── static │ │ │ └── file │ │ │ └── seat.json │ │ └── test │ │ └── java │ │ └── com │ │ └── dream │ │ └── bus │ │ └── BusGatewayApplicationTests.java ├── bus-order │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dream │ │ │ │ └── bus │ │ │ │ ├── BusOrderApplication.java │ │ │ │ ├── common │ │ │ │ └── converter │ │ │ │ │ └── OrderConvertver.java │ │ │ │ ├── controller │ │ │ │ ├── DemoController.java │ │ │ │ └── OrderController.java │ │ │ │ ├── dao │ │ │ │ ├── OrderMapper.java │ │ │ │ └── mapping │ │ │ │ │ └── OrderMapper.xml │ │ │ │ ├── model │ │ │ │ └── Order.java │ │ │ │ ├── mq │ │ │ │ └── AddOrderTxListener.java │ │ │ │ └── service │ │ │ │ ├── IOrderService.java │ │ │ │ └── impl │ │ │ │ └── OrderServiceImpl.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── dream │ │ └── bus │ │ ├── BusOrderApplicationTests.java │ │ └── OrderServiceTest.java ├── bus-pay │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dream │ │ │ │ └── bus │ │ │ │ ├── BusPayApplication.java │ │ │ │ ├── controller │ │ │ │ └── PayController.java │ │ │ │ └── service │ │ │ │ ├── IPayService.java │ │ │ │ └── impl │ │ │ │ └── PayServiceImpl.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── dream │ │ └── bus │ │ └── BusPayApplicationTests.java ├── bus-user │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── dream │ │ │ │ └── bus │ │ │ │ ├── BusUserApplication.java │ │ │ │ ├── common │ │ │ │ └── converter │ │ │ │ │ └── UserConverter.java │ │ │ │ ├── controller │ │ │ │ ├── DemoController.java │ │ │ │ └── UserController.java │ │ │ │ ├── dao │ │ │ │ ├── UserMapper.java │ │ │ │ └── mapping │ │ │ │ │ └── UserMapper.xml │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── service │ │ │ │ ├── IUserService.java │ │ │ │ └── impl │ │ │ │ └── UserServiceImpl.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── dream │ │ └── bus │ │ └── BusApplicationTests.java ├── pom.xml └── requests │ ├── http-client.env.json │ └── school-bus.http ├── school-bus ├── .DS_Store ├── guns-api │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── rest │ │ │ ├── alipay │ │ │ ├── IPayService.java │ │ │ └── dto │ │ │ │ ├── PayBackRequest.java │ │ │ │ ├── PayRequset.java │ │ │ │ └── PayResponse.java │ │ │ ├── bus │ │ │ ├── IBusService.java │ │ │ └── dto │ │ │ │ ├── BusDto.java │ │ │ │ ├── CountDetailDto.java │ │ │ │ ├── CountDetailRequest.java │ │ │ │ ├── CountDetailResponse.java │ │ │ │ ├── CountDto.java │ │ │ │ ├── CountSimpleDto.java │ │ │ │ ├── PageBusRequest.java │ │ │ │ ├── PageBusResponse.java │ │ │ │ ├── PageCountRequest.java │ │ │ │ └── PageCountResponse.java │ │ │ ├── common │ │ │ ├── AbstractRequest.java │ │ │ ├── AbstractResponse.java │ │ │ ├── ResponseData.java │ │ │ ├── ResponseUtil.java │ │ │ └── convert │ │ │ │ └── DateMapper.java │ │ │ ├── exception │ │ │ └── CommonResponse.java │ │ │ ├── mq │ │ │ └── MQDto.java │ │ │ ├── myutils │ │ │ └── UUIDUtils.java │ │ │ ├── order │ │ │ ├── IOrderService.java │ │ │ └── dto │ │ │ │ ├── AddOrderRequest.java │ │ │ │ ├── AddOrderResponse.java │ │ │ │ ├── EvaluateDto.java │ │ │ │ ├── EvaluateRequest.java │ │ │ │ ├── EvaluateResponse.java │ │ │ │ ├── NoPayDto.java │ │ │ │ ├── NoPayRequest.java │ │ │ │ ├── NoPayResponse.java │ │ │ │ ├── NoTakeBusRequest.java │ │ │ │ ├── NoTakeBusResponse.java │ │ │ │ ├── NoTakeDto.java │ │ │ │ ├── OrderDto.java │ │ │ │ ├── OrderRequest.java │ │ │ │ └── OrderResponse.java │ │ │ └── user │ │ │ ├── IUserService.java │ │ │ └── dto │ │ │ ├── UserCheckRequest.java │ │ │ ├── UserCheckResponse.java │ │ │ ├── UserDto.java │ │ │ ├── UserLoginRequst.java │ │ │ ├── UserLoginResponse.java │ │ │ ├── UserRegisterRequest.java │ │ │ ├── UserRegisterResponse.java │ │ │ ├── UserRequest.java │ │ │ ├── UserResponse.java │ │ │ └── UserUpdateInfoRequest.java │ │ └── resources │ │ └── application.yml ├── guns-bus │ ├── .DS_Store │ ├── pom.xml │ ├── sb-bus.log.2020-04-06.0.gz │ └── src │ │ ├── main │ │ ├── .DS_Store │ │ ├── java │ │ │ ├── .DS_Store │ │ │ └── com │ │ │ │ └── stylefeng │ │ │ │ └── guns │ │ │ │ └── rest │ │ │ │ ├── GunsBusApplication.java │ │ │ │ ├── GunsBusServletInitializer.java │ │ │ │ ├── common │ │ │ │ ├── RedisUtils.java │ │ │ │ ├── SimpleObject.java │ │ │ │ ├── exception │ │ │ │ │ └── BizExceptionEnum.java │ │ │ │ └── persistence │ │ │ │ │ ├── dao │ │ │ │ │ ├── BusMapper.java │ │ │ │ │ ├── CountMapper.java │ │ │ │ │ └── mapping │ │ │ │ │ │ ├── BusMapper.xml │ │ │ │ │ │ └── CountMapper.xml │ │ │ │ │ └── model │ │ │ │ │ ├── Bus.java │ │ │ │ │ └── Count.java │ │ │ │ ├── config │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ └── RedisConfig.java │ │ │ │ └── modular │ │ │ │ └── bus │ │ │ │ ├── BusServiceImpl.java │ │ │ │ ├── converter │ │ │ │ ├── BusConverter.java │ │ │ │ └── CountConverter.java │ │ │ │ ├── mq │ │ │ │ └── OrderSeatsCancleListener.java │ │ │ │ └── schedule │ │ │ │ └── BusSchedule.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── stylefeng │ │ └── guns │ │ ├── GunsBusApplicationTests.java │ │ ├── generator │ │ └── EntityGenerator.java │ │ └── rest │ │ ├── BusServiceTest.java │ │ └── CountMapperTest.java ├── guns-core │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── stylefeng │ │ │ └── guns │ │ │ └── core │ │ │ ├── config │ │ │ └── DefaultFastjsonConfig.java │ │ │ ├── constants │ │ │ ├── MqTags.java │ │ │ ├── RedisConstants.java │ │ │ └── SbCode.java │ │ │ ├── exception │ │ │ ├── CastException.java │ │ │ ├── CustomerException.java │ │ │ ├── GunsException.java │ │ │ ├── GunsExceptionEnum.java │ │ │ └── ServiceExceptionEnum.java │ │ │ ├── support │ │ │ ├── BasicType.java │ │ │ ├── BeanKit.java │ │ │ ├── ClassKit.java │ │ │ ├── CollectionKit.java │ │ │ ├── DateTime.java │ │ │ ├── DateTimeKit.java │ │ │ ├── HexKit.java │ │ │ ├── HttpKit.java │ │ │ ├── ObjectKit.java │ │ │ ├── PageKit.java │ │ │ ├── StrKit.java │ │ │ ├── WafKit.java │ │ │ ├── WafRequestWrapper.java │ │ │ └── exception │ │ │ │ └── ToolBoxException.java │ │ │ └── util │ │ │ ├── Convert.java │ │ │ ├── DateUtil.java │ │ │ ├── FileUtil.java │ │ │ ├── HttpSessionHolder.java │ │ │ ├── IdGenerator.java │ │ │ ├── MD5Util.java │ │ │ ├── NumUtil.java │ │ │ ├── PingYinUtil.java │ │ │ ├── RenderUtil.java │ │ │ ├── ResKit.java │ │ │ ├── SimpleContrast.java │ │ │ ├── SpringContextHolder.java │ │ │ ├── SqlUtil.java │ │ │ └── ToolUtil.java │ │ └── resources │ │ ├── META-INF │ │ └── spring.factories │ │ └── default-config.properties ├── guns-gateway │ ├── .DS_Store │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── stylefeng │ │ │ │ └── guns │ │ │ │ └── rest │ │ │ │ ├── GunsGatewayApplication.java │ │ │ │ ├── GunsGatewayServletInitializer.java │ │ │ │ ├── common │ │ │ │ ├── CommonBindingResult.java │ │ │ │ ├── CurrentUser.java │ │ │ │ ├── RedisUtils.java │ │ │ │ ├── SimpleObject.java │ │ │ │ └── exception │ │ │ │ │ └── BizExceptionEnum.java │ │ │ │ ├── config │ │ │ │ ├── MessageConverConfig.java │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ ├── RedisConfig.java │ │ │ │ ├── Swagger2Config.java │ │ │ │ ├── WebConfig.java │ │ │ │ └── properties │ │ │ │ │ ├── JwtProperties.java │ │ │ │ │ └── RestProperties.java │ │ │ │ └── modular │ │ │ │ ├── alipay │ │ │ │ └── PayController.java │ │ │ │ ├── auth │ │ │ │ ├── controller │ │ │ │ │ ├── AuthController.java │ │ │ │ │ └── dto │ │ │ │ │ │ ├── AuthRequest.java │ │ │ │ │ │ └── AuthResponse.java │ │ │ │ ├── converter │ │ │ │ │ ├── BaseTransferEntity.java │ │ │ │ │ └── WithSignMessageConverter.java │ │ │ │ ├── filter │ │ │ │ │ └── AuthFilter.java │ │ │ │ ├── security │ │ │ │ │ ├── DataSecurityAction.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── Base64SecurityAction.java │ │ │ │ └── util │ │ │ │ │ └── JwtTokenUtil.java │ │ │ │ ├── bus │ │ │ │ └── BusController.java │ │ │ │ ├── form │ │ │ │ ├── AddOrderForm.java │ │ │ │ ├── CountPageInfo.java │ │ │ │ ├── OrderPageInfo.java │ │ │ │ ├── OrderUpdateForm.java │ │ │ │ ├── PayBackForm.java │ │ │ │ ├── PayForm.java │ │ │ │ ├── UserRegstierForm.java │ │ │ │ └── UserUpdateForm.java │ │ │ │ ├── order │ │ │ │ └── OrderController.java │ │ │ │ └── user │ │ │ │ └── UserController.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── static │ │ │ └── file │ │ │ └── seat.json │ │ └── test │ │ └── java │ │ └── com │ │ └── stylefeng │ │ └── guns │ │ ├── GunsRestApplicationTests.java │ │ ├── fastjson │ │ └── JsonTest.java │ │ ├── generator │ │ └── EntityGenerator.java │ │ ├── jwt │ │ ├── DecryptTest.java │ │ └── JWTTest.java │ │ └── rest │ │ └── OrderController.java ├── guns-order │ ├── .DS_Store │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── .DS_Store │ │ ├── java │ │ │ ├── .DS_Store │ │ │ └── com │ │ │ │ └── stylefeng │ │ │ │ └── guns │ │ │ │ └── rest │ │ │ │ ├── GunsOrderApplication.java │ │ │ │ ├── GunsOrderServletInitializer.java │ │ │ │ ├── common │ │ │ │ ├── SimpleObject.java │ │ │ │ ├── exception │ │ │ │ │ └── BizExceptionEnum.java │ │ │ │ └── persistence │ │ │ │ │ ├── dao │ │ │ │ │ ├── OrderMapper.java │ │ │ │ │ └── mapping │ │ │ │ │ │ └── OrderMapper.xml │ │ │ │ │ └── model │ │ │ │ │ └── Order.java │ │ │ │ ├── config │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ ├── RedisConfig.java │ │ │ │ └── RedisListenerConfig.java │ │ │ │ └── modular │ │ │ │ └── order │ │ │ │ ├── OrderServiceImpl.java │ │ │ │ ├── RedisUtils.java │ │ │ │ ├── converter │ │ │ │ └── OrderConvertver.java │ │ │ │ ├── mq │ │ │ │ └── OrderAddCancleListener.java │ │ │ │ └── rd │ │ │ │ └── RedisKeyExpirationListener.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── stylefeng │ │ └── guns │ │ ├── GunsOrderApplicationTests.java │ │ ├── generator │ │ └── EntityGenerator.java │ │ └── rest │ │ ├── MessageProvider.java │ │ ├── OrderMapperTest.java │ │ ├── OrderServiceTest.java │ │ ├── RedisMQ.java │ │ ├── RedisMQConsumer.java │ │ ├── RedisMessage.java │ │ ├── RedisUtils.java │ │ └── RocketMQTest.java ├── guns-pay │ ├── .DS_Store │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── stylefeng │ │ │ │ └── guns │ │ │ │ └── rest │ │ │ │ ├── GunsPayApplication.java │ │ │ │ ├── GunsPayServletInitializer.java │ │ │ │ ├── common │ │ │ │ ├── SimpleObject.java │ │ │ │ └── exception │ │ │ │ │ └── BizExceptionEnum.java │ │ │ │ ├── config │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ └── RedisConfig.java │ │ │ │ └── modular │ │ │ │ └── pay │ │ │ │ ├── PayServiceImpl.java │ │ │ │ └── RedisUtils.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── stylefeng │ │ └── guns │ │ ├── GunsPayApplicationTests.java │ │ └── generator │ │ └── EntityGenerator.java ├── guns-user │ ├── .DS_Store │ ├── pom.xml │ └── src │ │ ├── .DS_Store │ │ ├── main │ │ ├── .DS_Store │ │ ├── java │ │ │ ├── .DS_Store │ │ │ └── com │ │ │ │ ├── .DS_Store │ │ │ │ └── stylefeng │ │ │ │ ├── .DS_Store │ │ │ │ └── guns │ │ │ │ ├── .DS_Store │ │ │ │ └── rest │ │ │ │ ├── .DS_Store │ │ │ │ ├── GunsUserApplication.java │ │ │ │ ├── GunsUserServletInitializer.java │ │ │ │ ├── common │ │ │ │ ├── .DS_Store │ │ │ │ ├── SimpleObject.java │ │ │ │ ├── exception │ │ │ │ │ └── BizExceptionEnum.java │ │ │ │ └── persistence │ │ │ │ │ ├── .DS_Store │ │ │ │ │ ├── dao │ │ │ │ │ ├── .DS_Store │ │ │ │ │ ├── UserMapper.java │ │ │ │ │ └── mapping │ │ │ │ │ │ └── UserMapper.xml │ │ │ │ │ └── model │ │ │ │ │ └── User.java │ │ │ │ ├── config │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ └── RedisConfig.java │ │ │ │ └── modular │ │ │ │ └── user │ │ │ │ ├── RedisUtils.java │ │ │ │ ├── UserServiceImpl.java │ │ │ │ ├── converter │ │ │ │ └── UserConverter.java │ │ │ │ └── mq │ │ │ │ └── PayMoneyCancleListener.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── stylefeng │ │ └── guns │ │ ├── GunsUserApplicationTests.java │ │ ├── generator │ │ └── EntityGenerator.java │ │ └── rest │ │ ├── HutoolTest.java │ │ ├── RedisTest.java │ │ ├── RocketMQTest.java │ │ ├── UserMapperTest.java │ │ └── UserServiceTest.java ├── pom.xml └── requests │ ├── http-client.env.json │ ├── http-client.private.env.json │ └── school-bus.http └── school_bus.sql /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | # idea 26 | .idea 27 | out 28 | 29 | # iml 30 | *.iml 31 | target 32 | /school_bus/*.gz 33 | -------------------------------------------------------------------------------- /doc/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/doc/.DS_Store -------------------------------------------------------------------------------- /imgs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/.DS_Store -------------------------------------------------------------------------------- /imgs/下单服务页面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/下单服务页面.png -------------------------------------------------------------------------------- /imgs/个人中心.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/个人中心.png -------------------------------------------------------------------------------- /imgs/前端我的订单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/前端我的订单.png -------------------------------------------------------------------------------- /imgs/前端支付页面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/前端支付页面.png -------------------------------------------------------------------------------- /imgs/前端班车服务.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/前端班车服务.png -------------------------------------------------------------------------------- /imgs/前端用户服务页面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/前端用户服务页面.png -------------------------------------------------------------------------------- /imgs/后端环境启动.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/后端环境启动.png -------------------------------------------------------------------------------- /imgs/已评价订单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/已评价订单.png -------------------------------------------------------------------------------- /imgs/待支付订单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/待支付订单.png -------------------------------------------------------------------------------- /imgs/待评价订单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/待评价订单.png -------------------------------------------------------------------------------- /imgs/总架构路线.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/总架构路线.png -------------------------------------------------------------------------------- /imgs/技术选型.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/技术选型.png -------------------------------------------------------------------------------- /imgs/搭建后端环境.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/搭建后端环境.png -------------------------------------------------------------------------------- /imgs/支付金额.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/支付金额.png -------------------------------------------------------------------------------- /imgs/未乘坐订单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/未乘坐订单.png -------------------------------------------------------------------------------- /imgs/用户注册.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/用户注册.png -------------------------------------------------------------------------------- /imgs/用户登录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/用户登录.png -------------------------------------------------------------------------------- /imgs/申请退款.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/申请退款.png -------------------------------------------------------------------------------- /imgs/确认订单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/确认订单.png -------------------------------------------------------------------------------- /imgs/订单详情.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/订单详情.png -------------------------------------------------------------------------------- /imgs/车次信息.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/车次信息.png -------------------------------------------------------------------------------- /imgs/车次列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/imgs/车次列表.png -------------------------------------------------------------------------------- /school-bus-cloud/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/auth/AuthClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: AuthClient 4 | * @author: mf 5 | * @create: 2020/11/03 14:10 6 | */ 7 | package com.dream.bus.auth; 8 | 9 | import com.dream.bus.auth.param.AuthRequest; 10 | import com.dream.bus.param.ResponseData; 11 | import org.springframework.cloud.openfeign.FeignClient; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | 15 | @FeignClient(value = "bus-auth") 16 | public interface AuthClient { 17 | 18 | @RequestMapping("/auth") 19 | ResponseData createAuthenticationToken(AuthRequest authRequest); 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/auth/param/AuthRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: AuthRequest 4 | * @author: mf 5 | * @create: 2020/11/03 14:12 6 | */ 7 | 8 | package com.dream.bus.auth.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class AuthRequest { 14 | 15 | private String userName; 16 | 17 | private String password; 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/auth/param/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus.auth.param; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/BusClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: BusClient 4 | * @author: mf 5 | * @create: 2020/11/08 13:22 6 | */ 7 | package com.dream.bus.bus; 8 | 9 | import com.dream.bus.param.ResponseData; 10 | import org.springframework.cloud.openfeign.FeignClient; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | 14 | @FeignClient(value = "bus-bus") 15 | public interface BusClient { 16 | 17 | @GetMapping("/bus/repeatSeats") 18 | boolean repeatSeats(@RequestParam String seats, @RequestParam Long coundId); 19 | 20 | @GetMapping("/bus/addSeats") 21 | boolean addSeats(@RequestParam String seats, @RequestParam Long coundId); 22 | 23 | @GetMapping("/bus/filterRepeatSeats") 24 | boolean filterRepeatSeats(@RequestParam String seats, @RequestParam Long coundId); 25 | } 26 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/BusDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: BusVO 4 | * @author: mf 5 | * @create: 2020/03/01 16:42 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | 11 | import lombok.Data; 12 | 13 | import java.io.Serializable; 14 | 15 | @Data 16 | //@ApiModel(description = "班车表现实体") 17 | public class BusDto implements Serializable { 18 | // @ApiModelProperty(notes = "班车id") 19 | private Long uuid; 20 | // @ApiModelProperty(notes = "座位人数") 21 | private String limitNumber; 22 | // @ApiModelProperty(notes = "司机姓名") 23 | private String driverName; 24 | // @ApiModelProperty(notes = "司机号码") 25 | private String driverPhone; 26 | // @ApiModelProperty(notes = "座位路径") 27 | private String seatsNumber; 28 | // @ApiModelProperty(notes = "创建时间") 29 | private String beginTime; 30 | // @ApiModelProperty(notes = "更新时间") 31 | private String updateTime; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/CountDetailDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDetailDto 4 | * @author: mf 5 | * @create: 2020/03/12 20:50 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | //@ApiModel(description = "场次详情Dto") 15 | @Data 16 | public class CountDetailDto implements Serializable { 17 | 18 | // @ApiModelProperty(notes = "场次id") 19 | private Long uuid; 20 | // @ApiModelProperty(notes = "班车id") 21 | private Long busId; 22 | // @ApiModelProperty(notes = "司机姓名") 23 | private String driverName; 24 | // @ApiModelProperty(notes = "0:沙河;1:清水河") 25 | private String busStatus; 26 | // @ApiModelProperty(notes = "班车出发时间") 27 | private String beginTime; 28 | // @ApiModelProperty(notes = "出发日期") 29 | private String beginDate; 30 | // @ApiModelProperty(notes = "已选座位") 31 | private String selectedSeats; 32 | // @ApiModelProperty(notes = "座位路径") 33 | private String seatsNumber; 34 | // @ApiModelProperty(notes = "场次价格") 35 | private Double price; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/CountDetailRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDetailRequest 4 | * @author: mf 5 | * @create: 2020/03/12 21:07 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | 14 | @Data 15 | public class CountDetailRequest extends AbstractRequest { 16 | // 场次id 17 | private Long countId; 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/CountDetailResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDetailResponse 4 | * @author: mf 5 | * @create: 2020/03/12 21:06 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class CountDetailResponse extends AbstractResponse { 15 | private CountDetailDto countDetailDto; 16 | } 17 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/CountDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDto 4 | * @author: mf 5 | * @create: 2020/03/02 12:48 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | public class CountDto implements Serializable { 16 | // @ApiModelProperty(notes = "场次id") 17 | private Long uuid; 18 | // @ApiModelProperty(notes = "班车id") 19 | private Long busId; 20 | // @ApiModelProperty(notes = "班车出发时间") 21 | private String beginTime; 22 | // @ApiModelProperty(notes = "班车结束时间") 23 | private String endTime; 24 | // @ApiModelProperty(notes = "0:沙河;1:清水河;2:沙河到清水河;3:清水河到沙河") 25 | private String bus_status; 26 | // @ApiModelProperty(notes = "场次价格") 27 | private Double price; 28 | // @ApiModelProperty(notes = "已选座位") 29 | private String selectedSeats; 30 | // @ApiModelProperty(notes = "0:未满;1:已满") 31 | private String seatStatus; 32 | // @ApiModelProperty(notes = "出发日期") 33 | private String beginDate; 34 | // @ApiModelProperty(notes = "更新时间") 35 | private String updateTime; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/CountPageInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageInfo 4 | * @author: mf 5 | * @create: 2020/03/01 22:58 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | //@ApiModel(value = "分页实体", description = "分页请求信息") 14 | public class CountPageInfo { 15 | 16 | // @ApiModelProperty(name = "currentPage", value = "当前页", example = "1", dataType = "long", required = true) 17 | private Long currentPage; 18 | 19 | // @ApiModelProperty(name = "pageSize", value = "每页的条目数量", example = "4", dataType = "long", required = true) 20 | private Long pageSize; 21 | 22 | // @ApiModelProperty(name = "busStatus", value = "0:沙河->清水河,1:清水河->沙河", example = "0", dataType = "String", required = true) 23 | private String busStatus; 24 | } 25 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/CountSimpleDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountSimpleDto 4 | * @author: mf 5 | * @create: 2020/03/10 01:13 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | //@ApiModel(description = "车次列表的Dto") 16 | public class CountSimpleDto implements Serializable { 17 | // @ApiModelProperty(notes = "场次id") 18 | private Long uuid; 19 | // @ApiModelProperty(notes = "班车id") 20 | private Long busId; 21 | // @ApiModelProperty(notes = "班车出发时间") 22 | private String beginTime; 23 | // @ApiModelProperty(notes = "0:沙河;1:清水河;2:沙河到清水河;3:清水河到沙河") 24 | private String busStatus; 25 | // @ApiModelProperty(notes = "出发日期") 26 | private String beginDate; 27 | // @ApiModelProperty(notes = "0:未满;1:已满") 28 | private String seatStatus; 29 | } 30 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/PageBusRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageBusCountRequest 4 | * @author: mf 5 | * @create: 2020/03/01 16:51 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PageBusRequest extends AbstractRequest { 15 | 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/PageBusResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageBusCountResponse 4 | * @author: mf 5 | * @create: 2020/03/01 16:54 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | 11 | import com.dream.bus.param.AbstractResponse; 12 | import lombok.Data; 13 | 14 | import java.util.List; 15 | 16 | @Data 17 | //@ApiModel(description = "班车Dto") 18 | public class PageBusResponse extends AbstractResponse { 19 | 20 | // 当前页 21 | // @ApiModelProperty(notes = "当前页") 22 | private Long currentPage; 23 | // 每页数量 24 | // @ApiModelProperty(notes = "每页数量") 25 | private Long pageSize; 26 | // 总量 27 | // @ApiModelProperty(notes = "总量") 28 | private Long total; 29 | // 总页 30 | // @ApiModelProperty(notes = "总页") 31 | private Long pages; 32 | // BusDto 33 | // @ApiModelProperty(notes = "班车列表") 34 | private List busDtos; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/PageCountRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageCountRequest 4 | * @author: mf 5 | * @create: 2020/03/02 12:48 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PageCountRequest extends AbstractRequest { 15 | 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | // 地区状态 21 | private String busStatus; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/bus/param/PageCountResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageCountResponse 4 | * @author: mf 5 | * @create: 2020/03/02 12:51 6 | */ 7 | 8 | package com.dream.bus.bus.param; 9 | 10 | 11 | import com.dream.bus.param.AbstractResponse; 12 | import lombok.Data; 13 | 14 | import java.util.List; 15 | 16 | @Data 17 | //@ApiModel(description = "车次列表Dto") 18 | public class PageCountResponse extends AbstractResponse { 19 | // 当前页 20 | // @ApiModelProperty(notes = "当前页") 21 | private Long currentPage; 22 | // 每页数量 23 | // @ApiModelProperty(notes = "每页数量") 24 | private Long pageSize; 25 | // 总量 26 | // @ApiModelProperty(notes = "总量") 27 | private Long total; 28 | // 总页 29 | // @ApiModelProperty(notes = "总页") 30 | private Long pages; 31 | // count 32 | // @ApiModelProperty(notes = "场次列表") 33 | List countSimpleDtos; 34 | // List countDtos; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/mq/MQDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderMQDto 4 | * @author: mf 5 | * @create: 2020/03/19 11:06 6 | */ 7 | 8 | package com.dream.bus.mq; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | public class MQDto implements Serializable { 16 | private Long orderId; // 订单id 17 | private Long countId; // 场次id 18 | private Long userId; // 用户id 19 | private Double userMoney; // 用户钱 20 | private String seatsIds; // 座位id 21 | } 22 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/OrderClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: OrdClient 4 | * @author: mf 5 | * @create: 2020/11/08 14:45 6 | */ 7 | package com.dream.bus.order; 8 | 9 | import com.dream.bus.order.param.OrderRequest; 10 | import com.dream.bus.order.param.OrderResponse; 11 | import com.dream.bus.user.param.UserUpdateInfoRequest; 12 | import org.springframework.cloud.openfeign.FeignClient; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | import org.springframework.web.bind.annotation.RequestBody; 15 | 16 | @FeignClient(value = "bus-order") 17 | public interface OrderClient { 18 | 19 | @PostMapping("user/localUpdateOrderStatus") 20 | OrderResponse localUpdateOrderStatus(@RequestBody OrderRequest request); 21 | } 22 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/AddOrderForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AddOrderForm 4 | * @author: mf 5 | * @create: 2020/03/15 03:01 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import lombok.Data; 11 | 12 | //@ApiModel(value = "更新实体", description = "更新请求信息") 13 | @Data 14 | public class AddOrderForm { 15 | // @ApiModelProperty(value = "场次id", required = true) 16 | private Long countId; 17 | // @ApiModelProperty(value = "下单人", required = true) 18 | private String orderUser; 19 | // @ApiModelProperty(value = "0:沙河->清水河;1:清水河->沙河", required = true) 20 | private String busStatus; 21 | // @ApiModelProperty(value = "已选座位编号,例如:1,2", required = true) 22 | private String seatsIds; 23 | // @ApiModelProperty(value = "场次价格", required = true) 24 | private Double countPrice; 25 | // @ApiModelProperty(value = "订单过期时间", required = true) 26 | private Integer expireTime; 27 | } 28 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/AddOrderRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AddOrderRequest 4 | * @author: mf 5 | * @create: 2020/03/14 18:47 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class AddOrderRequest extends AbstractRequest { 15 | // 场次id 16 | private Long countId; 17 | // 用户id 18 | private Long userId; 19 | private String orderUser; 20 | private String busStatus; 21 | private String seatsIds; 22 | private Double countPrice; 23 | private Integer expireTime; 24 | } 25 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/AddOrderResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AddOrderResponse 4 | * @author: mf 5 | * @create: 2020/03/14 19:00 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class AddOrderResponse extends AbstractResponse { 15 | 16 | private OrderDto orderDto; 17 | 18 | private Long orderId; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/EvaluateDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: EvaluateDto 4 | * @author: mf 5 | * @create: 2020/03/10 00:51 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | //@ApiModel("评价订单Dto") 16 | public class EvaluateDto implements Serializable { 17 | // @ApiModelProperty(notes = "订单id") 18 | private Long uuid; 19 | // @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 20 | private String busStatus; 21 | // @ApiModelProperty(notes = "已选座位") 22 | private String seatsIds; 23 | // @ApiModelProperty(notes = "下单时间") 24 | private String orderTime; 25 | // @ApiModelProperty(notes = "下单用户") 26 | private String orderUser; 27 | // @ApiModelProperty(notes = "班车出发时间") 28 | private String beginTime; 29 | // @ApiModelProperty(notes = "班车id") 30 | private Long busId; 31 | // @ApiModelProperty(notes = "0:未评价;1:已评价") 32 | private String evaluateStatus; 33 | // @ApiModelProperty(notes = "评论内容") 34 | private String comment; 35 | } 36 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/EvaluateRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: EvaluateRequest 4 | * @author: mf 5 | * @create: 2020/03/06 02:39 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class EvaluateRequest extends AbstractRequest { 15 | private Long userId; 16 | // 评价状态 17 | private String evaluateStatus; 18 | // 当前页 19 | private Long currentPage; 20 | // 每页数量 21 | private Long pageSize; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/EvaluateResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: EvaluateResponse 4 | * @author: mf 5 | * @create: 2020/03/06 02:40 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | import java.util.List; 14 | 15 | @Data 16 | //@ApiModel("订单评价列表Dto") 17 | public class EvaluateResponse extends AbstractResponse { 18 | // 当前页 19 | // @ApiModelProperty(notes = "当前页") 20 | private Long currentPage; 21 | // 每页数量 22 | // @ApiModelProperty(notes = "每页数量") 23 | private Long pageSize; 24 | // 总量 25 | // @ApiModelProperty(notes = "总量") 26 | private Long total; 27 | // 总页 28 | // @ApiModelProperty(notes = "总页") 29 | private Long pages; 30 | // @ApiModelProperty(notes = "订单列表") 31 | // List orderDtos; 32 | List evaluateDtos; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/NoPayDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoPayDto 4 | * @author: mf 5 | * @create: 2020/03/15 16:21 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | 11 | import lombok.Data; 12 | 13 | import java.io.Serializable; 14 | 15 | @Data 16 | public class NoPayDto implements Serializable { 17 | // @ApiModelProperty(notes = "订单id") 18 | private Long uuid; 19 | // @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 20 | private String busStatus; 21 | // @ApiModelProperty(notes = "已选座位") 22 | private String seatsIds; 23 | // @ApiModelProperty(notes = "下单时间") 24 | private String orderTime; 25 | // @ApiModelProperty(notes = "下单用户") 26 | private String orderUser; 27 | // @ApiModelProperty(notes = "订单状态,0-待支付,1-已支付,2-已关闭") 28 | private String orderStatus; 29 | // @ApiModelProperty(notes = "班车出发时间") 30 | private String beginTime; 31 | // @ApiModelProperty(notes = "班车id") 32 | private Long busId; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/NoPayRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoPayRequest 4 | * @author: mf 5 | * @create: 2020/03/15 16:17 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class NoPayRequest extends AbstractRequest { 15 | private Long userId; 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/NoPayResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoPayResponse 4 | * @author: mf 5 | * @create: 2020/03/15 16:18 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | import java.util.List; 14 | 15 | @Data 16 | public class NoPayResponse extends AbstractResponse { 17 | // 当前页 18 | // @ApiModelProperty(notes = "当前页") 19 | private Long currentPage; 20 | // 每页数量 21 | // @ApiModelProperty(notes = "每页数量") 22 | private Long pageSize; 23 | // 总量 24 | // @ApiModelProperty(notes = "总量") 25 | private Long total; 26 | // 总页 27 | // @ApiModelProperty(notes = "总页") 28 | private Long pages; 29 | // @ApiModelProperty(notes = "未支付订单列表") 30 | private List noPayDtos; 31 | } 32 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/NoTakeBusRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoTakeBusRequest 4 | * @author: mf 5 | * @create: 2020/03/04 22:16 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class NoTakeBusRequest extends AbstractRequest { 15 | private Long userId; 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/NoTakeBusResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoTakeBusResponse 4 | * @author: mf 5 | * @create: 2020/03/04 22:18 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | import java.util.List; 14 | 15 | @Data 16 | //@ApiModel("未乘坐订单Dto") 17 | public class NoTakeBusResponse extends AbstractResponse { 18 | // 当前页 19 | // @ApiModelProperty(notes = "当前页") 20 | private Long currentPage; 21 | // 每页数量 22 | // @ApiModelProperty(notes = "每页数量") 23 | private Long pageSize; 24 | // 总量 25 | // @ApiModelProperty(notes = "总量") 26 | private Long total; 27 | // 总页 28 | // @ApiModelProperty(notes = "总页") 29 | private Long pages; 30 | // @ApiModelProperty(notes = "未乘坐订单列表") 31 | List noTakeDtos; 32 | // List orderDtos; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/NoTakeDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoTakeDto 4 | * @author: mf 5 | * @create: 2020/03/09 22:25 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | //@ApiModel(description = "未乘坐订单简单Dto") 16 | public class NoTakeDto implements Serializable { 17 | // @ApiModelProperty(notes = "订单id") 18 | private Long uuid; 19 | // @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 20 | private String busStatus; 21 | // @ApiModelProperty(notes = "已选座位") 22 | private String seatsIds; 23 | // @ApiModelProperty(notes = "下单时间") 24 | private String orderTime; 25 | // @ApiModelProperty(notes = "下单用户") 26 | private String orderUser; 27 | // @ApiModelProperty(notes = "订单状态,0-待支付,1-已支付,2-已关闭") 28 | private String orderStatus; 29 | // @ApiModelProperty(notes = "班车出发时间") 30 | private String beginTime; 31 | // @ApiModelProperty(notes = "班车id") 32 | private Long busId; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/OrderDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderDto 4 | * @author: mf 5 | * @create: 2020/03/04 22:10 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | 11 | import lombok.Data; 12 | 13 | import java.io.Serializable; 14 | 15 | @Data 16 | //@ApiModel(description = "订单展示实体") 17 | public class OrderDto implements Serializable { 18 | 19 | // @ApiModelProperty(notes = "订单id") 20 | private Long uuid; 21 | // @ApiModelProperty(notes = "场次id") 22 | private Long countId; 23 | // @ApiModelProperty(notes = "车牌号") 24 | private Long busId; 25 | // @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 26 | private String busStatus; 27 | // @ApiModelProperty(notes = "已选座位") 28 | private String seatsIds; 29 | // @ApiModelProperty(notes = "场次价格") 30 | private Double countPrice; 31 | // @ApiModelProperty(notes = "订单总价格") 32 | private Double orderPrice; 33 | // @ApiModelProperty(notes = "发车日期") 34 | private String beginDate; 35 | // @ApiModelProperty(notes = "发车时间") 36 | private String beginTime; 37 | // @ApiModelProperty(notes = "下单用户") 38 | private String orderUser; 39 | // @ApiModelProperty(notes = "订单状态,0-待支付,1-已支付,2-已关闭") 40 | private String orderStatus; 41 | // @ApiModelProperty(notes = "下单时间") 42 | private String orderTime; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/OrderPageInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderPageInfo 4 | * @author: mf 5 | * @create: 2020/03/15 16:37 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | //@ApiModel(value = "分页实体", description = "分页请求信息") 14 | public class OrderPageInfo { 15 | // @ApiModelProperty(name = "currentPage", value = "当前页", example = "1", dataType = "long", required = true) 16 | private Long currentPage; 17 | 18 | // @ApiModelProperty(name = "pageSize", value = "每页的条目数量", example = "4", dataType = "long", required = true) 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/OrderRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderRequest 4 | * @author: mf 5 | * @create: 2020/03/15 03:10 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class OrderRequest extends AbstractRequest { 15 | 16 | private Long uuid; 17 | 18 | private String orderStatus; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/OrderResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderResponse 4 | * @author: mf 5 | * @create: 2020/03/15 03:11 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class OrderResponse extends AbstractResponse { 15 | 16 | private OrderDto orderDto; 17 | } 18 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/order/param/OrderUpdateForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderUpdateForm 4 | * @author: mf 5 | * @create: 2020/04/06 17:14 6 | */ 7 | 8 | package com.dream.bus.order.param; 9 | 10 | import lombok.Data; 11 | 12 | //@ApiModel(value = "更新实体", description = "更新请求信息") 13 | @Data 14 | public class OrderUpdateForm { 15 | 16 | // @ApiModelProperty(name = "orderId", value = "订单id", example = "1", required = true, dataType = "Long") 17 | private Long OrderId; 18 | // @ApiModelProperty(name = "orderStatus", value = "订单装填", example = "1", required = true, dataType = "String") 19 | private String orderStatus; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/param/AbstractRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: AbstractRequest 4 | * @author: mf 5 | * @create: 2020/10/31 15:24 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import java.io.Serializable; 11 | 12 | public abstract class AbstractRequest implements Serializable { 13 | private static final long serialVersionUID = 171717171717171L; 14 | } 15 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/param/AbstractResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: AbstractResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:24 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | public abstract class AbstractResponse implements Serializable { 16 | private static final long serivalVersionUID = 7642323132212L; 17 | // @ApiModelProperty(notes = "状态码") 18 | private String code; 19 | // @ApiModelProperty(notes = "状态消息") 20 | private String msg; 21 | } 22 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/param/CommonBindingResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: CommonBindingResult 4 | * @author: mf 5 | * @create: 2020/11/03 14:15 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import org.springframework.validation.BindingResult; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | public class CommonBindingResult { 16 | public static String getErrors(BindingResult bindingResult) { 17 | ArrayList errors = bindingResult.getFieldErrors() 18 | .stream() 19 | .collect(() -> new ArrayList(), (l, o) -> { 20 | l.add(o.getDefaultMessage()); 21 | }, List::addAll); 22 | return errors.toString(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/param/CommonResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: CommonResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:51 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class CommonResponse extends AbstractResponse{ 14 | } 15 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/param/ResponseData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: ResponseData 4 | * @author: mf 5 | * @create: 2020/10/31 15:52 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class ResponseData { 14 | private boolean success; 15 | 16 | private String message; // 消息 17 | 18 | private int code; 19 | 20 | private T result; // 返回的数据 21 | 22 | private long timestamp = System.currentTimeMillis(); // 时间戳 23 | } 24 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/pay/PayBackForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayBackForm 4 | * @author: mf 5 | * @create: 2020/03/20 17:39 6 | */ 7 | 8 | package com.dream.bus.pay; 9 | 10 | import lombok.Data; 11 | 12 | //@ApiModel(value = "退款实体", description = "退款请求信息") 13 | @Data 14 | public class PayBackForm { 15 | 16 | // @ApiModelProperty(value = "订单id", required = true) 17 | private Long orderId; 18 | // @ApiModelProperty(value = "场次id", required = true) 19 | private Long coundId; 20 | // @ApiModelProperty(value = "座位id", required = true) 21 | private String seatsIds; 22 | // @ApiModelProperty(value = "总金额", required = true) 23 | private Double totalMoney; 24 | } 25 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/pay/PayBackRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayBackRequest 4 | * @author: mf 5 | * @create: 2020/03/20 16:14 6 | */ 7 | 8 | package com.dream.bus.pay; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PayBackRequest extends AbstractRequest { 15 | private Long orderId; 16 | private Long coundId; 17 | private Long userId; 18 | private String seatsIds; 19 | private Double totalMoney; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/pay/PayForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayForm 4 | * @author: mf 5 | * @create: 2020/03/17 16:56 6 | */ 7 | 8 | package com.dream.bus.pay; 9 | 10 | import lombok.Data; 11 | 12 | //@ApiModel(value = "支付实体", description = "支付请求信息") 13 | @Data 14 | public class PayForm { 15 | // @ApiModelProperty(value = "支付密码", required = true) // 这里值得优化 16 | private String payPassword; 17 | // @ApiModelProperty(value = "总价格,直接传钱,感觉不安全", required = true) // 这里值得优化 18 | private Double totalMoney; // 直接传钱, 感觉不安全 19 | } 20 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/pay/PayRequset.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayRequset 4 | * @author: mf 5 | * @create: 2020/03/19 21:02 6 | */ 7 | 8 | package com.dream.bus.pay; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PayRequset extends AbstractRequest { 15 | private Long userId; 16 | private String payPassword; 17 | private Double totalMoney; // 直接传钱, 感觉不安全 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/pay/PayResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayResponse 4 | * @author: mf 5 | * @create: 2020/03/17 16:55 6 | */ 7 | 8 | package com.dream.bus.pay; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PayResponse extends AbstractResponse { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/UserClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserClient 4 | * @author: mf 5 | * @create: 2020/10/31 11:15 6 | */ 7 | package com.dream.bus.user; 8 | 9 | 10 | import com.dream.bus.param.ResponseData; 11 | import com.dream.bus.user.param.*; 12 | import org.springframework.cloud.openfeign.FeignClient; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | @FeignClient(value = "bus-user") 16 | public interface UserClient { 17 | @GetMapping("/user/check") 18 | ResponseData checkUsername(@RequestParam("username") String username); 19 | 20 | @PostMapping("/user/register") 21 | ResponseData register(@RequestBody UserRegstierForm form); 22 | 23 | @PostMapping("/user/login") 24 | ResponseData login(@RequestBody UserLoginRequst requst); // 本身这里要用form的,我懒了 25 | 26 | @GetMapping("/user/localLogin") 27 | UserLoginResponse localLogin(@RequestBody UserLoginRequst requst); 28 | 29 | @GetMapping("user/localGetUserInfo") 30 | UserResponse localGetUserInfo(@RequestBody UserRequest request); 31 | 32 | @PostMapping("user/localUpdateInfo") 33 | UserResponse localUpdateInfo(@RequestBody UserUpdateInfoRequest request); 34 | } 35 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserCheckRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserCheckRequest 4 | * @author: mf 5 | * @create: 2020/10/31 15:26 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserCheckRequest extends AbstractRequest { 15 | 16 | private String username; 17 | } 18 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserCheckResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserCheckResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:26 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserCheckResponse extends AbstractResponse { 15 | 16 | // @ApiModelProperty(notes = "0:用户已经存在,1:用户不存在") 17 | private int checkUsername; // 0 代表有, 1 代表没有 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserDto 4 | * @author: mf 5 | * @create: 2020/10/31 15:19 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | //@ApiModel(description = "用户表现实体") 16 | public class UserDto implements Serializable { 17 | 18 | // @ApiModelProperty(notes = "用户id,这没啥好说的,暂时按自增") 19 | private Long uuid; // 根据用户id 20 | // @ApiModelProperty(notes = "用户名") 21 | private String userName; // 22 | 23 | // private String userPwd; // 密码不能报漏出去 24 | // @ApiModelProperty(notes = "用户昵称") 25 | private String nickName; 26 | // @ApiModelProperty(notes = "0:男,1:女") 27 | private Integer UserSex; 28 | // @ApiModelProperty(notes = "用户邮件") 29 | private String email; 30 | // @ApiModelProperty(notes = "用户手机号码") 31 | private String userPhone; 32 | // @ApiModelProperty(notes = "用户余额") 33 | private Double money; 34 | // @ApiModelProperty(notes = "用户支付密码") // 后期加密 35 | private String payPassword; 36 | // @ApiModelProperty("创建时间") 37 | private String beginTime; 38 | // @ApiModelProperty("更新时间") 39 | private String updateTime; 40 | } 41 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserLoginRequst.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserLoginRequst 4 | * @author: mf 5 | * @create: 2020/10/31 15:27 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserLoginRequst extends AbstractRequest { 15 | 16 | private String username; 17 | 18 | private String password; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserLoginResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserLoginResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:27 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserLoginResponse extends AbstractResponse { 15 | private String randomKey; 16 | 17 | private String token; 18 | 19 | private Long userId; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserRegisterRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserRegisterRequest 4 | * @author: mf 5 | * @create: 2020/10/31 15:28 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserRegisterRequest extends AbstractRequest { 15 | private String username; 16 | 17 | private String password; 18 | 19 | private String email; 20 | 21 | private String phone; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserRegisterResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserRegisterResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:28 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserRegisterResponse extends AbstractResponse { 15 | 16 | // @ApiModelProperty(notes = "true:注册成功,false:注册失败") 17 | private boolean register; 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserRegstierForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserRegstierForm 4 | * @author: mf 5 | * @create: 2020/10/31 16:04 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserRegstierForm { 15 | 16 | // @NotNull(message = "用户名不能为空") 17 | // @ApiModelProperty(value = "用户名", example = "mai", required = true) 18 | private String username; 19 | 20 | // @NotNull(message = "密码不能为空") 21 | // @ApiModelProperty(value = "密码", example = "123", required = true) 22 | private String password; 23 | 24 | // @ApiModelProperty(value = "邮箱", required = false) 25 | private String email; 26 | 27 | // @ApiModelProperty(value = "手机号码", required = false) 28 | private String phone; 29 | } 30 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserRequset 4 | * @author: mf 5 | * @create: 2020/10/31 15:21 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserRequest extends AbstractRequest { 15 | private Long id; // 通过id找 16 | 17 | private String userName; 18 | 19 | private String passPwd; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:22 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserResponse extends AbstractResponse { 15 | 16 | // @ApiModelProperty(notes = "userDto:用户表现体") 17 | private UserDto userDto; // 封装可返回展示的页面数据 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserUpdateForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserUpdateForm 4 | * @author: mf 5 | * @create: 2020/03/02 00:55 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class UserUpdateForm { 14 | private Long id; // 通过id找 15 | 16 | // private String userName; 17 | private String nickName; 18 | 19 | private Integer userSex; 20 | 21 | private String email; 22 | 23 | private String userPhone; 24 | 25 | private Double money; 26 | 27 | private String payPassword; 28 | } 29 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/java/com/dream/bus/user/param/UserUpdateInfoRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserUpdateInfoRequest 4 | * @author: mf 5 | * @create: 2020/10/31 15:29 6 | */ 7 | 8 | package com.dream.bus.user.param; 9 | 10 | import com.dream.bus.param.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserUpdateInfoRequest extends AbstractRequest { 15 | 16 | private Long id; // 通过id找 17 | 18 | // private String userName; 19 | private String nickName; 20 | 21 | private Integer userSex; 22 | 23 | private String email; 24 | 25 | private String userPhone; 26 | 27 | private Double money; 28 | 29 | private String payPassword; 30 | } 31 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-auth/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-auth/src/main/java/com/dream/bus/BusAuthApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | 8 | @SpringBootApplication 9 | @EnableDiscoveryClient 10 | @EnableFeignClients 11 | public class BusAuthApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(BusAuthApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-auth/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | rest: 3 | auth-open: true #jwt鉴权机制是否开启(true或者false) 4 | sign-open: true #签名机制是否开启(true或false) 5 | 6 | jwt: 7 | header: Authorization #http请求头所需要的字段 8 | secret: mySecret #jwt秘钥 9 | expiration: 604800 #7天 单位:秒 10 | auth-path: auth #认证请求的路径 11 | md5-key: randomKey #md5加密混淆key 12 | ignore-url: /user/register,/user/check,/swagger,/v2,/webjars,/seats,/bus,/file 13 | 14 | server: 15 | port: 8080 16 | 17 | spring: 18 | application: 19 | name: bus-auth 20 | 21 | datasource: 22 | driver-class-name: com.mysql.cj.jdbc.Driver 23 | url: jdbc:mysql://39.108.93.119:3306/school_bus?serverTimezone=UTC&useSSL=false&characterEncoding=UTF-8 24 | username: root 25 | password: 123456 26 | hikari: 27 | maximum-pool-size: 20 28 | max-lifetime: 1800000 29 | connection-timeout: 30000 30 | minimum-idle: 5 31 | 32 | redis: 33 | database: 0 34 | host: 39.108.93.119 35 | port: 6179 36 | password: 123 37 | timeout: 5000ms 38 | jedis: 39 | pool: 40 | max-active: 8 41 | max-wait: -1 42 | max-idle: 8 43 | 44 | cloud: 45 | nacos: 46 | discovery: 47 | server-addr: 39.108.93.119:8848 -------------------------------------------------------------------------------- /school-bus-cloud/bus-auth/src/test/java/com/dream/bus/BusAuthApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BusAuthApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/BusBusApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | import org.springframework.scheduling.annotation.EnableScheduling; 8 | 9 | @SpringBootApplication 10 | @EnableDiscoveryClient 11 | @EnableFeignClients 12 | @EnableScheduling 13 | public class BusBusApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(BusBusApplication.class, args); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/common/converter/BusConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: BusConverter 4 | * @author: mf 5 | * @create: 2020/11/08 13:32 6 | */ 7 | package com.dream.bus.common.converter; 8 | 9 | import com.dream.bus.bus.param.BusDto; 10 | import com.dream.bus.convert.DateMapper; 11 | import com.dream.bus.model.Bus; 12 | import org.mapstruct.Mapper; 13 | import org.mapstruct.Mappings; 14 | 15 | import java.util.List; 16 | 17 | @Mapper(componentModel = "spring", uses = DateMapper.class) 18 | public interface BusConverter { 19 | 20 | @Mappings({}) 21 | List bus2List(List buses); 22 | } 23 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/common/converter/CountConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountConverter 4 | * @author: mf 5 | * @create: 2020/03/02 13:00 6 | */ 7 | 8 | package com.dream.bus.common.converter; 9 | 10 | import com.dream.bus.bus.param.CountDto; 11 | import com.dream.bus.convert.DateMapper; 12 | import com.dream.bus.model.Count; 13 | import org.mapstruct.Mapper; 14 | import org.mapstruct.Mappings; 15 | 16 | import java.util.List; 17 | 18 | @Mapper(componentModel = "spring", uses = DateMapper.class) 19 | public interface CountConverter { 20 | 21 | @Mappings({}) 22 | List count2Res(List counts); 23 | } 24 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/dao/BusMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: BusMapper 4 | * @author: mf 5 | * @create: 2020/11/08 13:16 6 | */ 7 | package com.dream.bus.dao; 8 | 9 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 10 | import com.dream.bus.model.Bus; 11 | import org.apache.ibatis.annotations.Mapper; 12 | 13 | @Mapper 14 | public interface BusMapper extends BaseMapper { 15 | } 16 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/dao/CountMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: CountMapper 4 | * @author: mf 5 | * @create: 2020/11/08 13:17 6 | */ 7 | package com.dream.bus.dao; 8 | 9 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 10 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 11 | import com.baomidou.mybatisplus.core.metadata.IPage; 12 | import com.baomidou.mybatisplus.core.toolkit.Constants; 13 | import com.dream.bus.bus.param.CountDetailDto; 14 | import com.dream.bus.bus.param.CountSimpleDto; 15 | import com.dream.bus.model.Count; 16 | import org.apache.ibatis.annotations.Mapper; 17 | import org.apache.ibatis.annotations.Param; 18 | 19 | @Mapper 20 | public interface CountMapper extends BaseMapper { 21 | /** 22 | * 23 | * @param page 24 | * @param wrapper 25 | * @return 26 | */ 27 | IPage selectCounts(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); 28 | 29 | /** 30 | * 31 | * @param wrapper 32 | * @return 33 | */ 34 | CountDetailDto selectCountDetailById(@Param(Constants.WRAPPER) Wrapper wrapper); 35 | } 36 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/dao/mapping/BusMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/model/Bus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: Bus 4 | * @author: mf 5 | * @create: 2020/11/08 13:16 6 | */ 7 | 8 | package com.dream.bus.model; 9 | 10 | import com.baomidou.mybatisplus.annotation.TableId; 11 | import com.baomidou.mybatisplus.annotation.TableName; 12 | import com.fasterxml.jackson.annotation.JsonFormat; 13 | import lombok.Data; 14 | 15 | import java.io.Serializable; 16 | import java.time.LocalDateTime; 17 | 18 | @TableName("sb_bus") 19 | @Data 20 | public class Bus implements Serializable { 21 | 22 | private static final long serialVersionUID=1L; 23 | 24 | /** 25 | * 主键编号 26 | */ 27 | @TableId(value = "uuid") 28 | private Long uuid; 29 | 30 | /** 31 | * 限制人数 32 | */ 33 | private String limitNumber; 34 | 35 | /** 36 | * 司机姓名 37 | */ 38 | private String driverName; 39 | 40 | /** 41 | * 司机电话 42 | */ 43 | private String drivePhone; 44 | 45 | /** 46 | * 座位排列:json文件 47 | */ 48 | private String seatsNumber; 49 | 50 | /** 51 | * 创建时间 52 | */ 53 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 54 | private LocalDateTime beginTime; 55 | 56 | /** 57 | * 修改时间 58 | */ 59 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 60 | private LocalDateTime updateTime; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/java/com/dream/bus/schedule/BusSchedule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: BusServiceSchedule 4 | * @author: mf 5 | * @create: 2020/03/18 20:55 6 | */ 7 | 8 | package com.dream.bus.schedule; 9 | 10 | import com.dream.bus.service.IBusService; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.scheduling.annotation.Scheduled; 14 | import org.springframework.stereotype.Component; 15 | 16 | @Slf4j 17 | @Component 18 | public class BusSchedule { 19 | 20 | @Autowired 21 | private IBusService busService; 22 | 23 | /** 24 | * 每天上午7点到晚上21点,每隔30分钟执行一次 25 | */ 26 | @Scheduled(cron = "0 0/30 7-21 * * ?") 27 | private void schedulChangeBusStatus() { 28 | log.warn("schedulChangeBusStatus执行"); 29 | busService.schedulChangeBusStatus(); 30 | } 31 | 32 | /** 33 | * 每天凌晨0点1分执行 34 | */ 35 | @Scheduled(cron = "0 2 0 * * ? ") 36 | private void addCounts(){ 37 | log.warn("addCounts执行"); 38 | busService.addCounts(); 39 | } 40 | 41 | /** 42 | * 每5s执行一次 43 | */ 44 | // @Scheduled(cron = "5 * * * * ? ") 45 | private void scheduledTest(){ 46 | busService.scheduledTest(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8082 3 | 4 | spring: 5 | cloud: 6 | nacos: 7 | discovery: 8 | server-addr: 39.108.93.119:8848 9 | 10 | application: 11 | name: bus-bus 12 | datasource: 13 | driver-class-name: com.mysql.cj.jdbc.Driver 14 | url: jdbc:mysql://39.108.93.119:3306/school_bus?serverTimezone=UTC&useSSL=false&characterEncoding=UTF-8 15 | username: root 16 | password: 123456 17 | hikari: 18 | maximum-pool-size: 20 19 | max-lifetime: 1800000 20 | connection-timeout: 30000 21 | minimum-idle: 5 22 | 23 | redis: 24 | database: 0 25 | host: 39.108.93.119 26 | port: 6179 27 | password: 123 28 | timeout: 5000ms 29 | jedis: 30 | pool: 31 | max-active: 8 32 | max-wait: -1 33 | max-idle: 8 34 | 35 | 36 | mybatis-plus: 37 | mapper-locations: classpath*:com/dream/bus/dao/mapping/*.xml 38 | typeAliasesPackage: com.dream.bus.model 39 | 40 | logging: 41 | level.root: info 42 | level.com.stylefeng: debug 43 | file: 44 | path: logs/ 45 | name: bus-bus.log 46 | 47 | 48 | rocketmq: 49 | name-server: 39.108.93.119:9876 50 | producer: 51 | group: orderProducerGroup 52 | 53 | mq: 54 | order: 55 | consumer: 56 | group: 57 | name: orderTopic_cancel_group 58 | topic: orderTopic -------------------------------------------------------------------------------- /school-bus-cloud/bus-bus/src/test/java/com/dream/bus/BusBusApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BusBusApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/BusCommonApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | //@SpringBootApplication 7 | //public class BusCommonApplication { 8 | // 9 | // public static void main(String[] args) { 10 | // SpringApplication.run(BusCommonApplication.class, args); 11 | // } 12 | // 13 | //} 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/common/CastException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: CastException 4 | * @author: mf 5 | * @create: 2020/11/11 13:44 6 | */ 7 | 8 | package com.dream.bus.common; 9 | 10 | import com.dream.bus.constants.SbCode; 11 | import lombok.extern.slf4j.Slf4j; 12 | 13 | @Slf4j 14 | public class CastException{ 15 | 16 | public static void cast(SbCode sbCode) { 17 | log.error(sbCode.getMessage()); 18 | throw new CustomerException(sbCode); 19 | } 20 | } 21 | 22 | class CustomerException extends RuntimeException { 23 | 24 | private SbCode sbCode; 25 | 26 | public CustomerException(SbCode sbCode) { 27 | this.sbCode = sbCode; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/common/CurrentUser.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: CurrentUser 4 | * @author: mf 5 | * @create: 2020/11/03 15:20 6 | */ 7 | 8 | package com.dream.bus.common; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | public class CurrentUser { 13 | public static String getToken(HttpServletRequest request) { 14 | final String requestHeader = request.getHeader("Authorization"); 15 | String authToken = requestHeader.substring(7); 16 | return authToken; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/common/UUIDUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UUIDUtils 4 | * @author: mf 5 | * @create: 2020/11/08 13:45 6 | */ 7 | 8 | package com.dream.bus.common; 9 | 10 | import cn.hutool.core.lang.Snowflake; 11 | import cn.hutool.core.util.IdUtil; 12 | 13 | public class UUIDUtils { 14 | 15 | private static Snowflake snowflake = IdUtil.createSnowflake(1, 1); 16 | 17 | public static String getUUID() { 18 | return IdUtil.randomUUID(); 19 | } 20 | 21 | public static Long flakesUUID() { 22 | return snowflake.nextId(); 23 | } 24 | } -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/constants/MqTags.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus.constants; 2 | 3 | public enum MqTags { 4 | ORDER_CANCEL("order_cancel", "订单取消异常"), 5 | ORDER_SEATS_CANCEL("order_seats_cancel", "判断座位异常"), 6 | ORDER_ADD_SEATS_CANCLE("order_add_seats_cancle", "更新座位异常"), 7 | ORDER_CALC_MONEY_CANCLE("order_calc_money_cancle", "计算总金额异常"), 8 | ORDER_ADD_CANCLE("order_add_cancle", "添加订单异常"), 9 | PAY_CANCLE("pay_cancle", "支付异常"), 10 | PAY_CHECK_CANCLE("pay_check_cancle", "校验支付密码和余额"), 11 | PAY_MONEY_CANCLE("pay_money_cancle", "支付余额写入异常"), 12 | ; 13 | private String tag; 14 | private String message; 15 | 16 | 17 | MqTags(String tag, String message) { 18 | this.tag = tag; 19 | this.message = message; 20 | } 21 | 22 | public String getTag() { 23 | return tag; 24 | } 25 | 26 | public void setTag(String tag) { 27 | this.tag = tag; 28 | } 29 | 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public void setMessage(String message) { 35 | this.message = message; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/jwt/JwtProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: JwtProperties 4 | * @author: mf 5 | * @create: 2020/11/01 20:12 6 | */ 7 | 8 | package com.dream.bus.jwt; 9 | 10 | import lombok.Data; 11 | import org.springframework.boot.context.properties.ConfigurationProperties; 12 | import org.springframework.context.annotation.Configuration; 13 | 14 | 15 | @Configuration 16 | @ConfigurationProperties(prefix = JwtProperties.JWT_PREFIX) 17 | @Data 18 | public class JwtProperties { 19 | 20 | public static final String JWT_PREFIX = "jwt"; 21 | 22 | private String header = "Authorization"; 23 | 24 | private String secret = "defaultSecret"; 25 | 26 | private Long expiration = 604800L; 27 | 28 | private String authPath = "auth"; 29 | 30 | private String md5Key = "randomKey"; 31 | 32 | private String ignoreUrl = ""; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/param/AbstractRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: AbstractRequest 4 | * @author: mf 5 | * @create: 2020/10/31 15:24 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import java.io.Serializable; 11 | 12 | public abstract class AbstractRequest implements Serializable { 13 | private static final long serialVersionUID = 171717171717171L; 14 | } 15 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/param/AbstractResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: AbstractResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:24 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | public abstract class AbstractResponse implements Serializable { 16 | private static final long serivalVersionUID = 7642323132212L; 17 | // @ApiModelProperty(notes = "状态码") 18 | private String code; 19 | // @ApiModelProperty(notes = "状态消息") 20 | private String msg; 21 | } 22 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/param/CommonResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: CommonResponse 4 | * @author: mf 5 | * @create: 2020/10/31 15:51 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class CommonResponse extends AbstractResponse{ 14 | } 15 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/java/com/dream/bus/param/ResponseData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: ResponseData 4 | * @author: mf 5 | * @create: 2020/10/31 15:52 6 | */ 7 | 8 | package com.dream.bus.param; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class ResponseData { 14 | private boolean success; 15 | 16 | private String message; // 消息 17 | 18 | private int code; 19 | 20 | private T result; // 返回的数据 21 | 22 | private long timestamp = System.currentTimeMillis(); // 时间戳 23 | } 24 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-common/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | rest: 3 | auth-open: true #jwt鉴权机制是否开启(true或者false) 4 | sign-open: true #签名机制是否开启(true或false) 5 | 6 | jwt: 7 | header: Authorization #http请求头所需要的字段 8 | secret: mySecret #jwt秘钥 9 | expiration: 604800 #7天 单位:秒 10 | auth-path: auth #认证请求的路径 11 | md5-key: randomKey #md5加密混淆key 12 | ignore-url: /user/register,/user/check,/swagger,/v2,/webjars,/seats,/bus,/file -------------------------------------------------------------------------------- /school-bus-cloud/bus-gateway/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-gateway/src/main/java/com/dream/bus/BusGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BusGatewayApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BusGatewayApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-gateway/src/main/java/com/dream/bus/jwt/JwtProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: JwtProperties 4 | * @author: mf 5 | * @create: 2020/11/01 20:12 6 | */ 7 | 8 | package com.dream.bus.jwt; 9 | 10 | import lombok.Data; 11 | import org.springframework.boot.context.properties.ConfigurationProperties; 12 | import org.springframework.context.annotation.Configuration; 13 | 14 | 15 | @Configuration 16 | @ConfigurationProperties(prefix = JwtProperties.JWT_PREFIX) 17 | @Data 18 | public class JwtProperties { 19 | 20 | public static final String JWT_PREFIX = "jwt"; 21 | 22 | private String header = "Authorization"; 23 | 24 | private String secret = "defaultSecret"; 25 | 26 | private Long expiration = 604800L; 27 | 28 | private String authPath = "auth"; 29 | 30 | private String md5Key = "randomKey"; 31 | 32 | private String ignoreUrl = ""; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-gateway/src/main/resources/static/file/seat.json: -------------------------------------------------------------------------------- 1 | { 2 | "seats": { 3 | "left": { 4 | "row1": ["1", "2"], 5 | "row2": ["5", "6"], 6 | "row3": ["9", "10"], 7 | "row4": ["13", "14"], 8 | "row5": ["17", "18"] 9 | }, 10 | "right": { 11 | "row1": ["3", "4"], 12 | "row2": ["7", "8"], 13 | "row3": ["11", "12"], 14 | "row4": ["15", "16"], 15 | "row5": ["19", "20"] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /school-bus-cloud/bus-gateway/src/test/java/com/dream/bus/BusGatewayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BusGatewayApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-order/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-order/src/main/java/com/dream/bus/BusOrderApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | 8 | @SpringBootApplication 9 | @EnableDiscoveryClient 10 | @EnableFeignClients 11 | public class BusOrderApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(BusOrderApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-order/src/main/java/com/dream/bus/common/converter/OrderConvertver.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: OrderConvertver 4 | * @author: mf 5 | * @create: 2020/11/08 16:21 6 | */ 7 | 8 | package com.dream.bus.common.converter; 9 | 10 | import com.dream.bus.convert.DateMapper; 11 | import com.dream.bus.model.Order; 12 | import com.dream.bus.order.param.AddOrderRequest; 13 | import com.dream.bus.order.param.OrderDto; 14 | import com.dream.bus.order.param.OrderRequest; 15 | import org.mapstruct.Mapper; 16 | import org.mapstruct.Mappings; 17 | 18 | import java.util.List; 19 | 20 | @Mapper(componentModel = "spring", uses = DateMapper.class) 21 | public interface OrderConvertver { 22 | 23 | @Mappings({}) 24 | List order2Res(List orders); 25 | 26 | @Mappings({}) 27 | Order res2Order(AddOrderRequest request); 28 | 29 | @Mappings({}) 30 | OrderDto order2Res(Order order); 31 | 32 | @Mappings({}) 33 | Order res2Order(OrderRequest request); 34 | } -------------------------------------------------------------------------------- /school-bus-cloud/bus-order/src/main/java/com/dream/bus/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: 测试 4 | * @author: mf 5 | * @create: 2020/10/31 00:09 6 | */ 7 | 8 | package com.dream.bus.controller; 9 | 10 | 11 | 12 | import com.dream.bus.param.ResponseData; 13 | import com.dream.bus.user.UserClient; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.RestController; 17 | 18 | @RestController 19 | public class DemoController { 20 | 21 | @Autowired 22 | private UserClient userClient; 23 | 24 | @GetMapping("/order/demo") 25 | public String orderDemo(){ 26 | return "order demo"; 27 | } 28 | 29 | @GetMapping("/order/user") 30 | public String orderUser() { 31 | ResponseData objectResponseData = userClient.checkUsername("123"); 32 | 33 | return "123"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-order/src/test/java/com/dream/bus/BusOrderApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BusOrderApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-pay/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-pay/src/main/java/com/dream/bus/BusPayApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BusPayApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BusPayApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-pay/src/main/java/com/dream/bus/service/IPayService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: IPayService 4 | * @author: mf 5 | * @create: 2020/11/12 21:14 6 | */ 7 | package com.dream.bus.service; 8 | 9 | import com.dream.bus.pay.PayBackRequest; 10 | import com.dream.bus.pay.PayRequset; 11 | import com.dream.bus.pay.PayResponse; 12 | 13 | public interface IPayService { 14 | /** 15 | * 支付业务逻辑 16 | * @param requset 17 | * @return 18 | */ 19 | PayResponse pay(PayRequset requset); 20 | 21 | /** 22 | * 退款业务逻辑 23 | * @param request 24 | * @return 25 | */ 26 | PayResponse payBack(PayBackRequest request); 27 | } 28 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-pay/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8084 3 | 4 | spring: 5 | cloud: 6 | nacos: 7 | discovery: 8 | server-addr: 39.108.93.119:8848 9 | 10 | application: 11 | name: bus-pay 12 | datasource: 13 | driver-class-name: com.mysql.cj.jdbc.Driver 14 | url: jdbc:mysql://39.108.93.119:3306/school_bus?serverTimezone=UTC&useSSL=false&characterEncoding=UTF-8 15 | username: root 16 | password: 123456 17 | hikari: 18 | maximum-pool-size: 20 19 | max-lifetime: 1800000 20 | connection-timeout: 30000 21 | minimum-idle: 5 22 | 23 | redis: 24 | database: 0 25 | host: 39.108.93.119 26 | port: 6179 27 | password: 123 28 | timeout: 5000ms 29 | jedis: 30 | pool: 31 | max-active: 8 32 | max-wait: -1 33 | max-idle: 8 34 | 35 | 36 | mybatis-plus: 37 | mapper-locations: classpath*:com/dream/bus/**/mapping/*.xml 38 | 39 | 40 | logging: 41 | level.root: info 42 | level.com.stylefeng: debug 43 | file: 44 | path: logs/ 45 | name: bus-pay.log -------------------------------------------------------------------------------- /school-bus-cloud/bus-pay/src/test/java/com/dream/bus/BusPayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BusPayApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/main/java/com/dream/bus/BusUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | 8 | @SpringBootApplication 9 | @EnableDiscoveryClient 10 | @EnableFeignClients 11 | public class BusUserApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(BusUserApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/main/java/com/dream/bus/common/converter/UserConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserConverter 4 | * @author: mf 5 | * @create: 2020/10/31 15:34 6 | */ 7 | package com.dream.bus.common.converter; 8 | 9 | import com.dream.bus.convert.DateMapper; 10 | import com.dream.bus.model.User; 11 | import com.dream.bus.user.param.UserDto; 12 | import com.dream.bus.user.param.UserRegisterRequest; 13 | import com.dream.bus.user.param.UserUpdateInfoRequest; 14 | import org.mapstruct.Mapper; 15 | import org.mapstruct.Mapping; 16 | import org.mapstruct.Mappings; 17 | 18 | @Mapper(componentModel = "spring", uses = DateMapper.class) 19 | public interface UserConverter { 20 | 21 | @Mappings({ 22 | @Mapping(source = "request.userPhone", target = "userPhone"), 23 | @Mapping(source = "request.id", target = "uuid"), 24 | }) 25 | User res2User(UserUpdateInfoRequest request); 26 | 27 | @Mappings({ 28 | @Mapping(source = "user.money", target = "money") 29 | 30 | }) 31 | UserDto User2Res(User user); 32 | 33 | @Mappings({ 34 | @Mapping(source = "request.username", target = "userName"), 35 | @Mapping(source = "request.password", target = "userPwd"), 36 | @Mapping(source = "request.phone", target = "userPhone"), 37 | }) 38 | User res2User(UserRegisterRequest request); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/main/java/com/dream/bus/controller/DemoController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: 测试 4 | * @author: mf 5 | * @create: 2020/10/30 23:59 6 | */ 7 | 8 | package com.dream.bus.controller; 9 | 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | public class DemoController { 15 | 16 | @GetMapping("/user/demo") 17 | public String demo() { 18 | return "user demo"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/main/java/com/dream/bus/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: UserMapper 4 | * @author: mf 5 | * @create: 2020/10/31 15:13 6 | */ 7 | 8 | package com.dream.bus.dao; 9 | 10 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 11 | import com.dream.bus.model.User; 12 | import org.apache.ibatis.annotations.Mapper; 13 | 14 | @Mapper 15 | public interface UserMapper extends BaseMapper { 16 | } 17 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/main/java/com/dream/bus/dao/mapping/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/main/java/com/dream/bus/service/IUserService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus-cloud 3 | * @description: IUserService 4 | * @author: mf 5 | * @create: 2020/10/31 15:29 6 | */ 7 | package com.dream.bus.service; 8 | 9 | 10 | import com.dream.bus.user.param.*; 11 | 12 | public interface IUserService { 13 | 14 | /** 15 | * 检查用户名是否存在 16 | * @param request:username 17 | * @return 18 | */ 19 | UserCheckResponse checkUsername(UserCheckRequest request); 20 | 21 | /** 22 | * 注册 23 | * @param request 24 | * @return 25 | */ 26 | UserRegisterResponse regsiter(UserRegisterRequest request); 27 | 28 | /** 29 | * 用户登陆 30 | * @param request 31 | * @return 32 | */ 33 | UserLoginResponse login(UserLoginRequst request); 34 | 35 | /** 36 | * 通过id找用户 37 | * @param request 38 | * @return 39 | */ 40 | UserResponse getUserById(UserRequest request); 41 | 42 | /** 43 | * 更新用户信息 44 | * @param request 45 | * @return 46 | */ 47 | UserResponse updateUserInfo(UserUpdateInfoRequest request); 48 | } 49 | -------------------------------------------------------------------------------- /school-bus-cloud/bus-user/src/test/java/com/dream/bus/BusApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.dream.bus; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BusApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /school-bus-cloud/requests/http-client.env.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "dev": { 4 | "host": "http://127.0.0.1:8087", 5 | "token": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21LZXkiOiJ5YWl6bDIiLCJzdWIiOiI0IiwiZXhwIjoxNjA0OTk1NTQ0LCJpYXQiOjE2MDQzOTA3NDR9.gp7IMWwaWviy85QFpqV6Q04N4F_Y7esKLtNJtECQ7Gbb4SNU-J6K9PuZyl0mz6WY8xIjEVdW3p8Z5Elk77ncww" 6 | }, 7 | 8 | "line": { 9 | "host": "http://sb.dreamcat.ink:2020", 10 | "token": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21LZXkiOiJ5NWQyeDMiLCJzdWIiOiI0IiwiZXhwIjoxNTkxNDM3ODA0LCJpYXQiOjE1OTA4MzMwMDR9.CvIUwieM2M4gI9Tmipt2mWobO8ugBmCo20oFz17S3m5mNdvFc29i7ajmuoNqmommhQrTy3NPaYbd8n0hq8bAyg" 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /school-bus/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.stylefeng.guns 7 | guns-api 8 | 0.0.1 9 | jar 10 | 11 | guns-api 12 | guns API服务接口 13 | 14 | 15 | com.stylefeng 16 | guns-parent 17 | 1.0.0 18 | ../pom.xml 19 | 20 | 21 | 22 | 23 | 24 | com.stylefeng 25 | guns-core 26 | 27 | 28 | com.spring4all 29 | swagger-spring-boot-starter 30 | 31 | 32 | 33 | 34 | 35 | src/main/resources 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/alipay/IPayService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: IPayService 4 | * @author: mf 5 | * @create: 2020/03/17 16:53 6 | */ 7 | package com.stylefeng.guns.rest.alipay; 8 | 9 | import com.stylefeng.guns.rest.alipay.dto.PayBackRequest; 10 | import com.stylefeng.guns.rest.alipay.dto.PayRequset; 11 | import com.stylefeng.guns.rest.alipay.dto.PayResponse; 12 | 13 | public interface IPayService { 14 | 15 | /** 16 | * 支付业务逻辑 17 | * @param requset 18 | * @return 19 | */ 20 | PayResponse pay(PayRequset requset); 21 | 22 | /** 23 | * 退款业务逻辑 24 | * @param request 25 | * @return 26 | */ 27 | PayResponse payBack(PayBackRequest request); 28 | } 29 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/alipay/dto/PayBackRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayBackRequest 4 | * @author: mf 5 | * @create: 2020/03/20 16:14 6 | */ 7 | 8 | package com.stylefeng.guns.rest.alipay.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PayBackRequest extends AbstractRequest { 15 | private Long orderId; 16 | private Long coundId; 17 | private Long userId; 18 | private String seatsIds; 19 | private Double totalMoney; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/alipay/dto/PayRequset.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayRequset 4 | * @author: mf 5 | * @create: 2020/03/19 21:02 6 | */ 7 | 8 | package com.stylefeng.guns.rest.alipay.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PayRequset extends AbstractRequest { 15 | private Long userId; 16 | private String payPassword; 17 | private Double totalMoney; // 直接传钱, 感觉不安全 18 | } 19 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/alipay/dto/PayResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayResponse 4 | * @author: mf 5 | * @create: 2020/03/17 16:55 6 | */ 7 | 8 | package com.stylefeng.guns.rest.alipay.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PayResponse extends AbstractResponse { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/BusDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: BusVO 4 | * @author: mf 5 | * @create: 2020/03/01 16:42 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.io.Serializable; 15 | 16 | @Data 17 | @ApiModel(description = "班车表现实体") 18 | public class BusDto implements Serializable { 19 | @ApiModelProperty(notes = "班车id") 20 | private Long uuid; 21 | @ApiModelProperty(notes = "座位人数") 22 | private String limitNumber; 23 | @ApiModelProperty(notes = "司机姓名") 24 | private String driverName; 25 | @ApiModelProperty(notes = "司机号码") 26 | private String driverPhone; 27 | @ApiModelProperty(notes = "座位路径") 28 | private String seatsNumber; 29 | @ApiModelProperty(notes = "创建时间") 30 | private String beginTime; 31 | @ApiModelProperty(notes = "更新时间") 32 | private String updateTime; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/CountDetailDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDetailDto 4 | * @author: mf 5 | * @create: 2020/03/12 20:50 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.io.Serializable; 15 | 16 | @ApiModel(description = "场次详情Dto") 17 | @Data 18 | public class CountDetailDto implements Serializable { 19 | 20 | @ApiModelProperty(notes = "场次id") 21 | private Long uuid; 22 | @ApiModelProperty(notes = "班车id") 23 | private Long busId; 24 | @ApiModelProperty(notes = "司机姓名") 25 | private String driverName; 26 | @ApiModelProperty(notes = "0:沙河;1:清水河") 27 | private String busStatus; 28 | @ApiModelProperty(notes = "班车出发时间") 29 | private String beginTime; 30 | @ApiModelProperty(notes = "出发日期") 31 | private String beginDate; 32 | @ApiModelProperty(notes = "已选座位") 33 | private String selectedSeats; 34 | @ApiModelProperty(notes = "座位路径") 35 | private String seatsNumber; 36 | @ApiModelProperty(notes = "场次价格") 37 | private Double price; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/CountDetailRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDetailRequest 4 | * @author: mf 5 | * @create: 2020/03/12 21:07 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | 14 | @Data 15 | public class CountDetailRequest extends AbstractRequest { 16 | // 场次id 17 | private Long countId; 18 | } 19 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/CountDetailResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDetailResponse 4 | * @author: mf 5 | * @create: 2020/03/12 21:06 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class CountDetailResponse extends AbstractResponse { 15 | private CountDetailDto countDetailDto; 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/CountDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountDto 4 | * @author: mf 5 | * @create: 2020/03/02 12:48 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import io.swagger.annotations.ApiModelProperty; 11 | import lombok.Data; 12 | 13 | import java.io.Serializable; 14 | 15 | @Data 16 | public class CountDto implements Serializable { 17 | @ApiModelProperty(notes = "场次id") 18 | private Long uuid; 19 | @ApiModelProperty(notes = "班车id") 20 | private Long busId; 21 | @ApiModelProperty(notes = "班车出发时间") 22 | private String beginTime; 23 | @ApiModelProperty(notes = "班车结束时间") 24 | private String endTime; 25 | @ApiModelProperty(notes = "0:沙河;1:清水河;2:沙河到清水河;3:清水河到沙河") 26 | private String bus_status; 27 | @ApiModelProperty(notes = "场次价格") 28 | private Double price; 29 | @ApiModelProperty(notes = "已选座位") 30 | private String selectedSeats; 31 | @ApiModelProperty(notes = "0:未满;1:已满") 32 | private String seatStatus; 33 | @ApiModelProperty(notes = "出发日期") 34 | private String beginDate; 35 | @ApiModelProperty(notes = "更新时间") 36 | private String updateTime; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/CountSimpleDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountSimpleDto 4 | * @author: mf 5 | * @create: 2020/03/10 01:13 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.io.Serializable; 15 | 16 | @Data 17 | @ApiModel(description = "车次列表的Dto") 18 | public class CountSimpleDto implements Serializable { 19 | @ApiModelProperty(notes = "场次id") 20 | private Long uuid; 21 | @ApiModelProperty(notes = "班车id") 22 | private Long busId; 23 | @ApiModelProperty(notes = "班车出发时间") 24 | private String beginTime; 25 | @ApiModelProperty(notes = "0:沙河;1:清水河;2:沙河到清水河;3:清水河到沙河") 26 | private String busStatus; 27 | @ApiModelProperty(notes = "出发日期") 28 | private String beginDate; 29 | @ApiModelProperty(notes = "0:未满;1:已满") 30 | private String seatStatus; 31 | } 32 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/PageBusRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageBusCountRequest 4 | * @author: mf 5 | * @create: 2020/03/01 16:51 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PageBusRequest extends AbstractRequest { 15 | 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/PageBusResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageBusCountResponse 4 | * @author: mf 5 | * @create: 2020/03/01 16:54 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModel; 12 | import io.swagger.annotations.ApiModelProperty; 13 | import lombok.Data; 14 | 15 | import java.util.List; 16 | 17 | @Data 18 | @ApiModel(description = "班车Dto") 19 | public class PageBusResponse extends AbstractResponse { 20 | 21 | // 当前页 22 | @ApiModelProperty(notes = "当前页") 23 | private Long currentPage; 24 | // 每页数量 25 | @ApiModelProperty(notes = "每页数量") 26 | private Long pageSize; 27 | // 总量 28 | @ApiModelProperty(notes = "总量") 29 | private Long total; 30 | // 总页 31 | @ApiModelProperty(notes = "总页") 32 | private Long pages; 33 | // BusDto 34 | @ApiModelProperty(notes = "班车列表") 35 | private List busDtos; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/PageCountRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageCountRequest 4 | * @author: mf 5 | * @create: 2020/03/02 12:48 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class PageCountRequest extends AbstractRequest { 15 | 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | // 地区状态 21 | private String busStatus; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/bus/dto/PageCountResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageCountResponse 4 | * @author: mf 5 | * @create: 2020/03/02 12:51 6 | */ 7 | 8 | package com.stylefeng.guns.rest.bus.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModel; 12 | import io.swagger.annotations.ApiModelProperty; 13 | import lombok.Data; 14 | 15 | import java.util.List; 16 | 17 | @Data 18 | @ApiModel(description = "车次列表Dto") 19 | public class PageCountResponse extends AbstractResponse { 20 | // 当前页 21 | @ApiModelProperty(notes = "当前页") 22 | private Long currentPage; 23 | // 每页数量 24 | @ApiModelProperty(notes = "每页数量") 25 | private Long pageSize; 26 | // 总量 27 | @ApiModelProperty(notes = "总量") 28 | private Long total; 29 | // 总页 30 | @ApiModelProperty(notes = "总页") 31 | private Long pages; 32 | // count 33 | @ApiModelProperty(notes = "场次列表") 34 | List countSimpleDtos; 35 | // List countDtos; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/common/AbstractRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AbstractRequest 4 | * @author: mf 5 | * @create: 2020/02/24 16:16 6 | */ 7 | 8 | package com.stylefeng.guns.rest.common; 9 | 10 | import java.io.Serializable; 11 | 12 | public abstract class AbstractRequest implements Serializable { 13 | 14 | private static final long serialVersionUID = 171717171717171L; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/common/AbstractResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AbstractResponse 4 | * @author: mf 5 | * @create: 2020/02/24 16:18 6 | */ 7 | 8 | package com.stylefeng.guns.rest.common; 9 | 10 | import io.swagger.annotations.ApiModelProperty; 11 | import lombok.Data; 12 | 13 | import java.io.Serializable; 14 | 15 | @Data 16 | public abstract class AbstractResponse implements Serializable { 17 | 18 | private static final long serivalVersionUID = 7642323132212L; 19 | @ApiModelProperty(notes = "状态码") 20 | private String code; 21 | @ApiModelProperty(notes = "状态消息") 22 | private String msg; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/common/ResponseData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: ResponseData 4 | * @author: mf 5 | * @create: 2020/02/24 16:18 6 | */ 7 | 8 | package com.stylefeng.guns.rest.common; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class ResponseData { 14 | 15 | private boolean success; 16 | 17 | private String message; // 消息 18 | 19 | private int code; 20 | 21 | private T result; // 返回的数据 22 | 23 | private long timestamp = System.currentTimeMillis(); // 时间戳 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/exception/CommonResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CommonResponse 4 | * @author: mf 5 | * @create: 2020/03/08 11:32 6 | */ 7 | 8 | package com.stylefeng.guns.rest.exception; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import lombok.Data; 12 | 13 | 14 | public class CommonResponse extends AbstractResponse { 15 | } 16 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/mq/MQDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderMQDto 4 | * @author: mf 5 | * @create: 2020/03/19 11:06 6 | */ 7 | 8 | package com.stylefeng.guns.rest.mq; 9 | 10 | import lombok.Data; 11 | 12 | import java.io.Serializable; 13 | 14 | @Data 15 | public class MQDto implements Serializable { 16 | private Long orderId; // 订单id 17 | private Long countId; // 场次id 18 | private Long userId; // 用户id 19 | private Double userMoney; // 用户钱 20 | private String seatsIds; // 座位id 21 | } 22 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/myutils/UUIDUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UUIDUtils 4 | * @author: mf 5 | * @create: 2020/03/15 02:06 6 | */ 7 | 8 | package com.stylefeng.guns.rest.myutils; 9 | 10 | import cn.hutool.core.lang.Snowflake; 11 | import cn.hutool.core.util.IdUtil; 12 | 13 | 14 | public class UUIDUtils { 15 | 16 | private static Snowflake snowflake = IdUtil.createSnowflake(1, 1); 17 | 18 | public static String getUUID() { 19 | return IdUtil.randomUUID(); 20 | } 21 | 22 | public static Long flakesUUID() { 23 | return snowflake.nextId(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/AddOrderRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AddOrderRequest 4 | * @author: mf 5 | * @create: 2020/03/14 18:47 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class AddOrderRequest extends AbstractRequest { 15 | // 场次id 16 | private Long countId; 17 | // 用户id 18 | private Long userId; 19 | private String orderUser; 20 | private String busStatus; 21 | private String seatsIds; 22 | private Double countPrice; 23 | private Integer expireTime; 24 | } 25 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/AddOrderResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AddOrderResponse 4 | * @author: mf 5 | * @create: 2020/03/14 19:00 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class AddOrderResponse extends AbstractResponse { 15 | 16 | private OrderDto orderDto; 17 | 18 | private Long orderId; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/EvaluateDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: EvaluateDto 4 | * @author: mf 5 | * @create: 2020/03/10 00:51 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.io.Serializable; 15 | 16 | @Data 17 | @ApiModel("评价订单Dto") 18 | public class EvaluateDto implements Serializable { 19 | @ApiModelProperty(notes = "订单id") 20 | private Long uuid; 21 | @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 22 | private String busStatus; 23 | @ApiModelProperty(notes = "已选座位") 24 | private String seatsIds; 25 | @ApiModelProperty(notes = "下单时间") 26 | private String orderTime; 27 | @ApiModelProperty(notes = "下单用户") 28 | private String orderUser; 29 | @ApiModelProperty(notes = "班车出发时间") 30 | private String beginTime; 31 | @ApiModelProperty(notes = "班车id") 32 | private Long busId; 33 | @ApiModelProperty(notes = "0:未评价;1:已评价") 34 | private String evaluateStatus; 35 | @ApiModelProperty(notes = "评论内容") 36 | private String comment; 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/EvaluateRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: EvaluateRequest 4 | * @author: mf 5 | * @create: 2020/03/06 02:39 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class EvaluateRequest extends AbstractRequest { 15 | private Long userId; 16 | // 评价状态 17 | private String evaluateStatus; 18 | // 当前页 19 | private Long currentPage; 20 | // 每页数量 21 | private Long pageSize; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/EvaluateResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: EvaluateResponse 4 | * @author: mf 5 | * @create: 2020/03/06 02:40 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModel; 12 | import io.swagger.annotations.ApiModelProperty; 13 | import lombok.Data; 14 | 15 | import java.util.List; 16 | 17 | @Data 18 | @ApiModel("订单评价列表Dto") 19 | public class EvaluateResponse extends AbstractResponse { 20 | // 当前页 21 | @ApiModelProperty(notes = "当前页") 22 | private Long currentPage; 23 | // 每页数量 24 | @ApiModelProperty(notes = "每页数量") 25 | private Long pageSize; 26 | // 总量 27 | @ApiModelProperty(notes = "总量") 28 | private Long total; 29 | // 总页 30 | @ApiModelProperty(notes = "总页") 31 | private Long pages; 32 | @ApiModelProperty(notes = "订单列表") 33 | // List orderDtos; 34 | List evaluateDtos; 35 | } 36 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/NoPayDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoPayDto 4 | * @author: mf 5 | * @create: 2020/03/15 16:21 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import io.swagger.annotations.ApiModelProperty; 11 | import lombok.Data; 12 | 13 | import java.io.Serializable; 14 | 15 | @Data 16 | public class NoPayDto implements Serializable { 17 | @ApiModelProperty(notes = "订单id") 18 | private Long uuid; 19 | @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 20 | private String busStatus; 21 | @ApiModelProperty(notes = "已选座位") 22 | private String seatsIds; 23 | @ApiModelProperty(notes = "下单时间") 24 | private String orderTime; 25 | @ApiModelProperty(notes = "下单用户") 26 | private String orderUser; 27 | @ApiModelProperty(notes = "订单状态,0-待支付,1-已支付,2-已关闭") 28 | private String orderStatus; 29 | @ApiModelProperty(notes = "班车出发时间") 30 | private String beginTime; 31 | @ApiModelProperty(notes = "班车id") 32 | private Long busId; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/NoPayRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoPayRequest 4 | * @author: mf 5 | * @create: 2020/03/15 16:17 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class NoPayRequest extends AbstractRequest { 15 | private Long userId; 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/NoPayResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoPayResponse 4 | * @author: mf 5 | * @create: 2020/03/15 16:18 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.util.List; 15 | 16 | @Data 17 | public class NoPayResponse extends AbstractResponse { 18 | // 当前页 19 | @ApiModelProperty(notes = "当前页") 20 | private Long currentPage; 21 | // 每页数量 22 | @ApiModelProperty(notes = "每页数量") 23 | private Long pageSize; 24 | // 总量 25 | @ApiModelProperty(notes = "总量") 26 | private Long total; 27 | // 总页 28 | @ApiModelProperty(notes = "总页") 29 | private Long pages; 30 | @ApiModelProperty(notes = "未支付订单列表") 31 | private List noPayDtos; 32 | } 33 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/NoTakeBusRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoTakeBusRequest 4 | * @author: mf 5 | * @create: 2020/03/04 22:16 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class NoTakeBusRequest extends AbstractRequest { 15 | private Long userId; 16 | // 当前页 17 | private Long currentPage; 18 | // 每页数量 19 | private Long pageSize; 20 | } 21 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/NoTakeBusResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoTakeBusResponse 4 | * @author: mf 5 | * @create: 2020/03/04 22:18 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModel; 12 | import io.swagger.annotations.ApiModelProperty; 13 | import lombok.Data; 14 | 15 | import java.util.List; 16 | 17 | @Data 18 | @ApiModel("未乘坐订单Dto") 19 | public class NoTakeBusResponse extends AbstractResponse { 20 | // 当前页 21 | @ApiModelProperty(notes = "当前页") 22 | private Long currentPage; 23 | // 每页数量 24 | @ApiModelProperty(notes = "每页数量") 25 | private Long pageSize; 26 | // 总量 27 | @ApiModelProperty(notes = "总量") 28 | private Long total; 29 | // 总页 30 | @ApiModelProperty(notes = "总页") 31 | private Long pages; 32 | @ApiModelProperty(notes = "未乘坐订单列表") 33 | List noTakeDtos; 34 | // List orderDtos; 35 | } 36 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/NoTakeDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: NoTakeDto 4 | * @author: mf 5 | * @create: 2020/03/09 22:25 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.io.Serializable; 15 | 16 | @Data 17 | @ApiModel(description = "未乘坐订单简单Dto") 18 | public class NoTakeDto implements Serializable { 19 | @ApiModelProperty(notes = "订单id") 20 | private Long uuid; 21 | @ApiModelProperty(notes = "0:沙河->清水河,1:清水河->沙河") 22 | private String busStatus; 23 | @ApiModelProperty(notes = "已选座位") 24 | private String seatsIds; 25 | @ApiModelProperty(notes = "下单时间") 26 | private String orderTime; 27 | @ApiModelProperty(notes = "下单用户") 28 | private String orderUser; 29 | @ApiModelProperty(notes = "订单状态,0-待支付,1-已支付,2-已关闭") 30 | private String orderStatus; 31 | @ApiModelProperty(notes = "班车出发时间") 32 | private String beginTime; 33 | @ApiModelProperty(notes = "班车id") 34 | private Long busId; 35 | } 36 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/OrderRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderRequest 4 | * @author: mf 5 | * @create: 2020/03/15 03:10 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class OrderRequest extends AbstractRequest { 15 | 16 | private Long uuid; 17 | 18 | private String orderStatus; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/order/dto/OrderResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderResponse 4 | * @author: mf 5 | * @create: 2020/03/15 03:11 6 | */ 7 | 8 | package com.stylefeng.guns.rest.order.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class OrderResponse extends AbstractResponse { 15 | 16 | private OrderDto orderDto; 17 | } 18 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/IUserService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserAPI 4 | * @author: mf 5 | * @create: 2020/02/24 16:25 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user; 9 | 10 | import com.stylefeng.guns.rest.user.dto.*; 11 | 12 | public interface IUserService { 13 | 14 | /** 15 | * 检查用户名是否存在 16 | * @param request:username 17 | * @return 18 | */ 19 | UserCheckResponse checkUsername(UserCheckRequest request); 20 | 21 | /** 22 | * 注册 23 | * @param request 24 | * @return 25 | */ 26 | UserRegisterResponse regsiter(UserRegisterRequest request); 27 | 28 | /** 29 | * 用户登陆 30 | * @param request 31 | * @return 32 | */ 33 | UserLoginResponse login(UserLoginRequst request); 34 | 35 | /** 36 | * 通过id找用户 37 | * @param request 38 | * @return 39 | */ 40 | UserResponse getUserById(UserRequest request); 41 | 42 | /** 43 | * 更新用户信息 44 | * @param request 45 | * @return 46 | */ 47 | UserResponse updateUserInfo(UserUpdateInfoRequest request); 48 | } 49 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserCheckRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserCheckRequest 4 | * @author: mf 5 | * @create: 2020/02/26 00:30 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserCheckRequest extends AbstractRequest { 15 | 16 | private String username; 17 | } 18 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserCheckResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserCheckResponse 4 | * @author: mf 5 | * @create: 2020/02/26 00:31 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @Data 15 | public class UserCheckResponse extends AbstractResponse { 16 | 17 | @ApiModelProperty(notes = "0:用户已经存在,1:用户不存在") 18 | private int checkUsername; // 0 代表有, 1 代表没有 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserVo 4 | * @author: mf 5 | * @create: 2020/02/24 16:27 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import java.io.Serializable; 15 | 16 | @Data 17 | @ApiModel(description = "用户表现实体") 18 | public class UserDto implements Serializable { 19 | 20 | @ApiModelProperty(notes = "用户id,这没啥好说的,暂时按自增") 21 | private Long uuid; // 根据用户id 22 | @ApiModelProperty(notes = "用户名") 23 | private String userName; // 24 | 25 | // private String userPwd; // 密码不能报漏出去 26 | @ApiModelProperty(notes = "用户昵称") 27 | private String nickName; 28 | @ApiModelProperty(notes = "0:男,1:女") 29 | private Integer UserSex; 30 | @ApiModelProperty(notes = "用户邮件") 31 | private String email; 32 | @ApiModelProperty(notes = "用户手机号码") 33 | private String userPhone; 34 | @ApiModelProperty(notes = "用户余额") 35 | private Double money; 36 | @ApiModelProperty(notes = "用户支付密码") // 后期加密 37 | private String payPassword; 38 | @ApiModelProperty("创建时间") 39 | private String beginTime; 40 | @ApiModelProperty("更新时间") 41 | private String updateTime; 42 | } 43 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserLoginRequst.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserLoginRequst 4 | * @author: mf 5 | * @create: 2020/02/26 01:03 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserLoginRequst extends AbstractRequest { 15 | 16 | private String username; 17 | 18 | private String password; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserLoginResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserLoginResponse 4 | * @author: mf 5 | * @create: 2020/02/26 01:03 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserLoginResponse extends AbstractResponse { 15 | 16 | private String randomKey; 17 | 18 | private String token; 19 | 20 | private Long userId; 21 | } 22 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserRegisterRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserRegisterRequest 4 | * @author: mf 5 | * @create: 2020/02/24 16:52 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserRegisterRequest extends AbstractRequest { 15 | 16 | private String username; 17 | 18 | private String password; 19 | 20 | private String email; 21 | 22 | private String phone; 23 | } 24 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserRegisterResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserRegisterResponse 4 | * @author: mf 5 | * @create: 2020/02/26 15:52 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @Data 15 | public class UserRegisterResponse extends AbstractResponse { 16 | 17 | @ApiModelProperty(notes = "true:注册成功,false:注册失败") 18 | private boolean register; 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserRequest 4 | * @author: mf 5 | * @create: 2020/02/24 16:26 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | 14 | @Data 15 | public class UserRequest extends AbstractRequest { 16 | 17 | private Long id; // 通过id找 18 | 19 | private String userName; 20 | 21 | private String passPwd; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserResponse 4 | * @author: mf 5 | * @create: 2020/02/24 16:34 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractResponse; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | 15 | @Data 16 | public class UserResponse extends AbstractResponse { 17 | 18 | @ApiModelProperty(notes = "userDto:用户表现体") 19 | private UserDto userDto; // 封装可返回展示的页面数据 20 | } 21 | -------------------------------------------------------------------------------- /school-bus/guns-api/src/main/java/com/stylefeng/guns/rest/user/dto/UserUpdateInfoRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserUpdateInfoRequest 4 | * @author: mf 5 | * @create: 2020/02/26 21:39 6 | */ 7 | 8 | package com.stylefeng.guns.rest.user.dto; 9 | 10 | import com.stylefeng.guns.rest.common.AbstractRequest; 11 | import lombok.Data; 12 | 13 | @Data 14 | public class UserUpdateInfoRequest extends AbstractRequest { 15 | 16 | private Long id; // 通过id找 17 | 18 | // private String userName; 19 | private String nickName; 20 | 21 | private Integer userSex; 22 | 23 | private String email; 24 | 25 | private String userPhone; 26 | 27 | private Double money; 28 | 29 | private String payPassword; 30 | } 31 | -------------------------------------------------------------------------------- /school-bus/guns-bus/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-bus/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-bus/sb-bus.log.2020-04-06.0.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-bus/sb-bus.log.2020-04-06.0.gz -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-bus/src/main/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-bus/src/main/java/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/GunsBusApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | @SpringBootApplication 9 | @EnableDubbo 10 | @EnableScheduling 11 | public class GunsBusApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(GunsBusApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/GunsBusServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsBusServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsBusApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/common/SimpleObject.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common; 2 | 3 | /** 4 | * 测试用的 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 16:47 8 | */ 9 | public class SimpleObject { 10 | 11 | private String user; 12 | 13 | private String name; 14 | 15 | private String tips; 16 | 17 | private Integer age; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getTips() { 28 | return tips; 29 | } 30 | 31 | public void setTips(String tips) { 32 | this.tips = tips; 33 | } 34 | 35 | public Integer getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(Integer age) { 40 | this.age = age; 41 | } 42 | 43 | public String getUser() { 44 | return user; 45 | } 46 | 47 | public void setUser(String user) { 48 | this.user = user; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.exception; 2 | 3 | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; 4 | 5 | /** 6 | * 所有业务异常的枚举 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月12日 下午5:04:51 10 | */ 11 | public enum BizExceptionEnum implements ServiceExceptionEnum { 12 | 13 | /** 14 | * token异常 15 | */ 16 | TOKEN_EXPIRED(700, "token过期"), 17 | TOKEN_ERROR(700, "token验证失败"), 18 | 19 | /** 20 | * 签名异常 21 | */ 22 | SIGN_ERROR(700, "签名验证失败"), 23 | 24 | /** 25 | * 其他 26 | */ 27 | AUTH_REQUEST_ERROR(400, "账号密码错误"); 28 | 29 | BizExceptionEnum(int code, String message) { 30 | this.code = code; 31 | this.message = message; 32 | } 33 | 34 | private Integer code; 35 | 36 | private String message; 37 | 38 | @Override 39 | public Integer getCode() { 40 | return code; 41 | } 42 | 43 | public void setCode(Integer code) { 44 | this.code = code; 45 | } 46 | 47 | @Override 48 | public String getMessage() { 49 | return message; 50 | } 51 | 52 | public void setMessage(String message) { 53 | this.message = message; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/BusMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.Bus; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 班车表 Mapper 接口 9 | *

10 | * 11 | * @author Maifeng 12 | * @since 2020-03-01 13 | */ 14 | public interface BusMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/CountMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; 4 | import com.baomidou.mybatisplus.core.metadata.IPage; 5 | import com.baomidou.mybatisplus.core.toolkit.Constants; 6 | import com.stylefeng.guns.rest.bus.dto.CountDetailDto; 7 | import com.stylefeng.guns.rest.bus.dto.CountSimpleDto; 8 | import com.stylefeng.guns.rest.common.persistence.model.Count; 9 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | /** 13 | *

14 | * 场次表 Mapper 接口 15 | *

16 | * 17 | * @author Maifeng 18 | * @since 2020-03-01 19 | */ 20 | public interface CountMapper extends BaseMapper { 21 | /** 22 | * 23 | * @param page 24 | * @param wrapper 25 | * @return 26 | */ 27 | IPage selectCounts(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); 28 | 29 | /** 30 | * 31 | * @param wrapper 32 | * @return 33 | */ 34 | CountDetailDto selectCountDetailById(@Param(Constants.WRAPPER) Wrapper wrapper); 35 | } 36 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/BusMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | @Configuration 15 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/modular/bus/converter/BusConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: BusConverter 4 | * @author: mf 5 | * @create: 2020/03/01 16:27 6 | */ 7 | package com.stylefeng.guns.rest.modular.bus.converter; 8 | 9 | import com.stylefeng.guns.rest.bus.dto.BusDto; 10 | import com.stylefeng.guns.rest.common.convert.DateMapper; 11 | import com.stylefeng.guns.rest.common.persistence.model.Bus; 12 | import org.mapstruct.Mapper; 13 | import org.mapstruct.Mappings; 14 | 15 | import java.util.List; 16 | 17 | @Mapper(componentModel = "spring", uses = DateMapper.class) 18 | public interface BusConverter { 19 | 20 | @Mappings({}) 21 | List bus2List(List buses); 22 | } 23 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/modular/bus/converter/CountConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CountConverter 4 | * @author: mf 5 | * @create: 2020/03/02 13:00 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.bus.converter; 9 | 10 | import com.stylefeng.guns.rest.bus.dto.CountDto; 11 | import com.stylefeng.guns.rest.common.convert.DateMapper; 12 | import com.stylefeng.guns.rest.common.persistence.model.Count; 13 | import org.mapstruct.Mapper; 14 | import org.mapstruct.Mappings; 15 | 16 | import java.util.List; 17 | 18 | @Mapper(componentModel = "spring", uses = DateMapper.class) 19 | public interface CountConverter { 20 | 21 | @Mappings({}) 22 | List count2Res(List counts); 23 | } 24 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/main/java/com/stylefeng/guns/rest/modular/bus/schedule/BusSchedule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: BusServiceSchedule 4 | * @author: mf 5 | * @create: 2020/03/18 20:55 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.bus.schedule; 9 | 10 | import com.stylefeng.guns.rest.bus.IBusService; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.scheduling.annotation.Scheduled; 14 | import org.springframework.stereotype.Component; 15 | 16 | @Slf4j 17 | @Component 18 | public class BusSchedule { 19 | 20 | @Autowired 21 | private IBusService busService; 22 | 23 | /** 24 | * 每天上午7点到晚上21点,每隔30分钟执行一次 25 | */ 26 | @Scheduled(cron = "0 0/30 7-21 * * ?") 27 | private void schedulChangeBusStatus() { 28 | log.warn("schedulChangeBusStatus执行"); 29 | busService.schedulChangeBusStatus(); 30 | } 31 | 32 | /** 33 | * 每天凌晨0点1分执行 34 | */ 35 | @Scheduled(cron = "0 2 0 * * ? ") 36 | private void addCounts(){ 37 | log.warn("addCounts执行"); 38 | busService.addCounts(); 39 | } 40 | 41 | /** 42 | * 每5s执行一次 43 | */ 44 | // @Scheduled(cron = "5 * * * * ? ") 45 | private void scheduledTest(){ 46 | busService.scheduledTest(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /school-bus/guns-bus/src/test/java/com/stylefeng/guns/GunsBusApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsBusApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/constants/MqTags.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.constants; 2 | 3 | public enum MqTags { 4 | ORDER_CANCEL("order_cancel", "订单取消异常"), 5 | ORDER_SEATS_CANCEL("order_seats_cancel", "判断座位异常"), 6 | ORDER_ADD_SEATS_CANCLE("order_add_seats_cancle", "更新座位异常"), 7 | ORDER_CALC_MONEY_CANCLE("order_calc_money_cancle", "计算总金额异常"), 8 | ORDER_ADD_CANCLE("order_add_cancle", "添加订单异常"), 9 | PAY_CANCLE("pay_cancle", "支付异常"), 10 | PAY_CHECK_CANCLE("pay_check_cancle", "校验支付密码和余额"), 11 | PAY_MONEY_CANCLE("pay_money_cancle", "支付余额写入异常"), 12 | ; 13 | private String tag; 14 | private String message; 15 | 16 | 17 | MqTags(String tag, String message) { 18 | this.tag = tag; 19 | this.message = message; 20 | } 21 | 22 | public String getTag() { 23 | return tag; 24 | } 25 | 26 | public void setTag(String tag) { 27 | this.tag = tag; 28 | } 29 | 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public void setMessage(String message) { 35 | this.message = message; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/exception/CastException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CastException 4 | * @author: mf 5 | * @create: 2020/03/19 00:46 6 | */ 7 | 8 | package com.stylefeng.guns.core.exception; 9 | 10 | import com.stylefeng.guns.core.constants.SbCode; 11 | import lombok.extern.slf4j.Slf4j; 12 | 13 | @Slf4j 14 | public class CastException { 15 | public static void cast(SbCode sbCode) { 16 | log.error(sbCode.getMessage()); 17 | throw new CustomerException(sbCode); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/exception/CustomerException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CustomerException 4 | * @author: mf 5 | * @create: 2020/03/19 00:44 6 | */ 7 | 8 | package com.stylefeng.guns.core.exception; 9 | 10 | import com.stylefeng.guns.core.constants.SbCode; 11 | 12 | public class CustomerException extends RuntimeException { 13 | 14 | private SbCode sbCode; 15 | 16 | public CustomerException(SbCode sbCode) { 17 | this.sbCode = sbCode; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: GunsException 4 | * @author: mf 5 | * @create: 2020/03/18 23:32 6 | */ 7 | 8 | package com.stylefeng.guns.core.exception; 9 | 10 | public class GunsException extends RuntimeException{ 11 | private Integer code; 12 | 13 | private String message; 14 | 15 | public GunsException(ServiceExceptionEnum serviceExceptionEnum) { 16 | this.code = serviceExceptionEnum.getCode(); 17 | this.message = serviceExceptionEnum.getMessage(); 18 | } 19 | 20 | public Integer getCode() { 21 | return code; 22 | } 23 | 24 | public void setCode(Integer code) { 25 | this.code = code; 26 | } 27 | 28 | @Override 29 | public String getMessage() { 30 | return message; 31 | } 32 | 33 | public void setMessage(String message) { 34 | this.message = message; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.exception; 2 | 3 | public enum GunsExceptionEnum implements ServiceExceptionEnum { 4 | /** 5 | * 其他 6 | */ 7 | INVLIDE_DATE_STRING(400, "输入日期格式不对"), 8 | 9 | /** 10 | * 其他 11 | */ 12 | WRITE_ERROR(500, "渲染界面错误"), 13 | 14 | /** 15 | * 文件上传 16 | */ 17 | FILE_READING_ERROR(400, "FILE_READING_ERROR!"), 18 | FILE_NOT_FOUND(400, "FILE_NOT_FOUND!"), 19 | 20 | /** 21 | * 错误的请求 22 | */ 23 | REQUEST_NULL(400, "请求有错误"), 24 | SERVER_ERROR(500, "服务器异常"); 25 | 26 | GunsExceptionEnum(int code, String message) { 27 | this.code = code; 28 | this.message = message; 29 | } 30 | 31 | private Integer code; 32 | 33 | private String message; 34 | 35 | @Override 36 | public Integer getCode() { 37 | return code; 38 | } 39 | 40 | public void setCode(Integer code) { 41 | this.code = code; 42 | } 43 | 44 | @Override 45 | public String getMessage() { 46 | return message; 47 | } 48 | 49 | public void setMessage(String message) { 50 | this.message = message; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/exception/ServiceExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.exception; 2 | 3 | public interface ServiceExceptionEnum { 4 | /** 5 | * 获取异常编码 6 | */ 7 | Integer getCode(); 8 | 9 | /** 10 | * 获取异常信息 11 | */ 12 | String getMessage(); 13 | } 14 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/support/DateTime.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.support; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * 封装java.util.Date 7 | * @author xiaoleilu 8 | * 9 | */ 10 | public class DateTime extends Date{ 11 | private static final long serialVersionUID = -5395712593979185936L; 12 | 13 | /** 14 | * 转换JDK date为 DateTime 15 | * @param date JDK Date 16 | * @return DateTime 17 | */ 18 | public static DateTime parse(Date date) { 19 | return new DateTime(date); 20 | } 21 | 22 | /** 23 | * 当前时间 24 | */ 25 | public DateTime() { 26 | super(); 27 | } 28 | 29 | /** 30 | * 给定日期的构造 31 | * @param date 日期 32 | */ 33 | public DateTime(Date date) { 34 | this(date.getTime()); 35 | } 36 | 37 | /** 38 | * 给定日期毫秒数的构造 39 | * @param timeMillis 日期毫秒数 40 | */ 41 | public DateTime(long timeMillis) { 42 | super(timeMillis); 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return DateTimeKit.formatDateTime(this); 48 | } 49 | 50 | public String toString(String format) { 51 | return DateTimeKit.format(this, format); 52 | } 53 | 54 | /** 55 | * @return 输出精确到毫秒的标准日期形式 56 | */ 57 | public String toMsStr() { 58 | return DateTimeKit.format(this, DateTimeKit.NORM_DATETIME_MS_PATTERN); 59 | } 60 | 61 | /** 62 | * @return java.util.Date 63 | */ 64 | public Date toDate() { 65 | return new Date(this.getTime()); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/support/ObjectKit.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.support; 2 | 3 | /** 4 | * 一些通用的函数 5 | * 6 | * @author Looly 7 | * 8 | */ 9 | public class ObjectKit { 10 | /** 11 | * 比较两个对象是否相等。
12 | * 相同的条件有两个,满足其一即可:
13 | * 1. obj1 == null && obj2 == null; 2. obj1.equals(obj2) 14 | * 15 | * @param obj1 对象1 16 | * @param obj2 对象2 17 | * @return 是否相等 18 | */ 19 | public static boolean equals(Object obj1, Object obj2) { 20 | return (obj1 != null) ? (obj1.equals(obj2)) : (obj2 == null); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/support/PageKit.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.support; 2 | 3 | /** 4 | * 分页工具类 5 | * 6 | * @author xiaoleilu 7 | * 8 | */ 9 | public class PageKit { 10 | 11 | /** 12 | * 将页数和每页条目数转换为开始位置和结束位置
13 | * 此方法用于不包括结束位置的分页方法
14 | * 例如:
15 | * 页码:1,每页10 -> [0, 10]
16 | * 页码:2,每页10 -> [10, 20]
17 | * 。。。
18 | * 19 | * @param pageNo 20 | * 页码(从1计数) 21 | * @param countPerPage 22 | * 每页条目数 23 | * @return 第一个数为开始位置,第二个数为结束位置 24 | */ 25 | public static int[] transToStartEnd(int pageNo, int countPerPage) { 26 | if (pageNo < 1) { 27 | pageNo = 1; 28 | } 29 | 30 | if (countPerPage < 1) { 31 | countPerPage = 0; 32 | // LogKit.warn("Count per page [" + countPerPage + "] is not valid!"); 33 | } 34 | 35 | int start = (pageNo - 1) * countPerPage; 36 | int end = start + countPerPage; 37 | 38 | return new int[] { start, end }; 39 | } 40 | 41 | /** 42 | * 根据总数计算总页数 43 | * 44 | * @param totalCount 45 | * 总数 46 | * @param numPerPage 47 | * 每页数 48 | * @return 总页数 49 | */ 50 | public static int totalPage(int totalCount, int numPerPage) { 51 | if (numPerPage == 0) { 52 | return 0; 53 | } 54 | return totalCount % numPerPage == 0 ? (totalCount / numPerPage) 55 | : (totalCount / numPerPage + 1); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/util/HttpSessionHolder.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import javax.servlet.http.HttpSession; 4 | 5 | /** 6 | * 非Controller中获取当前session的工具类 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月28日 上午10:24:31 10 | */ 11 | public class HttpSessionHolder { 12 | 13 | private static ThreadLocal tl = new ThreadLocal(); 14 | 15 | public static void put(HttpSession s) { 16 | tl.set(s); 17 | } 18 | 19 | public static HttpSession get() { 20 | return tl.get(); 21 | } 22 | 23 | public static void remove() { 24 | tl.remove(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/util/IdGenerator.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; 5 | 6 | /** 7 | * 唯一id生成器 8 | * 9 | * @author fengshuonan 10 | * @date 2017-08-23 11:10 11 | */ 12 | public class IdGenerator { 13 | 14 | public static String getId() { 15 | return String.valueOf(IdWorker.getId()); 16 | } 17 | 18 | public static long getIdLong() { 19 | return IdWorker.getId(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/util/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import java.security.MessageDigest; 4 | import java.security.NoSuchAlgorithmException; 5 | 6 | /** 7 | * MD5加密类(封装jdk自带的md5加密方法) 8 | * 9 | * @author fengshuonan 10 | * @date 2016年12月2日 下午4:14:22 11 | */ 12 | public class MD5Util { 13 | 14 | public static String encrypt(String source) { 15 | return encodeMd5(source.getBytes()); 16 | } 17 | 18 | private static String encodeMd5(byte[] source) { 19 | try { 20 | return encodeHex(MessageDigest.getInstance("MD5").digest(source)); 21 | } catch (NoSuchAlgorithmException e) { 22 | throw new IllegalStateException(e.getMessage(), e); 23 | } 24 | } 25 | 26 | private static String encodeHex(byte[] bytes) { 27 | StringBuffer buffer = new StringBuffer(bytes.length * 2); 28 | for (int i = 0; i < bytes.length; i++) { 29 | if (((int) bytes[i] & 0xff) < 0x10) 30 | buffer.append("0"); 31 | buffer.append(Long.toString((int) bytes[i] & 0xff, 16)); 32 | } 33 | return buffer.toString(); 34 | } 35 | 36 | public static void main(String[] args) { 37 | System.out.println(encrypt("123456")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/util/RenderUtil.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.stylefeng.guns.core.exception.GunsException; 5 | import com.stylefeng.guns.core.exception.GunsExceptionEnum; 6 | 7 | import javax.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | import java.io.PrintWriter; 10 | 11 | /** 12 | * 渲染工具类 13 | * 14 | * @author stylefeng 15 | * @date 2017-08-25 14:13 16 | */ 17 | public class RenderUtil { 18 | 19 | /** 20 | * 渲染json对象 21 | */ 22 | public static void renderJson(HttpServletResponse response, Object jsonObject) { 23 | try { 24 | response.setContentType("application/json"); 25 | response.setCharacterEncoding("UTF-8"); 26 | PrintWriter writer = response.getWriter(); 27 | writer.write(JSON.toJSONString(jsonObject)); 28 | } catch (IOException e) { 29 | throw new GunsException(GunsExceptionEnum.WRITE_ERROR); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/util/ResKit.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import org.springframework.core.io.Resource; 4 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; 5 | import org.springframework.core.io.support.ResourcePatternResolver; 6 | 7 | import java.io.IOException; 8 | 9 | /** 10 | * 资源文件相关的操作类 11 | * 12 | * @author fengshuonan 13 | * @date 2016年11月17日 下午10:09:23 14 | */ 15 | public class ResKit { 16 | 17 | /** 18 | * @Description 批量获取ClassPath下的资源文件 19 | * @author fengshuonan 20 | */ 21 | public static Resource[] getClassPathResources(String pattern) { 22 | ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); 23 | try { 24 | return resolver.getResources(pattern); 25 | } catch (IOException e) { 26 | throw new RuntimeException("加载resource文件时,找不到文件,所找文件为:" + pattern); 27 | } 28 | } 29 | 30 | /** 31 | * @Description 批量获取ClassPath下的资源文件 32 | * @author fengshuonan 33 | */ 34 | public static String getClassPathFile(String file) { 35 | //return ResKit.class.getClassLoader().getResource(file).getPath(); 36 | return Thread.currentThread().getContextClassLoader().getResource(file).getPath(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/java/com/stylefeng/guns/core/util/SqlUtil.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.core.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * sql语句工具类 8 | * 9 | * @author fengshuonan 10 | * @date 2016年12月6日 下午1:01:54 11 | */ 12 | public class SqlUtil { 13 | 14 | /** 15 | * @Description 根据集合的大小,输出相应个数"?" 16 | * @author fengshuonan 17 | */ 18 | public static String parse(List list) { 19 | String str = ""; 20 | if (list != null && list.size() > 0) { 21 | str = str + "?"; 22 | for (int i = 1; i < list.size(); i++) { 23 | str = str + ",?"; 24 | } 25 | } 26 | return str; 27 | } 28 | 29 | public static void main(String[] args) { 30 | ArrayList arrayList = new ArrayList<>(); 31 | arrayList.add(2); 32 | arrayList.add(2); 33 | System.out.println(parse(arrayList)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /school-bus/guns-core/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # AutoConfiguration 2 | #org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | #com.stylefeng.guns.core.base.controller.GlobalController,\ 4 | com.stylefeng.guns.core.config.DefaultFastjsonConfig,\ 5 | #com.stylefeng.guns.core.config.DefaultProperties,\ 6 | #com.stylefeng.guns.core.config.DefaultWebConfig -------------------------------------------------------------------------------- /school-bus/guns-gateway/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-gateway/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/GunsGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @EnableDubbo 9 | public class GunsGatewayApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GunsGatewayApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/GunsGatewayServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsGatewayServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsGatewayApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/common/CommonBindingResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: CommonBindingResult 4 | * @author: mf 5 | * @create: 2020/03/01 15:16 6 | */ 7 | 8 | package com.stylefeng.guns.rest.common; 9 | 10 | 11 | import org.springframework.validation.BindingResult; 12 | 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | public class CommonBindingResult { 17 | 18 | public static String getErrors(BindingResult bindingResult) { 19 | ArrayList errors = bindingResult.getFieldErrors() 20 | .stream() 21 | .collect(() -> new ArrayList(), (l, o) -> { 22 | l.add(o.getDefaultMessage()); 23 | }, List::addAll); 24 | return errors.toString(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/common/SimpleObject.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common; 2 | 3 | /** 4 | * 测试用的 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 16:47 8 | */ 9 | public class SimpleObject { 10 | 11 | private String user; 12 | 13 | private String name; 14 | 15 | private String tips; 16 | 17 | private Integer age; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getTips() { 28 | return tips; 29 | } 30 | 31 | public void setTips(String tips) { 32 | this.tips = tips; 33 | } 34 | 35 | public Integer getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(Integer age) { 40 | this.age = age; 41 | } 42 | 43 | public String getUser() { 44 | return user; 45 | } 46 | 47 | public void setUser(String user) { 48 | this.user = user; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.exception; 2 | 3 | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; 4 | 5 | /** 6 | * 所有业务异常的枚举 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月12日 下午5:04:51 10 | */ 11 | public enum BizExceptionEnum implements ServiceExceptionEnum { 12 | 13 | /** 14 | * token异常 15 | */ 16 | TOKEN_EXPIRED(700, "token过期"), 17 | TOKEN_ERROR(700, "token验证失败"), 18 | 19 | /** 20 | * 签名异常 21 | */ 22 | SIGN_ERROR(700, "签名验证失败"), 23 | 24 | /** 25 | * 其他 26 | */ 27 | AUTH_REQUEST_ERROR(400, "账号密码错误"); 28 | 29 | BizExceptionEnum(int code, String message) { 30 | this.code = code; 31 | this.message = message; 32 | } 33 | 34 | private Integer code; 35 | 36 | private String message; 37 | 38 | @Override 39 | public Integer getCode() { 40 | return code; 41 | } 42 | 43 | public void setCode(Integer code) { 44 | this.code = code; 45 | } 46 | 47 | @Override 48 | public String getMessage() { 49 | return message; 50 | } 51 | 52 | public void setMessage(String message) { 53 | this.message = message; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/config/MessageConverConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.stylefeng.guns.core.config.DefaultFastjsonConfig; 4 | import com.stylefeng.guns.rest.modular.auth.converter.WithSignMessageConverter; 5 | import com.stylefeng.guns.rest.config.properties.RestProperties; 6 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | /** 11 | * 签名校验messageConverter 12 | * 13 | * @author fengshuonan 14 | * @date 2017-08-25 16:04 15 | */ 16 | @Configuration 17 | public class MessageConverConfig { 18 | 19 | @Bean 20 | @ConditionalOnProperty(prefix = RestProperties.REST_PREFIX, name = "sign-open", havingValue = "true", matchIfMissing = true) 21 | public WithSignMessageConverter withSignMessageConverter() { 22 | WithSignMessageConverter withSignMessageConverter = new WithSignMessageConverter(); 23 | DefaultFastjsonConfig defaultFastjsonConfig = new DefaultFastjsonConfig(); 24 | withSignMessageConverter.setFastJsonConfig(defaultFastjsonConfig.fastjsonConfig()); 25 | withSignMessageConverter.setSupportedMediaTypes(defaultFastjsonConfig.getSupportedMediaType()); 26 | return withSignMessageConverter; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * MybatisPlus配置 10 | * 11 | * @author stylefeng 12 | * @Date 2017年8月23日12:51:41 13 | */ 14 | //@Configuration 15 | //@MapperScan(basePackages = {"com.stylefeng.guns.rest.*.dao", "com.stylefeng.guns.rest.common.persistence.dao"}) 16 | public class MybatisPlusConfig { 17 | 18 | /** 19 | * mybatis-plus分页插件 20 | */ 21 | @Bean 22 | public PaginationInterceptor paginationInterceptor() { 23 | return new PaginationInterceptor(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | import com.stylefeng.guns.rest.config.properties.RestProperties; 4 | import com.stylefeng.guns.rest.modular.auth.filter.AuthFilter; 5 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 6 | import com.stylefeng.guns.rest.modular.auth.security.impl.Base64SecurityAction; 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 11 | 12 | /** 13 | * web配置 14 | * 15 | * @author fengshuonan 16 | * @date 2017-08-23 15:48 17 | */ 18 | @Configuration 19 | public class WebConfig implements WebMvcConfigurer { 20 | 21 | @Bean 22 | @ConditionalOnProperty(prefix = RestProperties.REST_PREFIX, name = "auth-open", havingValue = "true", matchIfMissing = true) 23 | public AuthFilter jwtAuthenticationTokenFilter() { 24 | return new AuthFilter(); 25 | } 26 | 27 | @Bean 28 | public DataSecurityAction dataSecurityAction() { 29 | return new Base64SecurityAction(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/config/properties/RestProperties.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config.properties; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * 项目相关配置 8 | * 9 | * @author fengshuonan 10 | * @date 2017年10月23日16:44:15 11 | */ 12 | @Configuration 13 | @ConfigurationProperties(prefix = RestProperties.REST_PREFIX) 14 | public class RestProperties { 15 | 16 | public static final String REST_PREFIX = "rest"; 17 | 18 | private boolean authOpen = true; 19 | 20 | private boolean signOpen = true; 21 | 22 | public boolean isAuthOpen() { 23 | return authOpen; 24 | } 25 | 26 | public void setAuthOpen(boolean authOpen) { 27 | this.authOpen = authOpen; 28 | } 29 | 30 | public boolean isSignOpen() { 31 | return signOpen; 32 | } 33 | 34 | public void setSignOpen(boolean signOpen) { 35 | this.signOpen = signOpen; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthRequest.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * 认证的请求dto 11 | * 12 | * @author fengshuonan 13 | * @Date 2017/8/24 14:00 14 | */ 15 | @ApiModel(value = "Auth请求实体", description = "Auth请求参数") 16 | @Data 17 | public class AuthRequest{ 18 | 19 | @NotNull(message = "用户名不能为空") 20 | @ApiModelProperty(value = "用户名", example = "mai", required = true) 21 | private String userName; 22 | 23 | @NotNull(message = "密码不能为空") 24 | @ApiModelProperty(value = "密码", example = "123", required = true) 25 | private String password; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.controller.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 认证的响应结果 7 | * 8 | * @author fengshuonan 9 | * @Date 2017/8/24 13:58 10 | */ 11 | public class AuthResponse implements Serializable { 12 | 13 | private static final long serialVersionUID = 1250166508152483573L; 14 | 15 | /** 16 | * jwt token 17 | */ 18 | private final String token; 19 | 20 | /** 21 | * 用于客户端混淆md5加密 22 | */ 23 | private final String randomKey; 24 | 25 | public AuthResponse(String token, String randomKey) { 26 | this.token = token; 27 | this.randomKey = randomKey; 28 | } 29 | 30 | public String getToken() { 31 | return this.token; 32 | } 33 | 34 | public String getRandomKey() { 35 | return randomKey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.converter; 2 | 3 | /** 4 | * 基础的传输bean 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 15:52 8 | */ 9 | public class BaseTransferEntity { 10 | 11 | private String object; //base64编码的json字符串 12 | 13 | private String sign; //签名 14 | 15 | public String getObject() { 16 | return object; 17 | } 18 | 19 | public void setObject(String object) { 20 | this.object = object; 21 | } 22 | 23 | public String getSign() { 24 | return sign; 25 | } 26 | 27 | public void setSign(String sign) { 28 | this.sign = sign; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security; 2 | 3 | /** 4 | *
 5 |  * 信息传递的保护措施(传递的数据为json)
 6 |  *
 7 |  * 说明:
 8 |  * 可以根据实际开发时的需要,编写自己的数据加密方案,只需实现此类,并在WebConfig下配置您所编写的实现类即可
 9 |  * 
10 | * 11 | * @author fengshuonan 12 | * @date 2017-09-18 20:41 13 | */ 14 | public interface DataSecurityAction { 15 | 16 | /** 17 | * 执行数据的保护措施 18 | * 19 | * @author stylefeng 20 | * @Date 2017/9/18 20:42 21 | */ 22 | String doAction(String beProtected); 23 | 24 | /** 25 | * 解除保护 26 | * 27 | * @author stylefeng 28 | * @Date 2017/9/18 20:45 29 | */ 30 | String unlock(String securityCode); 31 | } 32 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.modular.auth.security.impl; 2 | 3 | import com.stylefeng.guns.rest.modular.auth.security.DataSecurityAction; 4 | import org.springframework.util.Base64Utils; 5 | 6 | /** 7 | * 对数据进行base64编码的方式 8 | * 9 | * @author fengshuonan 10 | * @date 2017-09-18 20:43 11 | */ 12 | public class Base64SecurityAction implements DataSecurityAction { 13 | 14 | @Override 15 | public String doAction(String beProtected) { 16 | return Base64Utils.encodeToString(beProtected.getBytes()); 17 | } 18 | 19 | @Override 20 | public String unlock(String securityCode) { 21 | byte[] bytes = Base64Utils.decodeFromString(securityCode); 22 | return new String(bytes); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/AddOrderForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: AddOrderForm 4 | * @author: mf 5 | * @create: 2020/03/15 03:01 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @ApiModel(value = "更新实体", description = "更新请求信息") 15 | @Data 16 | public class AddOrderForm { 17 | @ApiModelProperty(value = "场次id", required = true) 18 | private Long countId; 19 | @ApiModelProperty(value = "下单人", required = true) 20 | private String orderUser; 21 | @ApiModelProperty(value = "0:沙河->清水河;1:清水河->沙河", required = true) 22 | private String busStatus; 23 | @ApiModelProperty(value = "已选座位编号,例如:1,2", required = true) 24 | private String seatsIds; 25 | @ApiModelProperty(value = "场次价格", required = true) 26 | private Double countPrice; 27 | @ApiModelProperty(value = "订单过期时间", required = true) 28 | private Integer expireTime; 29 | } 30 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/CountPageInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PageInfo 4 | * @author: mf 5 | * @create: 2020/03/01 22:58 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @Data 15 | @ApiModel(value = "分页实体", description = "分页请求信息") 16 | public class CountPageInfo { 17 | 18 | @ApiModelProperty(name = "currentPage", value = "当前页", example = "1", dataType = "long", required = true) 19 | private Long currentPage; 20 | 21 | @ApiModelProperty(name = "pageSize", value = "每页的条目数量", example = "4", dataType = "long", required = true) 22 | private Long pageSize; 23 | 24 | @ApiModelProperty(name = "busStatus", value = "0:沙河->清水河,1:清水河->沙河", example = "0", dataType = "String", required = true) 25 | private String busStatus; 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/OrderPageInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderPageInfo 4 | * @author: mf 5 | * @create: 2020/03/15 16:37 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @Data 15 | @ApiModel(value = "分页实体", description = "分页请求信息") 16 | public class OrderPageInfo { 17 | @ApiModelProperty(name = "currentPage", value = "当前页", example = "1", dataType = "long", required = true) 18 | private Long currentPage; 19 | 20 | @ApiModelProperty(name = "pageSize", value = "每页的条目数量", example = "4", dataType = "long", required = true) 21 | private Long pageSize; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/OrderUpdateForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderUpdateForm 4 | * @author: mf 5 | * @create: 2020/04/06 17:14 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @ApiModel(value = "更新实体", description = "更新请求信息") 15 | @Data 16 | public class OrderUpdateForm { 17 | 18 | @ApiModelProperty(name = "orderId", value = "订单id", example = "1", required = true, dataType = "Long") 19 | private Long OrderId; 20 | @ApiModelProperty(name = "orderStatus", value = "订单装填", example = "1", required = true, dataType = "String") 21 | private String orderStatus; 22 | } 23 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/PayBackForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayBackForm 4 | * @author: mf 5 | * @create: 2020/03/20 17:39 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @ApiModel(value = "退款实体", description = "退款请求信息") 15 | @Data 16 | public class PayBackForm { 17 | 18 | @ApiModelProperty(value = "订单id", required = true) 19 | private Long orderId; 20 | @ApiModelProperty(value = "场次id", required = true) 21 | private Long coundId; 22 | @ApiModelProperty(value = "座位id", required = true) 23 | private String seatsIds; 24 | @ApiModelProperty(value = "总金额", required = true) 25 | private Double totalMoney; 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/PayForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: PayForm 4 | * @author: mf 5 | * @create: 2020/03/17 16:56 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @ApiModel(value = "支付实体", description = "支付请求信息") 15 | @Data 16 | public class PayForm { 17 | @ApiModelProperty(value = "支付密码", required = true) // 这里值得优化 18 | private String payPassword; 19 | @ApiModelProperty(value = "总价格,直接传钱,感觉不安全", required = true) // 这里值得优化 20 | private Double totalMoney; // 直接传钱, 感觉不安全 21 | } 22 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/UserRegstierForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserRegstierForm 4 | * @author: mf 5 | * @create: 2020/03/02 00:51 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | import javax.validation.constraints.NotNull; 15 | 16 | @ApiModel(value = "注册实体", description = "注册请求信息") 17 | @Data 18 | public class UserRegstierForm { 19 | 20 | @NotNull(message = "用户名不能为空") 21 | @ApiModelProperty(value = "用户名", example = "mai", required = true) 22 | private String username; 23 | 24 | @NotNull(message = "密码不能为空") 25 | @ApiModelProperty(value = "密码", example = "123", required = true) 26 | private String password; 27 | 28 | @ApiModelProperty(value = "邮箱", required = false) 29 | private String email; 30 | 31 | @ApiModelProperty(value = "手机号码", required = false) 32 | private String phone; 33 | } 34 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/form/UserUpdateForm.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserUpdateForm 4 | * @author: mf 5 | * @create: 2020/03/02 00:55 6 | */ 7 | 8 | package com.stylefeng.guns.rest.modular.form; 9 | 10 | import io.swagger.annotations.ApiModel; 11 | import io.swagger.annotations.ApiModelProperty; 12 | import lombok.Data; 13 | 14 | @ApiModel(value = "更新实体", description = "更新请求信息") 15 | @Data 16 | public class UserUpdateForm { 17 | @ApiModelProperty(hidden = true) 18 | private Long id; // 通过id找 19 | 20 | // private String userName; 21 | @ApiModelProperty(value = "昵称", required = false) 22 | private String nickName; 23 | 24 | @ApiModelProperty(value = "性别", dataType = "integer", required = false) 25 | private Integer userSex; 26 | 27 | @ApiModelProperty(value = "邮箱", required = false) 28 | private String email; 29 | 30 | @ApiModelProperty(value = "手机号", required = false) 31 | private String userPhone; 32 | 33 | @ApiModelProperty(value = "用户余额", dataType = "double", required = false) 34 | private Double money; 35 | 36 | @ApiModelProperty(value = "用户支付密码", required = false) 37 | private String payPassword; 38 | } 39 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/main/resources/static/file/seat.json: -------------------------------------------------------------------------------- 1 | { 2 | "seats": { 3 | "left": { 4 | "row1": ["1", "2"], 5 | "row2": ["5", "6"], 6 | "row3": ["9", "10"], 7 | "row4": ["13", "14"], 8 | "row5": ["17", "18"] 9 | }, 10 | "right": { 11 | "row1": ["3", "4"], 12 | "row2": ["7", "8"], 13 | "row3": ["11", "12"], 14 | "row4": ["15", "16"], 15 | "row5": ["19", "20"] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/test/java/com/stylefeng/guns/GunsRestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsRestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/test/java/com/stylefeng/guns/fastjson/JsonTest.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.fastjson; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.stylefeng.guns.core.util.MD5Util; 5 | import com.stylefeng.guns.rest.common.SimpleObject; 6 | import com.stylefeng.guns.rest.modular.auth.converter.BaseTransferEntity; 7 | 8 | /** 9 | * json测试 10 | * 11 | * @author fengshuonan 12 | * @date 2017-08-25 16:11 13 | */ 14 | 15 | 16 | public class JsonTest { 17 | 18 | public static void main(String[] args) { 19 | String randomKey = "1xm7hw"; 20 | 21 | BaseTransferEntity baseTransferEntity = new BaseTransferEntity(); 22 | SimpleObject simpleObject = new SimpleObject(); 23 | simpleObject.setUser("fsn"); 24 | baseTransferEntity.setObject("123123"); 25 | 26 | String json = JSON.toJSONString(simpleObject); 27 | 28 | //md5签名 29 | String encrypt = MD5Util.encrypt(json + randomKey); 30 | baseTransferEntity.setSign(encrypt); 31 | 32 | System.out.println(JSON.toJSONString(baseTransferEntity)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /school-bus/guns-gateway/src/test/java/com/stylefeng/guns/jwt/DecryptTest.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.jwt; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.stylefeng.guns.core.util.MD5Util; 5 | import com.stylefeng.guns.rest.common.SimpleObject; 6 | import com.stylefeng.guns.rest.modular.auth.converter.BaseTransferEntity; 7 | import com.stylefeng.guns.rest.modular.auth.security.impl.Base64SecurityAction; 8 | 9 | /** 10 | * jwt测试 11 | * 12 | * @author fengshuonan 13 | * @date 2017-08-21 16:34 14 | */ 15 | public class DecryptTest { 16 | 17 | public static void main(String[] args) { 18 | 19 | String salt = "0iqwhi"; 20 | 21 | SimpleObject simpleObject = new SimpleObject(); 22 | simpleObject.setUser("stylefeng"); 23 | simpleObject.setAge(12); 24 | simpleObject.setName("ffff"); 25 | simpleObject.setTips("code"); 26 | 27 | String jsonString = JSON.toJSONString(simpleObject); 28 | String encode = new Base64SecurityAction().doAction(jsonString); 29 | String md5 = MD5Util.encrypt(encode + salt); 30 | 31 | BaseTransferEntity baseTransferEntity = new BaseTransferEntity(); 32 | baseTransferEntity.setObject(encode); 33 | baseTransferEntity.setSign(md5); 34 | 35 | System.out.println(JSON.toJSONString(baseTransferEntity)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /school-bus/guns-order/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-order/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-order/src/main/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-order/src/main/java/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/GunsOrderApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @EnableDubbo 9 | public class GunsOrderApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GunsOrderApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/GunsOrderServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsOrderServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsOrderApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/common/SimpleObject.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common; 2 | 3 | /** 4 | * 测试用的 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 16:47 8 | */ 9 | public class SimpleObject { 10 | 11 | private String user; 12 | 13 | private String name; 14 | 15 | private String tips; 16 | 17 | private Integer age; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getTips() { 28 | return tips; 29 | } 30 | 31 | public void setTips(String tips) { 32 | this.tips = tips; 33 | } 34 | 35 | public Integer getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(Integer age) { 40 | this.age = age; 41 | } 42 | 43 | public String getUser() { 44 | return user; 45 | } 46 | 47 | public void setUser(String user) { 48 | this.user = user; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.exception; 2 | 3 | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; 4 | 5 | /** 6 | * 所有业务异常的枚举 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月12日 下午5:04:51 10 | */ 11 | public enum BizExceptionEnum implements ServiceExceptionEnum { 12 | 13 | /** 14 | * token异常 15 | */ 16 | TOKEN_EXPIRED(700, "token过期"), 17 | TOKEN_ERROR(700, "token验证失败"), 18 | 19 | /** 20 | * 签名异常 21 | */ 22 | SIGN_ERROR(700, "签名验证失败"), 23 | 24 | /** 25 | * 其他 26 | */ 27 | AUTH_REQUEST_ERROR(400, "账号密码错误"); 28 | 29 | BizExceptionEnum(int code, String message) { 30 | this.code = code; 31 | this.message = message; 32 | } 33 | 34 | private Integer code; 35 | 36 | private String message; 37 | 38 | @Override 39 | public Integer getCode() { 40 | return code; 41 | } 42 | 43 | public void setCode(Integer code) { 44 | this.code = code; 45 | } 46 | 47 | @Override 48 | public String getMessage() { 49 | return message; 50 | } 51 | 52 | public void setMessage(String message) { 53 | this.message = message; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * MybatisPlus配置 11 | * 12 | * @author stylefeng 13 | * @Date 2017年8月23日12:51:41 14 | */ 15 | @Configuration 16 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.common.persistence.dao"}) 17 | public class MybatisPlusConfig { 18 | 19 | /** 20 | * mybatis-plus分页插件 21 | */ 22 | @Bean 23 | public PaginationInterceptor paginationInterceptor() { 24 | return new PaginationInterceptor(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/config/RedisListenerConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: RedisListenerConfig 4 | * @author: mf 5 | * @create: 2020/03/20 18:52 6 | */ 7 | 8 | package com.stylefeng.guns.rest.config; 9 | 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | import org.springframework.data.redis.connection.RedisConnectionFactory; 13 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; 14 | 15 | @Configuration 16 | public class RedisListenerConfig { 17 | @Bean 18 | RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory) { 19 | RedisMessageListenerContainer container = new RedisMessageListenerContainer(); 20 | container.setConnectionFactory(connectionFactory); 21 | return container; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/main/java/com/stylefeng/guns/rest/modular/order/converter/OrderConvertver.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: OrderConvertver 4 | * @author: mf 5 | * @create: 2020/03/04 21:50 6 | */ 7 | package com.stylefeng.guns.rest.modular.order.converter; 8 | 9 | import com.stylefeng.guns.rest.common.convert.DateMapper; 10 | import com.stylefeng.guns.rest.common.persistence.model.Order; 11 | import com.stylefeng.guns.rest.order.dto.AddOrderRequest; 12 | import com.stylefeng.guns.rest.order.dto.OrderDto; 13 | import com.stylefeng.guns.rest.order.dto.OrderRequest; 14 | import org.mapstruct.Mapper; 15 | import org.mapstruct.Mapping; 16 | import org.mapstruct.Mappings; 17 | 18 | import java.util.List; 19 | 20 | @Mapper(componentModel = "spring", uses = DateMapper.class) 21 | public interface OrderConvertver { 22 | 23 | @Mappings({}) 24 | List order2Res(List orders); 25 | 26 | @Mappings({}) 27 | Order res2Order(AddOrderRequest request); 28 | 29 | @Mappings({}) 30 | OrderDto order2Res(Order order); 31 | 32 | @Mappings({}) 33 | Order res2Order(OrderRequest request); 34 | } 35 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/test/java/com/stylefeng/guns/GunsOrderApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsOrderApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-order/src/test/java/com/stylefeng/guns/rest/RedisMessage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: Redis 4 | * @author: mf 5 | * @create: 2020/05/29 19:37 6 | */ 7 | 8 | package com.stylefeng.guns.rest; 9 | 10 | import lombok.Data; 11 | 12 | @Data 13 | public class RedisMessage { 14 | 15 | /** 16 | * 消息id 17 | */ 18 | private String id; 19 | 20 | /** 21 | * 消息延迟/毫秒 22 | */ 23 | private long delay; 24 | 25 | /** 26 | * 消息存活时间 27 | */ 28 | private int ttl; 29 | 30 | /** 31 | * 消息体,对应业务内容 32 | */ 33 | private String body; 34 | 35 | /** 36 | * 创建时间,如果只有优先级没有延迟,可以设置创建时间为0 37 | * 用来消除时间的影响 38 | */ 39 | private long createTime; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /school-bus/guns-pay/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-pay/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-pay/src/main/java/com/stylefeng/guns/rest/GunsPayApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @EnableDubbo 9 | public class GunsPayApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GunsPayApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /school-bus/guns-pay/src/main/java/com/stylefeng/guns/rest/GunsPayServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsPayServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsPayApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-pay/src/main/java/com/stylefeng/guns/rest/common/SimpleObject.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common; 2 | 3 | /** 4 | * 测试用的 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 16:47 8 | */ 9 | public class SimpleObject { 10 | 11 | private String user; 12 | 13 | private String name; 14 | 15 | private String tips; 16 | 17 | private Integer age; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getTips() { 28 | return tips; 29 | } 30 | 31 | public void setTips(String tips) { 32 | this.tips = tips; 33 | } 34 | 35 | public Integer getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(Integer age) { 40 | this.age = age; 41 | } 42 | 43 | public String getUser() { 44 | return user; 45 | } 46 | 47 | public void setUser(String user) { 48 | this.user = user; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /school-bus/guns-pay/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.exception; 2 | 3 | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; 4 | 5 | /** 6 | * 所有业务异常的枚举 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月12日 下午5:04:51 10 | */ 11 | public enum BizExceptionEnum implements ServiceExceptionEnum { 12 | 13 | /** 14 | * token异常 15 | */ 16 | TOKEN_EXPIRED(700, "token过期"), 17 | TOKEN_ERROR(700, "token验证失败"), 18 | 19 | /** 20 | * 签名异常 21 | */ 22 | SIGN_ERROR(700, "签名验证失败"), 23 | 24 | /** 25 | * 其他 26 | */ 27 | AUTH_REQUEST_ERROR(400, "账号密码错误"); 28 | 29 | BizExceptionEnum(int code, String message) { 30 | this.code = code; 31 | this.message = message; 32 | } 33 | 34 | private Integer code; 35 | 36 | private String message; 37 | 38 | @Override 39 | public Integer getCode() { 40 | return code; 41 | } 42 | 43 | public void setCode(Integer code) { 44 | this.code = code; 45 | } 46 | 47 | @Override 48 | public String getMessage() { 49 | return message; 50 | } 51 | 52 | public void setMessage(String message) { 53 | this.message = message; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /school-bus/guns-pay/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * MybatisPlus配置 11 | * 12 | * @author stylefeng 13 | * @Date 2017年8月23日12:51:41 14 | */ 15 | @Configuration 16 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.common.persistence.dao"}) 17 | public class MybatisPlusConfig { 18 | 19 | /** 20 | * mybatis-plus分页插件 21 | */ 22 | @Bean 23 | public PaginationInterceptor paginationInterceptor() { 24 | return new PaginationInterceptor(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-pay/src/test/java/com/stylefeng/guns/GunsPayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsPayApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-user/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/stylefeng/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/stylefeng/guns/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/GunsUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @EnableDubbo 9 | public class GunsUserApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GunsUserApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/GunsUserServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Guns REST Web程序启动类 8 | * 9 | * @author fengshuonan 10 | * @date 2017年9月29日09:00:42 11 | */ 12 | public class GunsUserServletInitializer extends SpringBootServletInitializer { 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 16 | return builder.sources(GunsUserApplication.class); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/SimpleObject.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common; 2 | 3 | /** 4 | * 测试用的 5 | * 6 | * @author fengshuonan 7 | * @date 2017-08-25 16:47 8 | */ 9 | public class SimpleObject { 10 | 11 | private String user; 12 | 13 | private String name; 14 | 15 | private String tips; 16 | 17 | private Integer age; 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getTips() { 28 | return tips; 29 | } 30 | 31 | public void setTips(String tips) { 32 | this.tips = tips; 33 | } 34 | 35 | public Integer getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(Integer age) { 40 | this.age = age; 41 | } 42 | 43 | public String getUser() { 44 | return user; 45 | } 46 | 47 | public void setUser(String user) { 48 | this.user = user; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.exception; 2 | 3 | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; 4 | 5 | /** 6 | * 所有业务异常的枚举 7 | * 8 | * @author fengshuonan 9 | * @date 2016年11月12日 下午5:04:51 10 | */ 11 | public enum BizExceptionEnum implements ServiceExceptionEnum { 12 | 13 | /** 14 | * token异常 15 | */ 16 | TOKEN_EXPIRED(700, "token过期"), 17 | TOKEN_ERROR(700, "token验证失败"), 18 | 19 | /** 20 | * 签名异常 21 | */ 22 | SIGN_ERROR(700, "签名验证失败"), 23 | 24 | /** 25 | * 其他 26 | */ 27 | AUTH_REQUEST_ERROR(400, "账号密码错误"); 28 | 29 | BizExceptionEnum(int code, String message) { 30 | this.code = code; 31 | this.message = message; 32 | } 33 | 34 | private Integer code; 35 | 36 | private String message; 37 | 38 | @Override 39 | public Integer getCode() { 40 | return code; 41 | } 42 | 43 | public void setCode(Integer code) { 44 | this.code = code; 45 | } 46 | 47 | @Override 48 | public String getMessage() { 49 | return message; 50 | } 51 | 52 | public void setMessage(String message) { 53 | this.message = message; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/.DS_Store -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.common.persistence.dao; 2 | 3 | import com.stylefeng.guns.rest.common.persistence.model.User; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author Maifeng 12 | * @since 2020-03-01 13 | */ 14 | public interface UserMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns.rest.config; 2 | 3 | 4 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 5 | import org.mybatis.spring.annotation.MapperScan; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * MybatisPlus配置 11 | * 12 | * @author stylefeng 13 | * @Date 2017年8月23日12:51:41 14 | */ 15 | @Configuration 16 | @MapperScan(basePackages = {"com.stylefeng.guns.rest.common.persistence.dao"}) 17 | public class MybatisPlusConfig { 18 | 19 | /** 20 | * mybatis-plus分页插件 21 | */ 22 | @Bean 23 | public PaginationInterceptor paginationInterceptor() { 24 | return new PaginationInterceptor(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/main/java/com/stylefeng/guns/rest/modular/user/converter/UserConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserConverter 4 | * @author: mf 5 | * @create: 2020/02/26 02:29 6 | */ 7 | package com.stylefeng.guns.rest.modular.user.converter; 8 | 9 | 10 | import com.stylefeng.guns.rest.common.convert.DateMapper; 11 | import com.stylefeng.guns.rest.common.persistence.model.User; 12 | import com.stylefeng.guns.rest.user.dto.UserDto; 13 | import com.stylefeng.guns.rest.user.dto.UserRegisterRequest; 14 | import com.stylefeng.guns.rest.user.dto.UserUpdateInfoRequest; 15 | import org.mapstruct.Mapper; 16 | import org.mapstruct.Mapping; 17 | import org.mapstruct.Mappings; 18 | 19 | @Mapper(componentModel = "spring", uses = DateMapper.class) 20 | public interface UserConverter { 21 | 22 | @Mappings({ 23 | @Mapping(source = "request.username", target = "userName"), 24 | @Mapping(source = "request.password", target = "userPwd"), 25 | @Mapping(source = "request.phone", target = "userPhone") 26 | }) 27 | User res2User(UserRegisterRequest request); 28 | 29 | @Mappings({ 30 | @Mapping(source = "user.money", target = "money") 31 | 32 | }) 33 | UserDto User2Res(User user); 34 | 35 | @Mappings({ 36 | @Mapping(source = "request.id", target = "uuid"), 37 | }) 38 | User res2User(UserUpdateInfoRequest request); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/test/java/com/stylefeng/guns/GunsUserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.stylefeng.guns; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GunsUserApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/test/java/com/stylefeng/guns/rest/RedisTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: RedisTest 4 | * @author: mf 5 | * @create: 2020/03/13 18:57 6 | */ 7 | 8 | package com.stylefeng.guns.rest; 9 | 10 | 11 | import com.stylefeng.guns.rest.modular.user.RedisUtils; 12 | import org.junit.Test; 13 | import org.junit.runner.RunWith; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.boot.test.context.SpringBootTest; 16 | import org.springframework.test.context.junit4.SpringRunner; 17 | 18 | @RunWith(SpringRunner.class) 19 | @SpringBootTest 20 | public class RedisTest { 21 | 22 | @Autowired 23 | private RedisUtils redisUtils; 24 | 25 | @Test 26 | public void test() { 27 | System.out.println(redisUtils.set("a", 1)); 28 | System.out.println(redisUtils.get("a")); 29 | redisUtils.set("b", 2, 20); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /school-bus/guns-user/src/test/java/com/stylefeng/guns/rest/UserMapperTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @program school-bus 3 | * @description: UserMapperTest 4 | * @author: mf 5 | * @create: 2020/02/26 00:54 6 | */ 7 | 8 | package com.stylefeng.guns.rest; 9 | 10 | import com.stylefeng.guns.rest.common.persistence.dao.UserMapper; 11 | import com.stylefeng.guns.rest.common.persistence.model.User; 12 | import com.stylefeng.guns.rest.modular.user.converter.UserConverter; 13 | import com.stylefeng.guns.rest.user.dto.UserDto; 14 | import org.junit.Test; 15 | import org.junit.runner.RunWith; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.boot.test.context.SpringBootTest; 18 | import org.springframework.test.context.junit4.SpringRunner; 19 | 20 | @RunWith(SpringRunner.class) 21 | @SpringBootTest() 22 | public class UserMapperTest { 23 | 24 | @Autowired 25 | private UserMapper userMapper; 26 | 27 | @Autowired 28 | private UserConverter userConverter; 29 | 30 | @Test 31 | public void test() { 32 | User user = userMapper.selectById(2); 33 | System.out.println(user); 34 | } 35 | 36 | 37 | @Test 38 | public void registerTest() { 39 | User user = userMapper.selectById(2); 40 | UserDto userDto = userConverter.User2Res(user); 41 | System.out.println(userDto); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /school-bus/requests/http-client.env.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "dev": { 4 | "host": "http://127.0.0.1:8087", 5 | "token": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21LZXkiOiJ5NWQyeDMiLCJzdWIiOiI0IiwiZXhwIjoxNTkxNDM3ODA0LCJpYXQiOjE1OTA4MzMwMDR9.CvIUwieM2M4gI9Tmipt2mWobO8ugBmCo20oFz17S3m5mNdvFc29i7ajmuoNqmommhQrTy3NPaYbd8n0hq8bAyg" 6 | }, 7 | 8 | "line": { 9 | "host": "http://sb.dreamcat.ink:2020", 10 | "token": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21LZXkiOiJ5NWQyeDMiLCJzdWIiOiI0IiwiZXhwIjoxNTkxNDM3ODA0LCJpYXQiOjE1OTA4MzMwMDR9.CvIUwieM2M4gI9Tmipt2mWobO8ugBmCo20oFz17S3m5mNdvFc29i7ajmuoNqmommhQrTy3NPaYbd8n0hq8bAyg" 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /school-bus/requests/http-client.private.env.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DreamCats/school-bus/fc50ea8b19f99b4b15b2012048ea4651d896dd94/school-bus/requests/http-client.private.env.json --------------------------------------------------------------------------------