LingxinMeng 1 vuosi sitten
vanhempi
commit
3c74976096

+ 0 - 21
amd64/web_server/application.yaml

@@ -1,21 +0,0 @@
-application-name: web_server
-web:
-  port: 12341
-  route-prefix: /web_server
-  token: U9yKpD6kZZDDe4LFKK6myAxBUT1XRrDM
-  white-list:
-    - "/web_server/swagger"
-log:
-  dir: ./log/
-  prefix: web_server
-mysql:
-#  ip: 36.110.106.156 # 公网IP
-#  sqlfile-dir: D:\code\cicv-data-closedloop\amd64\web_server\sql
-  ip: 10.14.85.241 # 内网IP
-  sqlfile-dir: /root/cicv-data-closedloop/amd64/web_server/sql
-  port: 3306
-  username: root
-  password: 1qaz2wsx!
-  dbname: dataclosedloop
-  charset: utf8
-

+ 19 - 0
amd64/web_server/entity/e_exam.go

@@ -49,3 +49,22 @@ type ExamReportPao struct {
 	BeginTime  string `json:"beginTime"`
 	EndTime    string `json:"endTime"`
 }
+
+/*
+	{
+	  "TotalScore": 10,
+	  "SceneName": "在场景“路段-障碍物识别与响应",
+	  "DeductedScore": 0,
+	  "Reason": "",
+	  "BeginTime": 1715389830.1170852,
+	  "EndTime": 1715389842.4866548
+	},
+*/
+type DetailsDto struct {
+	TotalScore    float64 `json:"TotalScore"`
+	SceneName     string  `json:"SceneName"`
+	DeductedScore float64 `json:"DeductedScore"`
+	Reason        string  `json:"Reason"`
+	BeginTime     float64 `json:"BeginTime"`
+	EndTime       float64 `json:"EndTime"`
+}

+ 108 - 71
amd64/web_server/handler/h_exam.go

@@ -2,10 +2,12 @@ package handler
 
 import (
 	webServerEntity "cicv-data-closedloop/amd64/web_server/entity"
+	"cicv-data-closedloop/amd64/web_server/infra"
 	"cicv-data-closedloop/common/config/c_db"
 	"cicv-data-closedloop/common/config/c_log"
 	commonEntity "cicv-data-closedloop/common/entity"
 	"cicv-data-closedloop/common/util"
+	"encoding/json"
 	"fmt"
 	"github.com/gin-gonic/gin"
 	"github.com/signintech/gopdf"
@@ -26,9 +28,8 @@ var (
 	heartBeatTimeThreshold = 5 * time.Second // 心跳时间
 	InitialPositionX       = 456292.00       // todo 需要比赛确认起点
 	InitialPositionY       = 4397957.00      // todo 需要比赛确认起点
-	// todo 比赛阶段
-	trialBegin = time.Date(2024, time.June, 16, 13, 00, 00, 0, time.Local)
-	trialEnd   = time.Date(2024, time.June, 19, 23, 59, 59, 0, time.Local)
+	trialBegin             = time.Date(2024, time.June, 16, 13, 00, 00, 0, time.Local)
+	trialEnd               = time.Date(2024, time.June, 19, 23, 59, 59, 0, time.Local)
 )
 
 // 考试心跳
@@ -280,7 +281,7 @@ func End(c *gin.Context) {
 }
 
 // 分页查询
-// todo 如果日期为默认值,则返回空""
+// 如果日期为默认值,则返回空""
 func Page(c *gin.Context) {
 	param := new(webServerEntity.ExamPagePao)
 	_ = c.ShouldBindJSON(&param)
@@ -357,6 +358,31 @@ func Report(c *gin.Context) {
 		})
 		return
 	}
