Skip to content

Commit 6b2fb6e

Browse files
author
Rogary
committed
update sth
1 parent 57f651d commit 6b2fb6e

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

query/delete-detail.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@ func DeleteDetail(c *gin.Context) {
1414
}
1515
}
1616

17-
/**
18-
* func DeleteDetail
19-
* table/:id
20-
**/
2117
func deleteDetail(c *gin.Context) {
22-
//get param
2318
table := c.Param("table")
2419
id := c.Param("id")
2520
sqlstring := "delete from " + table + " where id = '" + id + "' ;"
26-
// query
27-
2821
result, err := connection.GetConnection().Exec(sqlstring)
2922
if err != nil {
3023
fmt.Println(err)

query/query-user.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@ import (
77
"log"
88
)
99

10-
/**
11-
* func CheckUser
12-
*
13-
**/
1410
func CheckUser(username string, passwd string) bool {
15-
//get param
16-
1711
sqlstring := "select id from " + conf.GetAuthTableName() + " where " + conf.GetAuthName() + " = '" + username + "' and " + conf.GetAuthPwd() + " = '" + passwd + "' ;"
18-
// query
1912
log.Println(sqlstring)
2013
rows, err := connection.GetConnection().Query(sqlstring)
2114
defer rows.Close()
@@ -31,7 +24,6 @@ func CheckUser(username string, passwd string) bool {
3124
values := make([]sql.RawBytes, len(columns))
3225
if len(values) > 0 {
3326
return true
34-
} else {
35-
return false
3627
}
28+
return false
3729
}

0 commit comments

Comments
 (0)