|
@@ -1,8 +1,8 @@
|
|
|
package handler
|
|
|
|
|
|
import (
|
|
|
- webServerEntity "cicv-data-closedloop/amd64/web_server/entity"
|
|
|
- "cicv-data-closedloop/amd64/web_server/infra"
|
|
|
+ webServerEntity "cicv-data-closedloop/amd64/score_server/entity"
|
|
|
+ "cicv-data-closedloop/amd64/score_server/infra"
|
|
|
"cicv-data-closedloop/common/config/c_db"
|
|
|
"cicv-data-closedloop/common/config/c_log"
|
|
|
commonEntity "cicv-data-closedloop/common/entity"
|
|
@@ -207,100 +207,7 @@ func ExamEndTicker() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//// 考试开始时间
|
|
|
-//func Begin(c *gin.Context) {
|
|
|
-// param := new(webServerEntity.ExamPao)
|
|
|
-// // 映射到结构体
|
|
|
-// if err := c.ShouldBindJSON(¶m); err != nil {
|
|
|
-// c_log.GlobalLogger.Error("项目启动接收请求参数报错:", err)
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "请求体解析失败。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// // 插入到数据库
|
|
|
-// sqlTemplate, _ := util.ReadFile(c_db.SqlFilesMap["exam-insert-begin_time-by-team_name.sql"])
|
|
|
-// c_log.GlobalLogger.Info("插入比赛开始时间", sqlTemplate)
|
|
|
-// if err := c_db.DoTx(sqlTemplate, []any{
|
|
|
-// param.TeamName,
|
|
|
-// time.Now(),
|
|
|
-// }); err != nil {
|
|
|
-// c_log.GlobalLogger.Error("插入数据报错:", err)
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "插入数据报错。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// c.JSON(http.StatusOK, commonEntity.Response{
|
|
|
-// Code: 200,
|
|
|
-// Msg: "插入数据成功。",
|
|
|
-// })
|
|
|
-//}
|
|
|
-//
|
|
|
-//// 考试结束时间
|
|
|
-//func End(c *gin.Context) {
|
|
|
-// param := new(webServerEntity.ExamPao)
|
|
|
-// // 映射到结构体
|
|
|
-// if err := c.ShouldBindJSON(¶m); err != nil {
|
|
|
-// c_log.GlobalLogger.Error("接收请求参数报错:", err)
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "请求体解析失败。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// // 1 查询指定队伍的开始时间最新的考试是否有结束时间,如果有则不在处理,如果没有则更新
|
|
|
-// var result []webServerEntity.ExamPo
|
|
|
-// selectSql, err := util.ReadFile(c_db.SqlFilesMap["exam-select-latest-by-team_name.sql"])
|
|
|
-// if err != nil {
|
|
|
-// c_log.GlobalLogger.Error("读取sql文件报错:", err)
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "读取sql文件报错。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// // 可以传参数
|
|
|
-// if err = c_db.MysqlDb.Select(&result, selectSql, param.TeamName); err != nil {
|
|
|
-// c_log.GlobalLogger.Error("数据库查询报错:", err)
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "数据库查询报错。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// c_log.GlobalLogger.Info("数据库查询成功:", result)
|
|
|
-// if !result[0].EndTime.Equal(defaultTime) {
|
|
|
-// c_log.GlobalLogger.Error("赛队", param.TeamName, "重复请求考试结束接口!")
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "重复请求。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// // 更新到数据库
|
|
|
-// sqlTemplate, _ := util.ReadFile(c_db.SqlFilesMap["exam-update-end_time-by-team_name.sql"])
|
|
|
-// if err := c_db.DoTx(sqlTemplate, []any{
|
|
|
-// time.Now(),
|
|
|
-// param.TeamName,
|
|
|
-// }); err != nil {
|
|
|
-// c_log.GlobalLogger.Error("插入数据报错:", err)
|
|
|
-// c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
|
-// Code: 500,
|
|
|
-// Msg: "插入数据报错。",
|
|
|
-// })
|
|
|
-// return
|
|
|
-// }
|
|
|
-// c.JSON(http.StatusOK, commonEntity.Response{
|
|
|
-// Code: 200,
|
|
|
-// Msg: "插入数据成功。",
|
|
|
-// })
|
|
|
-//}
|
|
|
-
|
|
|
-// 分页查询
|
|
|
-// 如果日期为默认值,则返回空""
|
|
|
+// 分页查询,如果日期为默认值,则返回空""
|
|
|
func Page(c *gin.Context) {
|
|
|
param := new(webServerEntity.ExamPagePao)
|
|
|
_ = c.ShouldBindJSON(¶m)
|
|
@@ -756,3 +663,8 @@ func Report(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 云控展示线上评分
|
|
|
+func Display(c *gin.Context) {
|
|
|
+
|
|
|
+}
|