|
|
@ -13,6 +13,7 @@ import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var db *sqlx.DB
|
|
|
|
var db *sqlx.DB
|
|
|
|
|
|
|
|
var selected string = ""
|
|
|
|
|
|
|
|
|
|
|
|
// Read the example and its comments carefully.
|
|
|
|
// Read the example and its comments carefully.
|
|
|
|
func makeAccessLog() *accesslog.AccessLog {
|
|
|
|
func makeAccessLog() *accesslog.AccessLog {
|
|
|
@ -108,6 +109,11 @@ func albums(db *sqlx.DB) func(iris.Party) {
|
|
|
|
albums := getAlbums(db)
|
|
|
|
albums := getAlbums(db)
|
|
|
|
ctx.JSON(albums)
|
|
|
|
ctx.JSON(albums)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
r.Get("/dest/{album}", func(ctx iris.Context) {
|
|
|
|
|
|
|
|
selected = ctx.Params().Get("album")
|
|
|
|
|
|
|
|
ctx.Application().Logger().Infof("выбор альбома: %s", selected)
|
|
|
|
|
|
|
|
ctx.JSON(iris.Map{"status": iris.StatusOK})
|
|
|
|
|
|
|
|
})
|
|
|
|
r.Get("/get/{album}", func(ctx iris.Context) {
|
|
|
|
r.Get("/get/{album}", func(ctx iris.Context) {
|
|
|
|
album := ctx.Params().Get("album")
|
|
|
|
album := ctx.Params().Get("album")
|
|
|
|
if album == "local" {
|
|
|
|
if album == "local" {
|
|
|
@ -133,6 +139,14 @@ func images(db *sqlx.DB) func(iris.Party) {
|
|
|
|
filename := ctx.Request().URL.Query().Get("filename")
|
|
|
|
filename := ctx.Request().URL.Query().Get("filename")
|
|
|
|
ctx.Application().Logger().Infof("удаление картинки[%s]: %s", id, filename)
|
|
|
|
ctx.Application().Logger().Infof("удаление картинки[%s]: %s", id, filename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.JSON(iris.Map{"filename": filename})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
r.Get("/move/{id}", func(ctx iris.Context) {
|
|
|
|
|
|
|
|
id := ctx.Params().Get("id")
|
|
|
|
|
|
|
|
filename := ctx.Request().URL.Query().Get("filename")
|
|
|
|
|
|
|
|
ctx.Application().Logger().Infof("перемещение картинки[%s]: %s в [%s]",
|
|
|
|
|
|
|
|
id, filename, selected)
|
|
|
|
|
|
|
|
|
|
|
|
ctx.JSON(iris.Map{"filename": filename})
|
|
|
|
ctx.JSON(iris.Map{"filename": filename})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|