Added get-headid api

This commit is contained in:
Patrick Alvin Alcala 2026-01-05 18:04:23 +08:00
parent 2ab9ab91b4
commit ec63e44fb0

View file

@ -434,6 +434,17 @@ func connect() {
"result": result, "result": result,
}) })
case "get-headid":
err = db.QueryRow("SELECT IFNULL(employeeid, '') AS result FROM employee WHERE is_head = 1").Scan(&result)
if err != nil {
c.AbortWithError(http.StatusBadRequest, err)
c.String(http.StatusBadRequest, err.Error())
return
}
c.JSON(http.StatusOK, gin.H{
"result": result,
})
} }
}) })