format
This commit is contained in:
@@ -2,8 +2,8 @@ package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -12,14 +12,12 @@ import(
|
||||
"example.com/gin/test/services"
|
||||
)
|
||||
|
||||
|
||||
type UserController struct{}
|
||||
|
||||
func NewUserController() UserController {
|
||||
return UserController{}
|
||||
}
|
||||
|
||||
|
||||
func (uc *UserController) Register(c *gin.Context) {
|
||||
//Get the email/passwd off req body
|
||||
var body struct {
|
||||
@@ -53,7 +51,6 @@ func (uc *UserController) Register(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{})
|
||||
}
|
||||
|
||||
|
||||
func (uc *UserController) Login(c *gin.Context) {
|
||||
//Get the email/passwd off req body
|
||||
var body struct {
|
||||
@@ -116,7 +113,6 @@ func (rc *UserController) LoginView(c *gin.Context) {
|
||||
c.HTML(http.StatusOK, "login.html", CreateSessionData(c, data))
|
||||
}
|
||||
|
||||
|
||||
func (rc *UserController) LoginHandler(c *gin.Context) {
|
||||
email := c.PostForm("email")
|
||||
password := c.PostForm("password")
|
||||
@@ -147,7 +143,6 @@ func CreateSessionData(c *gin.Context, extra any) gin.H {
|
||||
_, exists := c.Get("user")
|
||||
|
||||
return gin.H{
|
||||
"test": "HEllo World",
|
||||
"loggedIn": exists,
|
||||
"data": extra,
|
||||
}
|
||||
@@ -236,10 +231,9 @@ func (rc *UserController) CalendarView(c *gin.Context) {
|
||||
shopItems, _ := repositories.ShopItems.GetAll()
|
||||
fmt.Println(len(shopItems))
|
||||
|
||||
|
||||
generateBookings := func(amountShopItems int) []calendarbooking {
|
||||
var result []calendarbooking
|
||||
time := 6;
|
||||
time := 6
|
||||
for _ = range 18 {
|
||||
book := calendarbooking{
|
||||
Time: fmt.Sprintf("%d:00", time),
|
||||
|
||||
Reference in New Issue
Block a user