{"id":13753507,"url":"https://github.com/JoeCao/qbike","last_synced_at":"2025-05-09T21:35:00.779Z","repository":{"id":52997063,"uuid":"112175334","full_name":"JoeCao/qbike","owner":"JoeCao","description":"A demo of share bike using DDD, MicroService and Spring Cloud","archived":false,"fork":false,"pushed_at":"2024-08-26T17:05:16.000Z","size":381,"stargazers_count":507,"open_issues_count":10,"forks_count":176,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-11-16T06:30:27.422Z","etag":null,"topics":["ddd-architecture","event-storming","microservice","spring-cloud"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoeCao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-27T09:26:36.000Z","updated_at":"2024-10-22T09:56:38.000Z","dependencies_parsed_at":"2022-08-30T10:01:26.271Z","dependency_job_id":null,"html_url":"https://github.com/JoeCao/qbike","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeCao%2Fqbike","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeCao%2Fqbike/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeCao%2Fqbike/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeCao%2Fqbike/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoeCao","download_url":"https://codeload.github.com/JoeCao/qbike/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253328892,"owners_count":21891543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddd-architecture","event-storming","microservice","spring-cloud"],"created_at":"2024-08-03T09:01:23.570Z","updated_at":"2025-05-09T21:35:00.360Z","avatar_url":"https://github.com/JoeCao.png","language":"Java","funding_links":[],"categories":["spring-cloud"],"sub_categories":[],"readme":"滴滴电动车\n----\n\u003cu\u003e本项目纯属虚构，如有雷同实属巧合\u003c/u\u003e\n\n### 项目背景\n\n在嘀嘀打车的创业成功经验引领下你的创业团队发现了一个拥挤的大城市的电动车机会。\n你们发现电动车由于其灵活性能够在拥挤的路面上穿行，从而能够帮助很多上班族避免早晚高峰，按时到达目的地，比滴滴打车更方便。\n你们决定设计一个电动车的打车平台，能够在早晚高峰时匹配电动车司机和有需要的乘客。\n\n### Quick Start\n启动docker daemon进程  \nmvn clean install -DskipTests=true    \ndocker-compose up mysql  \nctrl-c退出  \ndocker-compose up  \n\nhttp://localhost:8050    \n\n### 测试接口\n安装postman，导入qbkie.postman_collection.json    \n调用fetchUser接口，注意，spring cloud第一次调用可能会失败，需要预热一段时间。  \n出现结果后，调用updateDriverPostion接口，将司机的坐标导入到redis中  \n然后就可以使用placeIntention接口发起一个请求\n然后再用confirmIntention接口，返回true就是成功匹配了，Order就会生成   \n注意：confirm的接口中需要输入intentionId，如果是第一次，就是1，不清楚，可以到docker的MySQL的表t_intention中找  \n\n在http://127.0.0.1:9411上可以找到zipkin对这几次调用的结果的追踪  \n![zipkin](http://os8wjvykw.bkt.clouddn.com/2018-07-05-035127.png)\n\n### Dev\n请安装Lombok插件，Java8 Stream + Lombok + Spring boot， 你会拥有一个全新的Java开发体验。\n\n### TODO\n* [x] 完全基于领域驱动设计\n* [x] 聚合根、领域对象、API的提炼按照`Event Storming`过程分析  \n* [x] 升级到`Spring Boot 2.0` 和`Spring Cloud Finchley`\n* [x] `Eureka`服务注册与发现  \n* [ ] `Swagger2`管理`REST API`  \n* [x] `Hystrix`服务的保护与容错  \n* [x] `Zuul`网关应用  \n* [x] `Zipkin`分布式追踪    \n\n\n### 业务场景\n\n初步设计的场景比较简单，主要是匹配有需求的乘客附近的电动车司机。经过前期的需求梳理，产出了下列的基本功能\n\n- 司机发布自己的位置和状态（默认一辆电动车只能搭载一位乘客）\n- 乘客提交行程需求（行程需要包含起点和终点，只支持实时提交，不支持预约）\n- 系统自动为乘客匹配合适的司机，将需求发送至司机手中\n- 司机确认是否接受行程\n- 司机和乘客按订单完成行程\n- 乘客行程途中要求改变行程\n- 系统计费及完成订单\n- 乘客对司机的评价\n\n\n![主要场景.005](https://user-images.githubusercontent.com/3287183/50633723-54d8b280-0f87-11e9-84a9-c8727872a443.png)\n\n\n### 业务流程\n\n![业务流程.006](https://user-images.githubusercontent.com/3287183/50633730-5c985700-0f87-11e9-8232-7bf638bf70fc.png)\n\n\n### 事件\n\n![事件.008](https://user-images.githubusercontent.com/3287183/50633743-6a4ddc80-0f87-11e9-8c8b-f011c84d0314.png)\n\n\n### 命令\n\n![滴滴电动车需求.009](https://user-images.githubusercontent.com/3287183/50633750-70dc5400-0f87-11e9-9296-a731b7f3f899.png)\n\n\n### 聚合识别\n\n\n![滴滴电动车需求.010](https://user-images.githubusercontent.com/3287183/50633761-7afe5280-0f87-11e9-8156-bdd898c1e106.png)\n\n![滴滴电动车需求.011](https://user-images.githubusercontent.com/3287183/50633776-881b4180-0f87-11e9-95ef-7286280e5af1.png)\n\n\n\n\n### 系统架构\n\n\n\n![image](https://user-images.githubusercontent.com/3287183/50633782-8e112280-0f87-11e9-9ac3-0f50941a2ae7.png)\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJoeCao%2Fqbike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJoeCao%2Fqbike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJoeCao%2Fqbike/lists"}