initial commit

This commit is contained in:
2023-03-19 22:13:49 -04:00
commit 717c9e08d6
12 changed files with 367 additions and 0 deletions

20
Handlers/Photo/Index.go Normal file
View File

@@ -0,0 +1,20 @@
package Photo
import (
"git.siteworxpro.com/gun-manager/sql"
"github.com/gorilla/mux"
"net/http"
"strconv"
)
func Get(w http.ResponseWriter, r *http.Request) {
db := sql.GetDb()
id, _ := strconv.ParseInt(mux.Vars(r)["id"], 10, 32)
photo := db.GetPhoto(uint(id))
_, err := w.Write([]byte(photo))
if err != nil {
panic(err)
}
}