refactor: move client page view file to client folder and reorganize file structure

This commit is contained in:
2024-08-18 12:59:19 +07:00
parent 97a9e72d7b
commit 7df02c270b
27 changed files with 29 additions and 30 deletions

View File

@ -9,8 +9,8 @@ import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/types/models" "github.com/fossyy/filekeeper/types/models"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
authView "github.com/fossyy/filekeeper/view/auth" "github.com/fossyy/filekeeper/view/client/auth"
signupView "github.com/fossyy/filekeeper/view/signup" signupView "github.com/fossyy/filekeeper/view/client/signup"
"github.com/google/uuid" "github.com/google/uuid"
"net/http" "net/http"
"sync" "sync"

View File

@ -5,7 +5,7 @@ import (
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
totpView "github.com/fossyy/filekeeper/view/totp" "github.com/fossyy/filekeeper/view/client/totp"
"github.com/xlzd/gotp" "github.com/xlzd/gotp"
"net/http" "net/http"
"strings" "strings"

View File

@ -1,13 +1,13 @@
package downloadHandler package downloadHandler
import ( import (
"github.com/fossyy/filekeeper/view/client/download"
"net/http" "net/http"
"github.com/fossyy/filekeeper/db" "github.com/fossyy/filekeeper/db"
"github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/logger"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
downloadView "github.com/fossyy/filekeeper/view/download"
) )
var log *logger.AggregatedLogger var log *logger.AggregatedLogger

View File

@ -2,10 +2,10 @@ package errorHandler
import ( import (
"fmt" "fmt"
"github.com/fossyy/filekeeper/view/client/error"
"net/http" "net/http"
"github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/logger"
errorView "github.com/fossyy/filekeeper/view/error"
) )
var log *logger.AggregatedLogger var log *logger.AggregatedLogger

View File

@ -6,6 +6,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/fossyy/filekeeper/cache" "github.com/fossyy/filekeeper/cache"
"github.com/fossyy/filekeeper/view/client/email"
"github.com/fossyy/filekeeper/view/client/forgotPassword"
"github.com/google/uuid" "github.com/google/uuid"
"net/http" "net/http"
"strconv" "strconv"
@ -17,8 +19,6 @@ import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/types/models" "github.com/fossyy/filekeeper/types/models"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
emailView "github.com/fossyy/filekeeper/view/email"
forgotPasswordView "github.com/fossyy/filekeeper/view/forgotPassword"
"gorm.io/gorm" "gorm.io/gorm"
) )

View File

@ -8,9 +8,8 @@ import (
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
forgotPasswordView "github.com/fossyy/filekeeper/view/forgotPassword" "github.com/fossyy/filekeeper/view/client/forgotPassword"
signupView "github.com/fossyy/filekeeper/view/signup" signupView "github.com/fossyy/filekeeper/view/client/signup"
"net/http" "net/http"
) )

View File

@ -2,10 +2,10 @@ package indexHandler
import ( import (
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
"github.com/fossyy/filekeeper/view/client/index"
"net/http" "net/http"
"github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/logger"
indexView "github.com/fossyy/filekeeper/view/index"
) )
var log *logger.AggregatedLogger var log *logger.AggregatedLogger

View File

@ -8,7 +8,7 @@ import (
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
signinView "github.com/fossyy/filekeeper/view/signin" "github.com/fossyy/filekeeper/view/client/signin"
"net/http" "net/http"
"strings" "strings"
) )

View File

