gofmt
This commit is contained in:
parent
2cd48f2e30
commit
a97216fbd1
|
@ -32,11 +32,11 @@ func ListBooks(searchterm string) (books []*Book, err error) {
|
||||||
// Quantites
|
// Quantites
|
||||||
allq := []Quantity{}
|
allq := []Quantity{}
|
||||||
err = x.Table("quantities").
|
err = x.Table("quantities").
|
||||||
Select("quantities.id, quantity_relations.book_id AS item_id, quantities.quantity, quantities.created").
|
Select("quantities.id, quantity_relations.book_id AS item_id, quantities.quantity, quantities.created").
|
||||||
Join("INNER", "quantity_relations", "quantities.item_id = quantity_relations.id").
|
Join("INNER", "quantity_relations", "quantities.item_id = quantity_relations.id").
|
||||||
Where("quantity_relations.book_id != 0").
|
Where("quantity_relations.book_id != 0").
|
||||||
Desc("quantities.created").
|
Desc("quantities.created").
|
||||||
Find(&allq)
|
Find(&allq)
|
||||||
|
|
||||||
// Link them
|
// Link them
|
||||||
for i, book := range books {
|
for i, book := range books {
|
||||||
|
|
|
@ -28,7 +28,6 @@ func SetEngine() (err error) {
|
||||||
cacher := xorm.NewLRUCacher(xorm.NewMemoryStore(), 1000)
|
cacher := xorm.NewLRUCacher(xorm.NewMemoryStore(), 1000)
|
||||||
x.SetDefaultCacher(cacher)
|
x.SetDefaultCacher(cacher)
|
||||||
|
|
||||||
|
|
||||||
x.SetMapper(core.GonicMapper{})
|
x.SetMapper(core.GonicMapper{})
|
||||||
|
|
||||||
// Sync dat shit
|
// Sync dat shit
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"github.com/labstack/echo"
|
"github.com/labstack/echo"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"git.mowie.cc/konrad/Library/models"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.mowie.cc/konrad/Library/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BookList is the handler to list books
|
// BookList is the handler to list books
|
||||||
|
|
|
@ -2,9 +2,9 @@ package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.mowie.cc/konrad/Library/models"
|
||||||
"github.com/dgrijalva/jwt-go"
|
"github.com/dgrijalva/jwt-go"
|
||||||
"github.com/labstack/echo"
|
"github.com/labstack/echo"
|
||||||
"git.mowie.cc/konrad/Library/models"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckToken checks prints a message if the token is valid or not. Currently only used for testing pourposes.
|
// CheckToken checks prints a message if the token is valid or not. Currently only used for testing pourposes.
|
||||||
|
|
Loading…
Reference in New Issue