+	// 查询打分详情
+	var detailsResult []string
+	selectSql, err := util.ReadFile(c_db.SqlFilesMap["exam-select-details-by-id.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(&detailsResult, selectSql, param.Id); err != nil {
+		c_log.GlobalLogger.Error("数据库查询报错:", err)
+		c.JSON(http.StatusBadRequest, commonEntity.Response{
+			Code: 500,
+			Msg:  "数据库查询报错。",
+		})
+		return
+	}
+	details := detailsResult[0]
+	// 解析详情为数组
+	var detailsDtos []webServerEntity.DetailsDto
+	_ = json.Unmarshal([]byte(details), &detailsDtos)
+
 	layout := "2006-01-02 15:04:05"
 	beginTime, _ := time.Parse(layout, param.BeginTime)
 	endTime, _ := time.Parse(layout, param.EndTime)
@@ -368,7 +394,7 @@ func Report(c *gin.Context) {
 		pdf := gopdf.GoPdf{}
 		pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
 		// 添加字体文件到pdf
-		err := pdf.AddTTFFont("simfang", "D:\\code\\cicv-data-closedloop\\amd64\\web_server\\simfang.ttf")
+		err := pdf.AddTTFFont("simfang", infra.ApplicationYaml.Pdf.Ttf)
 		if err != nil {
 			log.Print(err.Error())
 			return
@@ -388,8 +414,8 @@ func Report(c *gin.Context) {
 		pdf.AddPage()
 		{
 			err = pdf.SetFont("simfang", "", 36)
-			err = pdf.Image("D:\\code\\cicv-data-closedloop\\amd64\\web_server\\background.png", 0, 0, nil) // 背景图片
-			err = pdf.Image("D:\\code\\cicv-data-closedloop\\amd64\\web_server\\logo.png", 20, 20, &gopdf.Rect{W: 320, H: 100})
+			err = pdf.Image(infra.ApplicationYaml.Pdf.BackgroundPng, 0, 0, nil) // 背景图片
+			err = pdf.Image(infra.ApplicationYaml.Pdf.LogoPng, 20, 20, &gopdf.Rect{W: 320, H: 100})
 			{
 				pdf.SetXY(100, 250)
 				_ = pdf.Text("车路云一体化算法挑战赛")
@@ -505,8 +531,11 @@ func Report(c *gin.Context) {
 			}
 			// 2. 分数详情
 			{
-				columnNumber := 4.0                         // 列数
-				tableCellWidth := tableWidth / columnNumber // 单元格宽度
+				//columnNumber := 4.0                         // 列数
+				//tableCellWidth := tableWidth / columnNumber // 单元格宽度
+				tableCellWidth1 := 50.0
+				tableCellWidth2 := 300.0
+				tableCellWidth3 := 70.0
 				{
 					pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
 					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "2. 分数详情", alignOptionText)
@@ -516,39 +545,31 @@ func Report(c *gin.Context) {
 				{
 					{
 						pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "序号", alignOptionTable)
-					}
-					{
-						pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
-						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "场景名称", alignOptionTable)
+						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth1, H: lineHeight}, "序号", alignOptionTable)
 					}
 					{
-						pdf.SetXY(leftMargin+2.0*tableCellWidth, topMargin+currentLine*lineHeight)
-						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "线上得分", alignOptionTable)
+						pdf.SetXY(leftMargin+tableCellWidth1, topMargin+currentLine*lineHeight)
+						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth2, H: lineHeight}, "场景名称", alignOptionTable)
 					}
 					{
-						pdf.SetXY(leftMargin+3.0*tableCellWidth, topMargin+currentLine*lineHeight)
-						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "线下得分", alignOptionTable)
+						pdf.SetXY(leftMargin+tableCellWidth1+tableCellWidth2, topMargin+currentLine*lineHeight)
+						_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth3, H: lineHeight}, "线上得分", alignOptionTable)
 					}
 					currentLine++
 				}
-				for i := 0; i < 10; i++ {
+				for i := 0; i < len(detailsDtos); i++ {
 					{
 						{
 							pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, util.ToString(i+1), alignOptionTable)
+							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth1, H: lineHeight}, util.ToString(i+1), alignOptionTable)
 						}
 						{
-							pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
-							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
+							pdf.SetXY(leftMargin+tableCellWidth1, topMargin+currentLine*lineHeight)
+							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth2, H: lineHeight}, detailsDtos[i].SceneName, alignOptionTable)
 						}
 						{
-							pdf.SetXY(leftMargin+2.0*tableCellWidth, topMargin+currentLine*lineHeight)
-							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
-						}
-						{
-							pdf.SetXY(leftMargin+3.0*tableCellWidth, topMargin+currentLine*lineHeight)
-							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
+							pdf.SetXY(leftMargin+tableCellWidth1+tableCellWidth2, topMargin+currentLine*lineHeight)
+							_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth3, H: lineHeight}, util.ToString(detailsDtos[i].TotalScore+detailsDtos[i].DeductedScore), alignOptionTable)
 						}
 						currentLine++
 					}
