Updated backend
This commit is contained in:
parent
69a64879b6
commit
b6f8546114
1 changed files with 32 additions and 1 deletions
|
|
@ -158,6 +158,26 @@ func connect() {
|
|||
"result2": array2,
|
||||
})
|
||||
|
||||
case "get-list-registered":
|
||||
array := []string{}
|
||||
|
||||
results, err := db.Query("SELECT IFNULL(employeeid, 0) AS result FROM esign WHERE employeeid <> ?", 276)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
for results.Next() {
|
||||
err = results.Scan(&result)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
array = append(array, result)
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": array,
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -480,6 +500,17 @@ func connect() {
|
|||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": result,
|
||||
})
|
||||
|
||||
case "get-employeename":
|
||||
err := db.QueryRow("SELECT IFNULL(employeename, '') AS result FROM employee WHERE employeeid = ?", data).Scan(&result)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": result,
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue