diff --git a/conf/config.yaml b/conf/config.yaml index 7181f7ee88ad7074bc87df06a94c3244028249a7..567a937c1859907ff62749c33a98db98a52dbdfb 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -1,7 +1,7 @@ run_mode: debug # 开发模式, debug, release, test -addr: :8000 # HTTP绑定端口 +addr: :8080 # HTTP绑定端口 name: qiandaoqitong # API Server的名字 -url: http://127.0.0.1:8000 # pingServer函数请求的API服务器的ip:port +url: http://127.0.0.1:8080 # pingServer函数请求的API服务器的ip:port max_ping_count: 10 # pingServer函数try的次数 log: @@ -16,7 +16,7 @@ log: # 数据库配置 db: - name: checkin + name: javaweb addr: 127.0.0.1:3306 username: root - password: 875839231 \ No newline at end of file + password: mysql1. \ No newline at end of file diff --git a/controller/lesson/lessionController.go b/controller/lesson/lessionController.go index d0528cf0be88795bd6630043b20f03ee164785c1..d6afb5089bbd72beea20f33f9dbe6eea1b097f1b 100644 --- a/controller/lesson/lessionController.go +++ b/controller/lesson/lessionController.go @@ -1,6 +1,7 @@ package lesson import ( + "fmt" "github.com/gin-gonic/gin" "qiandao/pkg/app" "qiandao/service" @@ -36,10 +37,42 @@ func CreateLesson(ctx *gin.Context) { // GetCreateLessonList 获取创建的课程列表 func GetCreateLessonList(ctx *gin.Context) { +// 1.绑定参数 + userId := ctx.Query("user_id") + if userId == "" { + app.SendResponse(ctx,app.ErrBind,nil) + return + } +// 2.调用业务逻辑 + dataList,err := service.GetCreateLessonList(userId) + if err != nil { + app.SendResponse(ctx,app.ErrUserNotExist,nil) + return + } + for _,v := range dataList{ + fmt.Println(v) + } +// 3.返回响应 + app.SendResponse(ctx,app.OK,dataList) } // GetJoinLessonList 获取加入的课程列表 -func GetJoinLessonList(ctx *gin.Context) { +func GetJoinLessonList(ctx *gin.Context){ +// 1.绑定参数 + classId := ctx.Query("class_id") + if classId == ""{ + app.SendResponse(ctx,app.ErrBind,nil) + return + } +// 2.调用业务逻辑 + joinList,err:= service.GetJoinLessonList(classId) + if err != nil{ + app.SendResponse(ctx,app.ErrClassNotExist,nil) + return + } +// 3.返回响应 + app.SendResponse(ctx,app.OK,joinList) } + diff --git a/log/star.log b/log/star.log index 07b96eacb5fbc476971eb93e5e9c74bf3ded5b97..525055fa07da38587dc77563c1756f556d620a22 100644 --- a/log/star.log +++ b/log/star.log @@ -336,3 +336,321 @@ {"level":"INFO","timestamp":"2022-05-07 09:09:39.117","file":"sd/healthcheck.go:25","msg":"路由正常"} {"level":"INFO","timestamp":"2022-05-07 09:09:39.117","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} {"level":"INFO","timestamp":"2022-05-07 09:09:39.117","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:16:17.519","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:16:17.524","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:16:17.524","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:33:39.011","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:33:39.011","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:33:39.011","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:40:31.735","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:40:31.735","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:40:31.735","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:41:10.916","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:41:10.916","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:41:10.917","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:43:10.744","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:43:10.745","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:43:10.745","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:44:50.821","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:44:50.821","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:44:50.821","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:46:49.318","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:46:49.319","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:46:49.319","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 11:47:41.316","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 11:47:41.317","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 11:47:41.317","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:33:06.824","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:33:06.824","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:33:06.825","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:42:06.303","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:42:06.303","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:42:06.303","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:45:06.349","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:45:06.349","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:45:06.349","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:46:25.637","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:46:25.637","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:46:25.637","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:47:01.408","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:47:01.408","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:47:01.408","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:53:03.962","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:53:03.963","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:53:03.963","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:54:10.108","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:54:10.109","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:54:10.109","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:56:54.662","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:56:54.663","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:56:54.663","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 12:57:26.150","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 12:57:26.150","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 12:57:26.150","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:06:08.285","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:06:08.285","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:06:08.285","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:06:49.676","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:06:49.677","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:06:49.677","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:07:58.534","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:07:58.534","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:07:58.534","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:08:35.638","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:08:35.638","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:08:35.638","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:09:16.988","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:09:16.990","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:09:16.990","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:11:00.945","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:11:00.946","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:11:00.946","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:11:14.002","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:11:14.002","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:11:14.002","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:12:54.950","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:12:54.950","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:12:54.950","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:27:55.792","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:27:55.792","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:27:55.793","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:28:59.932","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:28:59.933","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:28:59.934","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:29:41.757","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:29:41.757","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:29:41.757","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:37:31.840","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:37:31.840","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:37:31.840","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:38:01.414","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:38:01.414","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:38:01.415","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:38:26.575","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:38:26.576","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:38:26.576","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 13:39:39.190","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 13:39:39.191","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 13:39:39.191","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:10:25.530","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:10:25.531","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:10:25.531","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:11:32.826","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:11:32.827","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:11:32.827","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:13:03.179","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:13:03.228","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:13:03.228","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:13:33.361","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:13:33.361","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:13:33.361","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:14:12.335","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:14:12.335","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:14:12.335","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:14:42.090","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:14:42.090","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:14:42.090","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:15:47.773","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:15:47.773","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:15:47.774","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:16:26.688","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:16:26.688","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:16:26.688","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:16:50.260","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:16:50.260","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:16:50.260","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:17:59.402","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:17:59.402","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:17:59.402","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:20:07.065","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:20:07.065","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:20:07.065","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:20:48.825","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:20:48.825","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:20:48.825","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:21:22.098","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:21:22.098","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:21:22.099","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:22:09.824","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:22:09.824","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:22:09.824","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:22:42.930","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:22:42.931","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:22:42.931","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:26:22.497","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:26:22.498","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:26:22.498","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:27:04.875","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:27:04.875","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:27:04.875","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:27:57.668","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:27:57.668","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:27:57.668","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:28:37.928","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:28:37.929","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:28:37.929","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:29:33.771","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:29:33.771","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:29:33.771","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:30:11.739","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:30:11.740","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:30:11.740","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:31:29.127","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:31:29.127","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:31:29.127","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:32:22.317","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:32:22.318","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:32:22.318","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:32:58.337","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:32:58.337","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:32:58.337","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:34:41.617","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:34:41.617","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:34:41.617","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:36:56.053","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:36:56.054","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:36:56.054","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:37:25.259","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:37:25.259","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:37:25.259","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:38:46.373","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:38:46.374","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:38:46.374","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:39:25.570","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:39:25.571","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:39:25.571","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:41:02.523","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:41:02.524","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:41:02.524","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:41:13.796","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:41:13.796","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:41:13.796","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:42:34.478","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:42:34.479","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:42:34.479","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 14:43:30.332","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 14:43:30.333","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 14:43:30.333","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:03:05.525","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:03:05.525","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:03:05.525","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:05:54.403","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:05:54.404","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:05:54.404","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:06:44.837","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:06:44.837","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:06:44.837","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:07:31.504","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:07:31.505","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:07:31.505","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:08:48.480","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:08:48.481","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:08:48.481","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:10:38.497","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:10:38.497","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:10:38.497","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:12:42.899","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:12:42.899","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:12:42.899","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:13:11.762","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:13:11.763","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:13:11.763","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:14:40.276","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:14:40.276","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:14:40.276","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:15:46.856","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:15:46.856","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:15:46.856","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:16:15.573","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:16:15.574","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:16:15.574","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:17:27.066","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:17:27.067","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:17:27.067","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:18:40.505","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:18:40.505","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:18:40.505","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:19:52.086","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:19:52.086","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:19:52.086","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:20:16.823","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:20:16.824","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:20:16.824","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:20:43.498","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:20:43.498","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:20:43.498","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:21:06.526","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:21:06.527","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:21:06.527","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:22:36.779","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:22:36.780","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:22:36.780","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:23:11.044","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:23:11.045","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:23:11.045","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:24:09.984","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:24:09.984","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:24:09.984","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:26:04.102","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:26:04.103","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:26:04.103","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:32:06.115","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:32:06.116","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:32:06.116","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:41:58.558","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:41:58.559","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:41:58.559","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:42:36.574","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:42:36.575","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:42:36.575","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:53:18.559","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:53:18.560","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:53:18.560","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 15:56:09.228","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 15:56:09.229","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 15:56:09.229","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"ERROR","timestamp":"2022-05-07 19:08:00.991","file":"store/mysql.go:49","msg":"数据库连接失败.Database Name: checkin","data":{"error":"Error 1045: Access denied for user 'root'@'localhost' (using password: YES)"}} +{"level":"INFO","timestamp":"2022-05-07 19:08:01.008","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:08:01.008","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:08:01.008","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8000"} +{"level":"ERROR","timestamp":"2022-05-07 19:08:45.480","file":"store/mysql.go:49","msg":"数据库连接失败.Database Name: checkin","data":{"error":"Error 1045: Access denied for user 'root'@'localhost' (using password: YES)"}} +{"level":"INFO","timestamp":"2022-05-07 19:08:45.989","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:08:45.990","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:08:45.990","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8000"} +{"level":"INFO","timestamp":"2022-05-07 19:09:03.132","file":"config/config.go:55","msg":"配置文件已更改: E:\\小组学习\\项目\\qiandaoxitong\\conf\\config.yaml"} +{"level":"INFO","timestamp":"2022-05-07 19:09:03.132","file":"config/config.go:55","msg":"配置文件已更改: E:\\小组学习\\项目\\qiandaoxitong\\conf\\config.yaml"} +{"level":"INFO","timestamp":"2022-05-07 19:09:06.837","file":"config/config.go:55","msg":"配置文件已更改: E:\\小组学习\\项目\\qiandaoxitong\\conf\\config.yaml"} +{"level":"INFO","timestamp":"2022-05-07 19:09:06.837","file":"config/config.go:55","msg":"配置文件已更改: E:\\小组学习\\项目\\qiandaoxitong\\conf\\config.yaml"} +{"level":"INFO","timestamp":"2022-05-07 19:09:27.020","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:09:27.020","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:09:27.020","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:12:39.745","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:12:39.745","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:12:39.745","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:14:53.774","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:14:53.774","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:14:53.774","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:17:38.138","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:17:38.140","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:17:38.140","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:20:02.471","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:20:02.472","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:20:02.472","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:20:35.304","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:20:35.304","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:20:35.304","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:21:33.942","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:21:33.942","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:21:33.942","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 19:22:12.918","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 19:22:12.919","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 19:22:12.919","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 20:13:18.565","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 20:13:18.576","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 20:13:18.577","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 20:14:46.237","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 20:14:46.237","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 20:14:46.237","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} +{"level":"INFO","timestamp":"2022-05-07 20:16:18.322","file":"sd/healthcheck.go:25","msg":"路由正常"} +{"level":"INFO","timestamp":"2022-05-07 20:16:18.322","file":"qiandaoxitong/main.go:44","msg":"路由启动成功."} +{"level":"INFO","timestamp":"2022-05-07 20:16:18.322","file":"qiandaoxitong/main.go:45","msg":"开始监听 http 地址上的传入请求: :8080"} diff --git a/pkg/app/code.go b/pkg/app/code.go index a6ec1d33f9f22ea60dd4fa259e064eac42ba058e..5d144a009ad67c536f3a8c024369cba0509a4002 100644 --- a/pkg/app/code.go +++ b/pkg/app/code.go @@ -6,11 +6,16 @@ var ( InternalServerError = &Errno{Code: 500, Message: "服务器异常."} ErrBind = &Errno{Code: 10002, Message: "将请求正文绑定到结构时发生错误."} - ErrParamNull = &Errno{Code: 11001, Message: "参数结果为空"} + + ErrParamNull = &Errno{Code: 11001,Message: "参数结果为空"} + + // 用户错误 - ErrEncrypt = &Errno{Code: 20101, Message: "加密用户密码时出错"} - ErrPhoneExist = &Errno{Code: 20102, Message: "手机号已被注册"} + ErrEncrypt = &Errno{Code: 20101, Message: "加密用户密码时出错"} + ErrPhoneExist = &Errno{Code: 20102, Message: "手机号已被注册"} + ErrUserNotExist = &Errno{Code: 11002,Message: "用户不存在"} // 班级错误 ErrClassExist = &Errno{Code: 20201, Message: "班级已存在,不能重复创建"} + ErrClassNotExist = &Errno{Code:11003,Message: "班级不存在"} ) diff --git a/router/router.go b/router/router.go index a89c0c78714b03d19cc0c246f32bd84b0497930f..6205d3b474c8815e1cf0c0d6b594d28c3799b06b 100644 --- a/router/router.go +++ b/router/router.go @@ -3,8 +3,8 @@ package router import ( "github.com/gin-gonic/gin" "net/http" - "qiandao/controller/lesson" + "qiandao/controller/class" "qiandao/controller/sd" "qiandao/controller/user" @@ -35,15 +35,6 @@ func Load(engine *gin.Engine, handlerFunc ...gin.HandlerFunc) *gin.Engine { classAPI.GET("", class.GetAllClass) } - // 检查http健康的路由组 - svcd := engine.Group("/api/sd") - { - svcd.GET("/health", sd.HealthCheck) - svcd.GET("/disk", sd.DiskCheck) - svcd.GET("/cpu", sd.CPUCheck) - svcd.GET("/ram", sd.RAMCheck) - } - // 课程 lessonApi := engine.Group("/api/lesson") { @@ -51,8 +42,18 @@ func Load(engine *gin.Engine, handlerFunc ...gin.HandlerFunc) *gin.Engine { lessonApi.POST("",lesson.CreateLesson) // 获取创建的课程列表 lessonApi.GET("/user",lesson.GetCreateLessonList) - //获取加入的课程列表 + //获取加入的课程列表 lessonApi.GET("/join",lesson.GetJoinLessonList) } + + // 检查http健康的路由组 + svcd := engine.Group("/api/sd") + { + svcd.GET("/health", sd.HealthCheck) + svcd.GET("/disk", sd.DiskCheck) + svcd.GET("/cpu", sd.CPUCheck) + svcd.GET("/ram", sd.RAMCheck) + } + return engine } diff --git a/service/lessonService.go b/service/lessonService.go index 98e73646f3d615ac305e01f2ee97173321e40411..8c43efafd7ad1ec4ecf566e22b4a536978d37e2b 100644 --- a/service/lessonService.go +++ b/service/lessonService.go @@ -1,6 +1,7 @@ package service import ( + "errors" "qiandao/model" "qiandao/pkg/util" "qiandao/store" @@ -9,8 +10,10 @@ import ( // CreateLesson 创建课程 func CreateLesson(lessonParam *viewmodel.Lesson) error{ - // 事务处理 - + // 1.当前创建者的课程名不能重复 + _,ok := store.LessonIsExist(lessonParam);if ok{ + return errors.New("课程名称重复,不可创建") + } // 处理课程表实体并加入数据库 lesson := &model.Lesson{ LessonID:util.GetUUID(), @@ -37,3 +40,21 @@ func CreateLesson(lessonParam *viewmodel.Lesson) error{ } return nil } + +// GetCreateLessonList 获取当前用户创建的所有课程 +func GetCreateLessonList(userId string)(lessonList []*viewmodel.ListObj,err error) { + // 根据userId查询数据库,获取相应的数据 + lessonList,_ = store.GetLessonList(userId) + if err != nil { + return nil,err + } + return lessonList,err +} + +func GetJoinLessonList(classId string)(lessonList []*viewmodel.ListObj,err error) { + lessonList,err = store.GetJoinLessonList(classId) + if err != nil { + return nil,err + } + return lessonList,err +} \ No newline at end of file diff --git a/store/lesson.go b/store/lesson.go new file mode 100644 index 0000000000000000000000000000000000000000..5723eef7ce1a990a07d74dea9dcaacf19144e579 --- /dev/null +++ b/store/lesson.go @@ -0,0 +1,120 @@ +package store + +import ( + "qiandao/model" + "qiandao/viewmodel" +) + +// InsertLesson 插入课程信息 +func InsertLesson(lesson *model.Lesson, classLesson []model.ClassLesson) error { + tx := DB.Self.Begin() + err := tx.Create(&lesson).Error;if err != nil{ + tx.Rollback() + return err + } + for _, v := range classLesson{ + err = tx.Create(&v).Error;if err != nil{ + tx.Rollback() + return err + } + } + tx.Commit() + return err +} + + +// GetLessonList 获取课程列表 +func GetLessonList(userId string) ([]*viewmodel.ListObj,error){ + // 返回给前端的最终结果集 + var res []*viewmodel.ListObj + // 获取课程信息:课程名、创建时间 + lesson := make([]*model.Lesson,0) + // 存储每个课程对应的班级 + var lessonClass = make(map[string][]string) + // 班级实体 + classEntity := make([]viewmodel.ClassObj,0) + + // 查询数据库,获取课程信息,存入lesson + err := DB.Self.Table("lesson").Select([]string{`lesson_id`,`lesson_name`,`created_at`}).Where("lesson_creator = ? ",userId).Find(&lesson).Error + if err != nil{ + return nil,err + } + + // 获取每个课程对应的班级,存入lessonClass + for _,v := range lesson { + // 查询数据库,根据上述查询的课程id获取班级名称。 + err = DB.Self.Table("class").Select([]string{`class_name`,`class.class_id`}).Joins("inner join class_lesson on class.class_id = class_lesson.class_id"). + Where("lesson_id = ?",v.LessonID).Find(&classEntity).Error + if err != nil{ + return nil,err + } + // 存储每个课程对应的班级 + var tmp []string + for _,v1 := range classEntity{ + tmp = append(tmp,v1.ClassName) + } + lessonClass[v.LessonID] = tmp + } + // 存入最终结果集 + for _,v := range lesson{ + val := &viewmodel.ListObj{ + LessonName: v.LessonName, + CreatedAt: v.CreatedAt, + ClassName: lessonClass[v.LessonID], + } + res = append(res,val) + } + return res,err +} + +// LessonIsExist 查询当前用户是否创建重复的课程 +func LessonIsExist(lessonParam *viewmodel.Lesson)(err error,ok bool) { + var lesson model.Lesson + err = DB.Self.Select(`lesson_name`).Where("lesson_creator = ?",lessonParam.LessonCreator).Find(&lesson).Error + if err != nil { + return err,false + } + return err,lesson.LessonName == lessonParam.LessonName +} + +func GetJoinLessonList(classId string) ([]*viewmodel.ListObj,error) { + // 返回结果 + var resListObj []*viewmodel.ListObj + // 创建课程实体 + var lesson []model.Lesson + // 存入每个课堂对应的班级 + classLessonMap := make(map[string][]string) + // 创建班级实体 + var classLesson []viewmodel.ClassObj + // 根据中间表关联查询到当前班级加入的课堂 + err := DB.Self.Table("class_lesson").Select([]string{`lesson.lesson_name`,`lesson.created_at`,`lesson.lesson_id`}). + Joins("inner join lesson on lesson.lesson_id = class_lesson.lesson_id"). + Joins("inner join class on class.class_id = class_lesson.class_id").Where("class_lesson.class_id = ?",classId).Find(&lesson).Error + if err != nil { + return nil,err + } + // 根据查询出的课堂id,去反查询,得到加入该课堂的相应班级 + for _,v := range lesson{ + err = DB.Self.Table("class").Select([]string{`class_name`}).Joins("inner join class_lesson on class.class_id = class_lesson.class_id"). + Where("class_lesson.lesson_id = ?",v.LessonID).Find(&classLesson).Error + if err != nil { + return nil,err + } + var tmp []string + for _,v1 := range classLesson{ + tmp = append(tmp,v1.ClassName) + } + classLessonMap[v.LessonID] = tmp + } + for _,v := range lesson{ + vobj := &viewmodel.ListObj{ + LessonName: v.LessonName, + CreatedAt: v.CreatedAt, + ClassName: classLessonMap[v.LessonID], + + } + resListObj = append(resListObj,vobj) + } + return resListObj,err +} + diff --git a/store/lessonDao.go b/store/lessonDao.go deleted file mode 100644 index 0edd5ca8ff3de4a13a368324afeb1514c8cfe366..0000000000000000000000000000000000000000 --- a/store/lessonDao.go +++ /dev/null @@ -1,19 +0,0 @@ -package store - -import ( - "qiandao/model" -) - -// InsertLesson 插入课程信息 -func InsertLesson(lesson *model.Lesson, classLesson []model.ClassLesson) error { - err := DB.Self.Create(&lesson).Error;if err != nil{ - return err - } - - for _, v := range classLesson{ - err = DB.Self.Create(&v).Error;if err != nil{ - return err - } - } - return err -} diff --git a/viewmodel/lesson.go b/viewmodel/lesson.go index 07c8b46f72a53c79c6de744493332dfb248c59a4..3d93576dbba620dd5343df0dc672aacb44e7d8e6 100644 --- a/viewmodel/lesson.go +++ b/viewmodel/lesson.go @@ -1,7 +1,23 @@ package viewmodel +import "time" + type Lesson struct { - LessonName string `json:"lesson_name"` // 课程名称 - LessonCreator string `json:"user_id"` // 课程发起者 - ClassList []string `json:"class_list"` // 班级id列表 + LessonName string `json:"lesson_name"` // 课程名称 + LessonCreator string `json:"user_id"` // 课程发起者 + ClassList []string `json:"class_list"` // 班级id列表 +} + +type ListObj struct { + LessonName string `json:"lesson_name"` // 课程名称 + CreatedAt time.Time `json:"created_at"` // 创建时间 + ClassName []string `json:"class_name_list"` // 课程名称列表 +} + +type ClassObj struct { + ClassName string `json:"class_name"` // 班级名 + ClassId string `json:"class_id"` // 班级id } + + +