Merge branch 'main' of github.com:ardeman/project-legalgo-go

This commit is contained in:
ericprd 2025-02-27 10:28:15 +08:00
commit 33ba5fbbdc
42 changed files with 149 additions and 101 deletions

8
.markdownlint.json Normal file
View File

@ -0,0 +1,8 @@
{
"default": true,
"MD013": false,
"MD026": false,
"MD033": false,
"MD040": false,
"MD041": false
}

View File

@ -9,32 +9,41 @@ Before proceeding, make sure you have the following installed on your computer:
## Steps to Install Go 1.24.0 ## Steps to Install Go 1.24.0
### For Windows: ### `go` For Windows:
1. Download the installer from [official Go website](https://golang.org/dl/). 1. Download the installer from [official Go website](https://golang.org/dl/).
2. Run the downloaded `.msi` file and follow the installation wizard. 2. Run the downloaded `.msi` file and follow the installation wizard.
3. During installation, you may be prompted to set the `GOPATH` and `GOROOT`. Choose the appropriate settings 3. During installation, you may be prompted to set the `GOPATH` and `GOROOT`. Choose the appropriate settings
based on your preference or keep the default values. based on your preference or keep the default values.
### For macOS: ### `go` For macOS:
1. Open Terminal. 1. Open Terminal.
2. Download the package using Homebrew (if not installed, visit [Homebrew website](https://brew.sh/) for 2. Download the package using Homebrew (if not installed, visit [Homebrew website](https://brew.sh/) for
installation instructions): installation instructions):
```bash ```bash
brew install go@1.24 brew install go@1.24
``` ```
3. Link the installed version to your PATH: 3. Link the installed version to your PATH:
```bash ```bash
brew link --overwrite --force go@1.24 brew link --overwrite --force go@1.24
``` ```
### For Linux: ### `go` For Linux:
1. Open Terminal. 1. Open Terminal.
2. Download the appropriate tarball from [official Go website](https://golang.org/dl/). 2. Download the appropriate tarball from [official Go website](https://golang.org/dl/).
3. Extract the downloaded archive: 3. Extract the downloaded archive:
```bash ```bash
tar -C /usr/local -xzf go1.24.linux-amd64.tar.gz tar -C /usr/local -xzf go1.24.linux-amd64.tar.gz
``` ```
4. Add Go to your PATH by editing your shell configuration file (e.g., `.bashrc`, `.zshrc`): 4. Add Go to your PATH by editing your shell configuration file (e.g., `.bashrc`, `.zshrc`):
```bash ```bash
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc source ~/.bashrc
@ -43,25 +52,31 @@ installation instructions):
## Verify Installation ## Verify Installation
After installation, verify that Go 1.24.0 is installed correctly by running: After installation, verify that Go 1.24.0 is installed correctly by running:
```bash ```bash
go version go version
``` ```
You should see an output like `go version go1.24 darwin/amd64` (or similar, depending on your OS). You should see an output like `go version go1.24 darwin/amd64` (or similar, depending on your OS).
## Install Make (if not already installed) ## Install Make (if not already installed)
### For Windows: ### `make` For Windows:
- Download and install [Make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm). - Download and install [Make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm).
- Add the installation directory to your PATH. - Add the installation directory to your PATH.
### For macOS: ### `make` For macOS:
1. Open Terminal. 1. Open Terminal.
2. Install Make using Homebrew: 2. Install Make using Homebrew:
```bash ```bash
brew install make brew install make
``` ```
### For Linux: ### `make` For Linux:
Make is usually pre-installed on most Linux distributions. If it's not installed, you can install it using your Make is usually pre-installed on most Linux distributions. If it's not installed, you can install it using your
package manager (e.g., `sudo apt-get install make` for Ubuntu). package manager (e.g., `sudo apt-get install make` for Ubuntu).
@ -72,6 +87,7 @@ Open Terminal and navigate to the root directory of your Go project.
## Resolve Dependencies with `go mod tidy` ## Resolve Dependencies with `go mod tidy`
Run the following command to download and resolve all dependencies specified in your `go.mod` file: Run the following command to download and resolve all dependencies specified in your `go.mod` file:
```bash ```bash
go mod tidy go mod tidy
``` ```
@ -79,6 +95,7 @@ go mod tidy
## Setup Database ## Setup Database
In your Go application, you'll need to set the following environment variables to connect to your database: In your Go application, you'll need to set the following environment variables to connect to your database:
```bash ```bash
DB_HOST: The hostname or IP address of your database server (e.g., localhost, 127.0.0.1, or the actual DB server URL). DB_HOST: The hostname or IP address of your database server (e.g., localhost, 127.0.0.1, or the actual DB server URL).
DB_USER: The username for your database connection. DB_USER: The username for your database connection.
@ -115,6 +132,7 @@ make migrate
## Build the Binary Using `make build` ## Build the Binary Using `make build`
Run the following command to build your project. The binary will be placed in the `bin` folder. Run the following command to build your project. The binary will be placed in the `bin` folder.
```bash ```bash
make build make build
``` ```
@ -122,6 +140,7 @@ make build
## Run the Program Using `make run` ## Run the Program Using `make run`
Finally, you can run your program using: Finally, you can run your program using:
```bash ```bash
make run make run
``` ```
@ -132,6 +151,7 @@ This command will compile and execute your Go application.
**Note:** Ensure that your `Makefile` is correctly set up to handle these commands. If not, you may need to create **Note:** Ensure that your `Makefile` is correctly set up to handle these commands. If not, you may need to create
or adjust it accordingly. or adjust it accordingly.
``` ```
Please follow the above instructions to set up Go version 1.24.0, manage dependencies using `go mod tidy`, build a Please follow the above instructions to set up Go version 1.24.0, manage dependencies using `go mod tidy`, build a

View File

@ -3,9 +3,10 @@ package main
import ( import (
"log" "log"
"github.com/ardeman/project-legalgo-go/config" "legalgo-BE-go/config"
"github.com/ardeman/project-legalgo-go/database" "legalgo-BE-go/database"
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/joho/godotenv" "github.com/joho/godotenv"
) )

View File

@ -5,12 +5,13 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/ardeman/project-legalgo-go/config" "legalgo-BE-go/config"
"github.com/ardeman/project-legalgo-go/database" "legalgo-BE-go/database"
repository "github.com/ardeman/project-legalgo-go/internal/accessor" repository "legalgo-BE-go/internal/accessor"
internalhttp "github.com/ardeman/project-legalgo-go/internal/api/http" internalhttp "legalgo-BE-go/internal/api/http"
pkgconfig "github.com/ardeman/project-legalgo-go/internal/config" pkgconfig "legalgo-BE-go/internal/config"
"github.com/ardeman/project-legalgo-go/internal/services" "legalgo-BE-go/internal/services"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/joho/godotenv" "github.com/joho/godotenv"
"go.uber.org/fx" "go.uber.org/fx"

View File

@ -1,7 +1,7 @@
package config package config
import ( import (
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
) )
var ( var (

View File

@ -3,7 +3,8 @@ package database
import ( import (
"fmt" "fmt"
"github.com/ardeman/project-legalgo-go/config" "legalgo-BE-go/config"
"gorm.io/driver/postgres" "gorm.io/driver/postgres"
"gorm.io/gorm" "gorm.io/gorm"
) )

15
go.mod
View File

@ -1,10 +1,13 @@
module github.com/ardeman/project-legalgo-go module legalgo-BE-go
go 1.24.0 go 1.24.0
require ( require (
github.com/golang-jwt/jwt/v5 v5.2.1 github.com/golang-jwt/jwt/v5 v5.2.1
github.com/joho/godotenv v1.5.1
go.uber.org/fx v1.23.0 go.uber.org/fx v1.23.0
golang.org/x/crypto v0.34.0
gorm.io/driver/postgres v1.5.11
) )
require ( require (
@ -17,24 +20,20 @@ require (
github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect github.com/jinzhu/now v1.1.5 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/leodido/go-urn v1.4.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect
golang.org/x/crypto v0.34.0 // indirect
golang.org/x/net v0.34.0 // indirect golang.org/x/net v0.34.0 // indirect
golang.org/x/text v0.22.0 // indirect golang.org/x/text v0.22.0 // indirect
gorm.io/driver/postgres v1.5.11 // indirect
) )
require ( require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-chi/chi v1.5.5 github.com/go-chi/chi/v5 v5.2.1
github.com/go-chi/chi/v5 v5.2.1 // indirect
github.com/go-chi/cors v1.2.1 github.com/go-chi/cors v1.2.1
github.com/go-playground/validator/v10 v10.25.0 github.com/go-playground/validator/v10 v10.25.0
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/redis/go-redis/v9 v9.7.1 // indirect github.com/redis/go-redis/v9 v9.7.1
github.com/sirupsen/logrus v1.9.3 // indirect github.com/sirupsen/logrus v1.9.3
go.uber.org/dig v1.18.0 // indirect go.uber.org/dig v1.18.0 // indirect
go.uber.org/multierr v1.10.0 // indirect go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.26.0 // indirect go.uber.org/zap v1.26.0 // indirect

16
go.sum
View File

@ -1,3 +1,7 @@
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -7,12 +11,12 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM= github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8= github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
github.com/go-chi/chi v1.5.5 h1:vOB/HbEMt9QqBqErz07QehcOKHaWFtuj87tTDVz2qXE=
github.com/go-chi/chi v1.5.5/go.mod h1:C9JqLr3tIYjDOZpzn+BCuxY8z8vmca43EeMgyZt7irw=
github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8=
github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
@ -48,8 +52,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw=
go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE=
go.uber.org/fx v1.23.0 h1:lIr/gYWQGfTwGcSXWXu4vP5Ws6iqnNEIY+F/aFzCKTg= go.uber.org/fx v1.23.0 h1:lIr/gYWQGfTwGcSXWXu4vP5Ws6iqnNEIY+F/aFzCKTg=
@ -60,8 +64,6 @@ go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA= golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA=
golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
@ -71,8 +73,6 @@ golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -1,11 +1,12 @@
package repository package repository
import ( import (
redisaccessor "github.com/ardeman/project-legalgo-go/internal/accessor/redis" redisaccessor "legalgo-BE-go/internal/accessor/redis"
staffrepository "github.com/ardeman/project-legalgo-go/internal/accessor/staff" staffrepository "legalgo-BE-go/internal/accessor/staff"
subscriberepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribe" subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
subscribeplanrepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribeplan" subscribeplanrepository "legalgo-BE-go/internal/accessor/subscribeplan"
userrepository "github.com/ardeman/project-legalgo-go/internal/accessor/user_repository" userrepository "legalgo-BE-go/internal/accessor/user_repository"
"go.uber.org/fx" "go.uber.org/fx"
) )

View File

@ -1,6 +1,6 @@
package staffrepository package staffrepository
import authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" import authdomain "legalgo-BE-go/internal/domain/auth"
func (ur *StaffRepository) Create(spec *authdomain.Staff) (*authdomain.Staff, error) { func (ur *StaffRepository) Create(spec *authdomain.Staff) (*authdomain.Staff, error) {
if err := ur.DB.Create(&spec).Error; err != nil { if err := ur.DB.Create(&spec).Error; err != nil {

View File

@ -3,7 +3,8 @@ package staffrepository
import ( import (
"errors" "errors"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
"gorm.io/gorm" "gorm.io/gorm"
) )

View File

@ -1,8 +1,8 @@
package staffrepository package staffrepository
import ( import (
"github.com/ardeman/project-legalgo-go/database" "legalgo-BE-go/database"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
) )
type StaffRepository struct { type StaffRepository struct {

View File

@ -1,7 +1,8 @@
package subscriberepository package subscriberepository
import ( import (
subscribedomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe" subscribedomain "legalgo-BE-go/internal/domain/subscribe"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -1,6 +1,6 @@
package subscriberepository package subscriberepository
import "github.com/ardeman/project-legalgo-go/database" import "legalgo-BE-go/database"
type SubsAccs struct { type SubsAccs struct {
DB *database.DB DB *database.DB

View File

@ -1,7 +1,8 @@
package subscribeplanrepository package subscribeplanrepository
import ( import (
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -1,7 +1,7 @@
package subscribeplanrepository package subscribeplanrepository
import ( import (
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
) )
func (s *SubsPlan) GetAll() ([]subscribeplandomain.SubscribePlan, error) { func (s *SubsPlan) GetAll() ([]subscribeplandomain.SubscribePlan, error) {

View File

@ -1,7 +1,8 @@
package subscribeplanrepository package subscribeplanrepository
import ( import (
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -1,8 +1,8 @@
package subscribeplanrepository package subscribeplanrepository
import ( import (
"github.com/ardeman/project-legalgo-go/database" "legalgo-BE-go/database"
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
) )
type SubsPlan struct { type SubsPlan struct {

View File

@ -1,7 +1,7 @@
package userrepository package userrepository
import ( import (
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
) )
func (ur *UserRepository) CreateUser(spec *authdomain.User) (*authdomain.User, error) { func (ur *UserRepository) CreateUser(spec *authdomain.User) (*authdomain.User, error) {

View File

@ -3,7 +3,8 @@ package userrepository
import ( import (
"errors" "errors"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
"gorm.io/gorm" "gorm.io/gorm"
) )

View File

@ -1,8 +1,8 @@
package userrepository package userrepository
import ( import (
"github.com/ardeman/project-legalgo-go/database" "legalgo-BE-go/database"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
) )
type UserRepository struct { type UserRepository struct {

View File

@ -3,10 +3,11 @@ package authhttp
import ( import (
"net/http" "net/http"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
authsvc "github.com/ardeman/project-legalgo-go/internal/services/auth" authsvc "legalgo-BE-go/internal/services/auth"
"github.com/ardeman/project-legalgo-go/internal/utilities/response" "legalgo-BE-go/internal/utilities/response"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
) )

View File

@ -3,10 +3,11 @@ package authhttp
import ( import (
"net/http" "net/http"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
authsvc "github.com/ardeman/project-legalgo-go/internal/services/auth" authsvc "legalgo-BE-go/internal/services/auth"
"github.com/ardeman/project-legalgo-go/internal/utilities/response" "legalgo-BE-go/internal/utilities/response"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
) )

View File

@ -6,11 +6,11 @@ package authmiddleware
// "net/http" // "net/http"
// "strings" // "strings"
// redisaccessor "github.com/ardeman/project-legalgo-go/internal/accessor/redis" // redisaccessor "legalgo-BE-go/internal/accessor/redis"
// contextkeyenum "github.com/ardeman/project-legalgo-go/internal/enums/context_key" // contextkeyenum "legalgo-BE-go/internal/enums/context_key"
// jwtclaimenum "github.com/ardeman/project-legalgo-go/internal/enums/jwt" // jwtclaimenum "legalgo-BE-go/internal/enums/jwt"
// resourceenum "github.com/ardeman/project-legalgo-go/internal/enums/resource" // resourceenum "legalgo-BE-go/internal/enums/resource"
// "github.com/ardeman/project-legalgo-go/internal/services/auth" // "legalgo-BE-go/internal/services/auth"
// "github.com/golang-jwt/jwt/v5" // "github.com/golang-jwt/jwt/v5"
// ) // )

View File

@ -1,8 +1,9 @@
package internalhttp package internalhttp
import ( import (
authhttp "github.com/ardeman/project-legalgo-go/internal/api/http/auth" authhttp "legalgo-BE-go/internal/api/http/auth"
subscribeplanhttp "github.com/ardeman/project-legalgo-go/internal/api/http/subscribe_plan" subscribeplanhttp "legalgo-BE-go/internal/api/http/subscribe_plan"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-chi/cors" "github.com/go-chi/cors"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"

View File

@ -3,10 +3,11 @@ package subscribeplanhttp
import ( import (
"net/http" "net/http"
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
subscribeplansvc "github.com/ardeman/project-legalgo-go/internal/services/subscribe_plan" subscribeplansvc "legalgo-BE-go/internal/services/subscribe_plan"
"github.com/ardeman/project-legalgo-go/internal/utilities/response" "legalgo-BE-go/internal/utilities/response"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
) )

View File

@ -3,8 +3,9 @@ package subscribeplanhttp
import ( import (
"net/http" "net/http"
subscribeplansvc "github.com/ardeman/project-legalgo-go/internal/services/subscribe_plan" subscribeplansvc "legalgo-BE-go/internal/services/subscribe_plan"
"github.com/ardeman/project-legalgo-go/internal/utilities/response" "legalgo-BE-go/internal/utilities/response"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
) )

View File

@ -8,7 +8,8 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/ardeman/project-legalgo-go/config" "legalgo-BE-go/config"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"

View File

@ -1,11 +1,11 @@
package authsvc package authsvc
import ( import (
staffrepository "github.com/ardeman/project-legalgo-go/internal/accessor/staff" staffrepository "legalgo-BE-go/internal/accessor/staff"
subscriberepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribe" subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
subscribeplanrepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribeplan" subscribeplanrepository "legalgo-BE-go/internal/accessor/subscribeplan"
userrepository "github.com/ardeman/project-legalgo-go/internal/accessor/user_repository" userrepository "legalgo-BE-go/internal/accessor/user_repository"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
) )
type AuthSvc struct { type AuthSvc struct {

View File

@ -3,8 +3,8 @@ package authsvc
import ( import (
"errors" "errors"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
) )
func (sv *AuthSvc) LoginAsStaff(spec authdomain.LoginReq) (string, error) { func (sv *AuthSvc) LoginAsStaff(spec authdomain.LoginReq) (string, error) {

View File

@ -3,8 +3,8 @@ package authsvc
import ( import (
"errors" "errors"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
) )
func (a *AuthSvc) LoginAsUser(spec authdomain.LoginReq) (string, error) { func (a *AuthSvc) LoginAsUser(spec authdomain.LoginReq) (string, error) {

View File

@ -3,8 +3,9 @@ package authsvc
import ( import (
"errors" "errors"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -3,8 +3,9 @@ package authsvc
import ( import (
"errors" "errors"
authdomain "github.com/ardeman/project-legalgo-go/internal/domain/auth" authdomain "legalgo-BE-go/internal/domain/auth"
"github.com/ardeman/project-legalgo-go/internal/utilities/utils" "legalgo-BE-go/internal/utilities/utils"
"github.com/google/uuid" "github.com/google/uuid"
) )

View File

@ -3,7 +3,8 @@ package cachingsvc
import ( import (
"context" "context"
cachingdomain "github.com/ardeman/project-legalgo-go/internal/domain/caching" cachingdomain "legalgo-BE-go/internal/domain/caching"
"github.com/redis/go-redis/v9" "github.com/redis/go-redis/v9"
) )

View File

@ -4,8 +4,9 @@ import (
"context" "context"
"encoding/json" "encoding/json"
cachingdomain "github.com/ardeman/project-legalgo-go/internal/domain/caching" cachingdomain "legalgo-BE-go/internal/domain/caching"
"github.com/ardeman/project-legalgo-go/internal/utilities/response" "legalgo-BE-go/internal/utilities/response"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -1,9 +1,10 @@
package services package services
import ( import (
serviceauth "github.com/ardeman/project-legalgo-go/internal/services/auth" serviceauth "legalgo-BE-go/internal/services/auth"
subscribesvc "github.com/ardeman/project-legalgo-go/internal/services/subscribe" subscribesvc "legalgo-BE-go/internal/services/subscribe"
subscribeplansvc "github.com/ardeman/project-legalgo-go/internal/services/subscribe_plan" subscribeplansvc "legalgo-BE-go/internal/services/subscribe_plan"
"go.uber.org/fx" "go.uber.org/fx"
) )

View File

@ -1,6 +1,6 @@
package subscribesvc package subscribesvc
import subscriberepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribe" import subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
type SubsSvc struct { type SubsSvc struct {
subsRepo subscriberepository.SubsIntf subsRepo subscriberepository.SubsIntf

View File

@ -1,6 +1,6 @@
package subscribeplansvc package subscribeplansvc
import subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" import subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
func (sb *SubsPlanSvc) CreatePlan(spec subscribeplandomain.SubscribePlanReq) error { func (sb *SubsPlanSvc) CreatePlan(spec subscribeplandomain.SubscribePlanReq) error {
return sb.subsAccs.Create(spec) return sb.subsAccs.Create(spec)

View File

@ -1,7 +1,7 @@
package subscribeplansvc package subscribeplansvc
import ( import (
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
) )
func (s *SubsPlanSvc) GetAllPlan() ([]subscribeplandomain.SubscribePlan, error) { func (s *SubsPlanSvc) GetAllPlan() ([]subscribeplandomain.SubscribePlan, error) {

View File

@ -1,8 +1,8 @@
package subscribeplansvc package subscribeplansvc
import ( import (
subscribeplanrepository "github.com/ardeman/project-legalgo-go/internal/accessor/subscribeplan" subscribeplanrepository "legalgo-BE-go/internal/accessor/subscribeplan"
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan" subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
) )
type SubsPlanSvc struct { type SubsPlanSvc struct {

View File

@ -3,7 +3,8 @@ package utils
import ( import (
"time" "time"
timeutils "github.com/ardeman/project-legalgo-go/internal/utilities/time_utils" timeutils "legalgo-BE-go/internal/utilities/time_utils"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"
) )

View File

@ -1,4 +1,4 @@
openapi: 3.0.0 openapi: 3.1.0
info: info:
title: Staff and User API title: Staff and User API
version: 1.0.0 version: 1.0.0