mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-21 22:30:46 +08:00
feat(database): support postgres (#43)
Co-authored-by: Li4n0 <[email protected]>
This commit is contained in:
+2
-2
@@ -43,7 +43,7 @@ func (r *Rule) CreateOrUpdate() (err error) {
|
||||
[]string{
|
||||
"name",
|
||||
"flag_format",
|
||||
"rank",
|
||||
"base_rank",
|
||||
"pasv_address",
|
||||
"data",
|
||||
"push_to_client",
|
||||
@@ -115,7 +115,7 @@ func ListRules(c *gin.Context) {
|
||||
order = "desc"
|
||||
}
|
||||
|
||||
if err := db.Order("`rank` desc").Order("id" + " " + order).Count(&count).Offset((page - 1) * pageSize).Limit(pageSize).Find(&res).Error; err != nil {
|
||||
if err := db.Order("base_rank desc").Order("id" + " " + order).Count(&count).Offset((page - 1) * pageSize).Limit(pageSize).Find(&res).Error; err != nil {
|
||||
c.JSON(400, gin.H{
|
||||
"status": "failed",
|
||||
"error": err.Error(),
|
||||
|
||||
Reference in New Issue
Block a user