@@ -557,66 +578,82 @@ func Report(c *gin.Context) {
 			}
 		}
 		// ------- 详情页 第二页 -------
+		var detailsDtos2 []webServerEntity.DetailsDto // 扣分的场景
+		for _, detailsDto := range detailsDtos {
+			if detailsDto.Reason != "" {
+				detailsDtos2 = append(detailsDtos2, detailsDto)
+			}
+		}
+		size := len(detailsDtos2)
 		{
 			pdf.AddPage()
 			currentLine := 0.0
 			// 3. 线上扣分详情
 			{
-				columnNumber := 3.0                         // 列数
-				tableCellWidth := tableWidth / columnNumber // 单元格宽度
+				//columnNumber := 3.0                         // 列数
+				//tableCellWidth := tableWidth / columnNumber // 单元格宽度
+				tableCellWidth := 450.0 // 单元格宽度
 				{
 					pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
 					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "3. 线上扣分详情", alignOptionText)
 					currentLine++
 				}
-				for i := 0; i < 5; i++ {
+				for i := 0; i < 8; i++ {
 					// 场景1
 					{
 						{
 							pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-							_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "("+util.ToString(i+1)+")xxxx场景", alignOptionText)
+							_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "("+util.ToString(i+1)+")"+detailsDtos2[i].SceneName, alignOptionText)
 							currentLine++
 						}
 						// 场景1 表格
 						{
+							//{
+							//	pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+							//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "序号", alignOptionTable)
+							//}
+							//{
+							//	pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
+							//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "扣分点", alignOptionTable)
+							//}
 							{
 								pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "序号", alignOptionTable)
-							}
-							{
-								pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
-								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "扣分点", alignOptionTable)
-							}
-							{
-								pdf.SetXY(leftMargin+2.0*tableCellWidth, topMargin+currentLine*lineHeight)
 								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "扣分说明", alignOptionTable)
 							}
 							currentLine++
 						}
-						for j := 0; j < 2; j++ {
+						//for j := 0; j < 1; j++ {
+						{
+							//{
+							//	pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+							//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, util.ToString(j+1), alignOptionTable)
+							//}
+							//{
+							//	pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
+							//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
+							//}
 							{
-								{
-									pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-									_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, util.ToString(j+1), alignOptionTable)
-								}
-								{
-									pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
-									_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
-								}
-								{
-									pdf.SetXY(leftMargin+2.0*tableCellWidth, topMargin+currentLine*lineHeight)
-									_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
-								}
-								currentLine++
+								pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, detailsDtos2[i].Reason, alignOptionTable)
 							}
+							currentLine++
 						}
+						//}
 					}
 				}
 			}
+			//if size <= 8 {
+			//	// 4 作品优化建议
+			//	{
+			//		pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+			//		_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "4. 作品优化建议", alignOptionText)
+			//		currentLine++
+			//	}
+			//}
 		}
 		// ------- 详情页 第三页 -------
-		size := 10
-		if size > 5 {
+
+		if size > 8 {
 			pdf.AddPage()
 			currentLine := 0.0
 			// 3. 线上扣分详情
@@ -667,22 +704,22 @@ func Report(c *gin.Context) {
 					}
 				}
 			}
-			// 4 作品优化建议
-			{
-				pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-				_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "4. 作品优化建议", alignOptionText)
-				currentLine++
-			}
+			//// 4 作品优化建议
+			//{
+			//	pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+			//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "4. 作品优化建议", alignOptionText)
+			//	currentLine++
+			//}
 		}
-		// ------- 附录页 -------
-		pdf.AddPage()
-		{
-			pdf.SetXY(leftMargin, topMargin)
-			_ = pdf.Text("附件:评分规则")
-			pdf.AddExternalLink("https://www.baidu.com/", leftMargin, topMargin-lineHeight, 6*14, lineHeight)
-		}
-		// 写入本地
-		pdf.WritePdf("D:\\hello.pdf")
+		//// ------- 附录页 -------
+		//pdf.AddPage()
+		//{
+		//	pdf.SetXY(leftMargin, topMargin)
+		//	_ = pdf.Text("附件:评分规则")
+		//	pdf.AddExternalLink("https://www.baidu.com/", leftMargin, topMargin-lineHeight, 6*14, lineHeight)
+		//}
+		//// 写入本地
+		//pdf.WritePdf("D:\\hello.pdf")
 	}
 
 	// 打开要发送的文件