@ -4,6 +4,8 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
"github.com/fossyy/filekeeper/view/client/email"
signupView "github.com/fossyy/filekeeper/view/client/signup"
"net/http" "net/http"
"strconv" "strconv"
"sync" "sync"
@ -15,8 +17,6 @@ import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/types/models" "github.com/fossyy/filekeeper/types/models"
"github.com/fossyy/filekeeper/utils" "github.com/fossyy/filekeeper/utils"
emailView "github.com/fossyy/filekeeper/view/email"
signupView "github.com/fossyy/filekeeper/view/signup"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -1,13 +1,13 @@
package signupVerifyHandler package signupVerifyHandler
import ( import (
signupView "github.com/fossyy/filekeeper/view/client/signup"
"net/http" "net/http"
"github.com/fossyy/filekeeper/db" "github.com/fossyy/filekeeper/db"
signupHandler "github.com/fossyy/filekeeper/handler/signup" signupHandler "github.com/fossyy/filekeeper/handler/signup"
"github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/logger"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
signupView "github.com/fossyy/filekeeper/view/signup"
) )
var log *logger.AggregatedLogger var log *logger.AggregatedLogger

View File

@ -4,7 +4,7 @@ import (
"github.com/fossyy/filekeeper/cache" "github.com/fossyy/filekeeper/cache"
"github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/logger"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
filesView "github.com/fossyy/filekeeper/view/upload" filesView "github.com/fossyy/filekeeper/view/client/upload"
"io" "io"
"net/http" "net/http"
"os" "os"

View File

@ -2,7 +2,7 @@ package userSessionTerminateHandler
import ( import (
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
userView "github.com/fossyy/filekeeper/view/user" "github.com/fossyy/filekeeper/view/client/user"
"net/http" "net/http"
) )

View File

@ -5,7 +5,7 @@ import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"github.com/fossyy/filekeeper/cache" "github.com/fossyy/filekeeper/cache"
userTotpSetupView "github.com/fossyy/filekeeper/view/user/totp" "github.com/fossyy/filekeeper/view/client/user/totp"
"image/png" "image/png"
"net/http" "net/http"
"time" "time"

View File

@ -3,11 +3,11 @@ package userHandler
import ( import (
"github.com/a-h/templ" "github.com/a-h/templ"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/client/user"
"net/http" "net/http"
"github.com/fossyy/filekeeper/logger" "github.com/fossyy/filekeeper/logger"
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
userView "github.com/fossyy/filekeeper/view/user"
) )
var log *logger.AggregatedLogger var log *logger.AggregatedLogger

View File

@ -2,7 +2,7 @@ package authView
import ( import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
) )
templ form(err types.Message, title string) { templ form(err types.Message, title string) {

View File

@ -1,7 +1,7 @@
package downloadView package downloadView
import ( import (
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
) )

View File

@ -1,6 +1,6 @@
package errorView package errorView
import "github.com/fossyy/filekeeper/view/layout" import "github.com/fossyy/filekeeper/view/client/layout"
templ NotFound(title string){ templ NotFound(title string){
@layout.Base(title){ @layout.Base(title){

View File

@ -2,7 +2,7 @@ package forgotPasswordView
import ( import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
) )
templ content(title string, err types.Message) { templ content(title string, err types.Message) {

View File

@ -2,7 +2,7 @@ package indexView
import ( import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
) )
templ content(title string, user types.User) { templ content(title string, user types.User) {

View File

@ -2,7 +2,7 @@ package signinView
import ( import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
) )
templ content(err types.Message, title string) { templ content(err types.Message, title string) {

View File

@ -2,7 +2,7 @@ package signup
import ( import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
) )
templ form(err types.Message, title string) { templ form(err types.Message, title string) {

View File

@ -1,7 +1,7 @@
package totpView package totpView
import ( import (
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
) )

View File

@ -1,6 +1,6 @@
package uploadView package uploadView
import "github.com/fossyy/filekeeper/view/layout" import "github.com/fossyy/filekeeper/view/client/layout"
templ content(title string) { templ content(title string) {
@layout.Base(title){ @layout.Base(title){

View File

@ -1,7 +1,7 @@
package userTotpSetupView package userTotpSetupView
import ( import (
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
) )

View File

@ -2,7 +2,7 @@ package userView
import ( import (
"github.com/fossyy/filekeeper/types" "github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/layout" "github.com/fossyy/filekeeper/view/client/layout"
"github.com/fossyy/filekeeper/session" "github.com/fossyy/filekeeper/session"
) )