feat: 为Git仓库管理接口添加操作日志

为代码拉取、构建和重启处理程序添加日志记录,增强操作可追溯性和调试信息
This commit is contained in:
lixiangwuxian 2025-03-09 14:34:21 +08:00
parent 300fdbd957
commit e2be7bd21d

View File

@ -169,6 +169,7 @@ func buildBot() error {
func PullCodeHandler(c *gin.Context) {
err := util.GitPull()
log.Println("拉取代码...")
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
}
@ -177,6 +178,7 @@ func PullCodeHandler(c *gin.Context) {
func BuildBotHandler(c *gin.Context) {
err := buildBot()
log.Println("构建程序...")
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
}
@ -185,6 +187,7 @@ func BuildBotHandler(c *gin.Context) {
func RestartBotHandler(c *gin.Context) {
err := restartProgram()
log.Println("重启程序...")
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
}