+ 25 - 0
amd64/web_server/infra/application.yaml

@@ -0,0 +1,25 @@
+application-name: web_server
+web:
+  port: 12341
+  route-prefix: /web_server
+  token: U9yKpD6kZZDDe4LFKK6myAxBUT1XRrDM
+  white-list:
+    - "/web_server/swagger"
+log:
+  dir: ./log/
+  prefix: web_server
+mysql:
+  ip: 36.110.106.156 # 公网IP
+  sqlfile-dir: D:\code\cicv-data-closedloop\amd64\web_server\sql
+#  ip: 10.14.85.241 # 内网IP
+#  sqlfile-dir: /root/cicv-data-closedloop/amd64/web_server/sql
+  port: 3306
+  username: root
+  password: 1qaz2wsx!
+  dbname: dataclosedloop
+  charset: utf8
+
+pdf:
+  ttf: D:\code\cicv-data-closedloop\amd64\web_server\simfang.ttf
+  background-png: D:\code\cicv-data-closedloop\amd64\web_server\background.png
+  logo-png: D:\code\cicv-data-closedloop\amd64\web_server\logo.png

+ 46 - 0
amd64/web_server/infra/i_application.go

@@ -0,0 +1,46 @@
+package infra
+
+import (
+	_ "embed"
+	"fmt"
+	"gopkg.in/yaml.v2"
+)
+
+type ApplicationYamlStruct struct {
+	ApplicationName string `yaml:"application"`
+	Web             struct {
+		Port        string   `yaml:"port"`
+		RoutePrefix string   `yaml:"route-prefix"`
+		Token       string   `yaml:"token"`
+		WhiteList   []string `yaml:"white-list"`
+	} `yaml:"web"`
+	Log struct {
+		Dir    string `yaml:"dir"`
+		Prefix string `yaml:"prefix"`
+	} `yaml:"log"`
+	Mysql struct {
+		Ip         string `yaml:"ip"`
+		Port       string `yaml:"port"`
+		Username   string `yaml:"username"`
+		Password   string `yaml:"password"`
+		Dbname     string `yaml:"dbname"`
+		Charset    string `yaml:"charset"`
+		SqlfileDir string `yaml:"sqlfile-dir"`
+	} `yaml:"mysql"`
+	Pdf struct {
+		Ttf           string `yaml:"ttf"`
+		BackgroundPng string `yaml:"background-png"`
+		LogoPng       string `yaml:"logo-png"`
+	} `yaml:"pdf"`
+}
+
+var (
+	//go:embed application.yaml
+	applicationYamlBytes []byte
+	ApplicationYaml      ApplicationYamlStruct
+)
+
+func InitApplication() {
+	_ = yaml.Unmarshal(applicationYamlBytes, &ApplicationYaml)
+	fmt.Println("加载配置文件内容为:", ApplicationYaml)
+}

+ 18 - 48
amd64/web_server/main.go

@@ -2,73 +2,43 @@ package main
 
 import (
 	"cicv-data-closedloop/amd64/web_server/handler"
+	"cicv-data-closedloop/amd64/web_server/infra"
 	"cicv-data-closedloop/common/config/c_db"
 	"cicv-data-closedloop/common/config/c_log"
 	"cicv-data-closedloop/common/gin/middleware"
 	_ "embed"
 	"github.com/gin-gonic/gin"
-	"gopkg.in/yaml.v2"
 	_ "gopkg.in/yaml.v3"
 	"os"
 )
 
