feat: 为Git仓库管理接口添加操作日志
为代码拉取、构建和重启处理程序添加日志记录,增强操作可追溯性和调试信息
This commit is contained in:
parent
300fdbd957
commit
e2be7bd21d
@ -169,6 +169,7 @@ func buildBot() error {
|
|||||||
|
|
||||||
func PullCodeHandler(c *gin.Context) {
|
func PullCodeHandler(c *gin.Context) {
|
||||||
err := util.GitPull()
|
err := util.GitPull()
|
||||||
|
log.Println("拉取代码...")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
}
|
}
|
||||||
@ -177,6 +178,7 @@ func PullCodeHandler(c *gin.Context) {
|
|||||||
|
|
||||||
func BuildBotHandler(c *gin.Context) {
|
func BuildBotHandler(c *gin.Context) {
|
||||||
err := buildBot()
|
err := buildBot()
|
||||||
|
log.Println("构建程序...")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
}
|
}
|
||||||
@ -185,6 +187,7 @@ func BuildBotHandler(c *gin.Context) {
|
|||||||
|
|
||||||
func RestartBotHandler(c *gin.Context) {
|
func RestartBotHandler(c *gin.Context) {
|
||||||
err := restartProgram()
|
err := restartProgram()
|
||||||
|
log.Println("重启程序...")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user