# 12306 **Repository Path**: pokeniao/12306 ## Basic Information - **Project Name**: 12306 - **Description**: 仿12306购票系统,后端接口 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-09-19 - **Last Updated**: 2024-03-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 配置 mysql数据库表,在db文件夹 bootstrap.yml修改nacos,seata地址 application.yml修改mysql地址,rocketMq地址,redis地址 # 运行:nacos,seata,RocketMq,mysql,redis # 接口测试: ## 1.获取乘客 get http://localhost:8000/member/passenger/query-list?current=1&size=5 `头需要携带:token ='jwttoken'` ## 2.获取会员数 get http://localhost:8000/member/member/count `头需要携带:token ='jwttoken'` ## 3.手机号验证码登入 post http://localhost:8000/member/member/login ```{ "mobile": 16677722312, "code": 8888 } ``` ## 4.保存乘客 post http://localhost:8000/member/passenger/save json ``` { "id": 1704891449297997824, "name": "pokeniao2", "idCard": 450204200112151023, "type": 1 } ``` ## 5.通过id删除乘客 delete http://localhost:8000/member/passenger/delete/1704890186061713408 ## 6.通过车次获得车位(gen-seat) get http://localhost:8000/business/admin/train/gen-seat/G2340 ## 7.通过车次删除车位 delete http://localhost:8000/business/admin/train/delete/G2340 ## 8.添加一条车站 post http://localhost:8000/business/admin/station/addTrainStation ```{ "trainCode": "G2340", "index": "4", "name": "柳州", "namePinyin": "laibingbei", "inTime": "07:27:00", "outTime": "07:30:00", "km": "140000" } ``` ## 9.定时调度测试-add post http://localhost:8000/scheduling/admin/job/add ``` { "group": "A", "name": "com.pokeniao.timeJob.DailyTrainSeatJob", "description": "addTest", "cronExpression": "*/2 * * * * ?" } ``` ## 10.定时调度测试-pause post http://localhost:8000/scheduling/admin/job/pause ``` { "group": "A", "name": "com.pokeniao.timeJob.DailyTrainSeatJob" } ``` ## 11.更具车次查询车站 或更具id 查询站的信息 post http://localhost:8000/business/admin/station/queryList ``` { "trainCode": "G2340", "current": "1", "size": "4" } ``` ## 12.trainDaily -add get http://localhost:8000/business/admin/trainDaily/add?code=G2340 ## 13.trainDaily/queryList post http://localhost:8000/business/admin/trainDaily/queryList ``` { "date": "2023-09-23", "current": "1", "size": "5" } ``` ## 14.定时调度之执行一次 post http://localhost:8000/scheduling/admin/job/run ``` { "group": "A", "name": "com.pokeniao.timeJob.DailyTrainSeatJob" } ``` ## 15.每日初始化 get http://localhost:8000/business/admin/trainDaily/gen-addALLTrainMessage/2024-03-06 ## 16.DailyCarriage/gen-daily get http://localhost:8000/business/admin/DailyCarriage/gen-daily/2023-09-26 ## 17.买票 post http://localhost:8000/business/admin/confirm-order/confirmOrder ``` { "date": "2024-03-06", "trainCode": "G2340", "start": "南宁东", "end": "来宾北", "dailyTrainTicketId": "1705856514088112128", "tickets": [ { "passengerId": "1695191226544", "passengerType": "w", "passengerName": "w", "passengerIdCard": "w", "seatTypeCode": "SWZ", "seat": "A" }, { "passengerId": "1695191226544", "passengerType": "w", "passengerName": "w", "passengerIdCard": "w", "seatTypeCode": "SWZ", "seat": "B" } , { "passengerId": "1695191226544", "passengerType": "w", "passengerName": "w", "passengerIdCard": "w", "seatTypeCode": "SWZ", "seat": "C" } ] } ``` ## 18.查票 post http://localhost:8000/business/admin/trainTicket/queryList ``` { "date": "2024-03-06", "start": "南宁", "end": "柳州", "current": "1", "size": "10" } ```