-type ApplicationYamlStruct struct {
-	ApplicationName string `yaml:"application"`
-	Web             struct {
-		Port        string   `yaml:"port"`
-		RoutePrefix string   `yaml:"route-prefix"`
-		Token       string   `yaml:"token"`
-		WhiteList   []string `yaml:"white-list"`
-	} `yaml:"web"`
-	Log struct {
-		Dir    string `yaml:"dir"`
-		Prefix string `yaml:"prefix"`
-	} `yaml:"log"`
-	Mysql struct {
-		Ip         string `yaml:"ip"`
-		Port       string `yaml:"port"`
-		Username   string `yaml:"username"`
-		Password   string `yaml:"password"`
-		Dbname     string `yaml:"dbname"`
-		Charset    string `yaml:"charset"`
-		SqlfileDir string `yaml:"sqlfile-dir"`
-	} `yaml:"mysql"`
-}
-
-var (
-	//go:embed application.yaml
-	applicationYamlBytes []byte
-	ApplicationYaml      ApplicationYamlStruct
-)
-
 func init() {
-	// 解析YAML内容
-	_ = yaml.Unmarshal(applicationYamlBytes, &ApplicationYaml)
+	infra.InitApplication()
 	c_log.InitLog(
-		ApplicationYaml.Log.Dir,
-		ApplicationYaml.Log.Prefix,
+		infra.ApplicationYaml.Log.Dir,
+		infra.ApplicationYaml.Log.Prefix,
 	)
 	c_db.InitSqlxMysql(
-		ApplicationYaml.Mysql.Username,
-		ApplicationYaml.Mysql.Password,
-		ApplicationYaml.Mysql.Ip,
-		ApplicationYaml.Mysql.Port,
-		ApplicationYaml.Mysql.Dbname,
-		ApplicationYaml.Mysql.Charset,
+		infra.ApplicationYaml.Mysql.Username,
+		infra.ApplicationYaml.Mysql.Password,
+		infra.ApplicationYaml.Mysql.Ip,
+		infra.ApplicationYaml.Mysql.Port,
+		infra.ApplicationYaml.Mysql.Dbname,
+		infra.ApplicationYaml.Mysql.Charset,
 	)
-	c_db.InitSqlFilesMap(ApplicationYaml.Mysql.SqlfileDir)
+	c_db.InitSqlFilesMap(infra.ApplicationYaml.Mysql.SqlfileDir)
 }
 
 func main() {
-	c_log.GlobalLogger.Info("配置文件为:", ApplicationYaml)
+	c_log.GlobalLogger.Info("配置文件为:", infra.ApplicationYaml)
 	// 创建 gin 实例
 	router := gin.Default()
 	// 使用中间件
-	router.Use(middleware.Cors())                                                                    // 解决cors
-	router.Use(middleware.LogRequest())                                                              // 请求日志打印
-	router.Use(middleware.ValidateHeaders(ApplicationYaml.Web.WhiteList, ApplicationYaml.Web.Token)) // 全局请求头校验
+	router.Use(middleware.Cors())                                                                                // 解决cors
+	router.Use(middleware.LogRequest())                                                                          // 请求日志打印
+	router.Use(middleware.ValidateHeaders(infra.ApplicationYaml.Web.WhiteList, infra.ApplicationYaml.Web.Token)) // 全局请求头校验
 	// 通过路由组设置全局前缀
-	projectPrefix := router.Group(ApplicationYaml.Web.RoutePrefix)
+	projectPrefix := router.Group(infra.ApplicationYaml.Web.RoutePrefix)
 	examPrefix := projectPrefix.Group("/exam")
 	examPrefix.POST("/tick", handler.Tick)     // 考试开始
 	go handler.ExamEndTicker()                 // 考试结束
@@ -79,9 +49,9 @@ func main() {
 	monitorPrefix := projectPrefix.Group("/monitor")
 	monitorPrefix.POST("/insert", handler.SaveDeviceMonitor)
 	// 端口
-	err := router.Run(":" + ApplicationYaml.Web.Port)
+	err := router.Run(":" + infra.ApplicationYaml.Web.Port)
 	if err != nil {
-		c_log.GlobalLogger.Error("程序崩溃,监听端口 "+ApplicationYaml.Web.Port+" 失败:", err)
+		c_log.GlobalLogger.Error("程序崩溃,监听端口 "+infra.ApplicationYaml.Web.Port+" 失败:", err)
 		os.Exit(-1)
 	}
 }

+ 3 - 0
amd64/web_server/sql/exam-select-details-by-id.sql

@@ -0,0 +1,3 @@
+select details
+from exam
+where id = ?