🐛 sql group

This commit is contained in:
微凉
2021-10-30 17:34:34 +08:00
parent 0324ea1fcb
commit 2780efaea8
7 changed files with 23 additions and 11 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/Xhofe/alist/drivers"
"github.com/Xhofe/alist/model"
"github.com/gofiber/fiber/v2"
"time"
)
func GetAccounts(ctx *fiber.Ctx) error {
@ -24,6 +25,8 @@ func SaveAccount(ctx *fiber.Ctx) error {
return ErrorResp(ctx, fmt.Errorf("no [%s] driver", req.Type), 400)
}
old, ok := model.GetAccount(req.Name)
now := time.Now()
req.UpdatedAt = &now
if err := model.SaveAccount(req); err != nil {
return ErrorResp(ctx, err, 500)
} else {