update openapi
This commit is contained in:
59
.env_example
Normal file
59
.env_example
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
SERVER_PORT=3000
|
||||||
|
SERVER_HOST=0.0.0.0
|
||||||
|
|
||||||
|
# Database Configuration
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_USER=root
|
||||||
|
DB_PASSWORD=Maal12345678
|
||||||
|
DB_NAME=nalu
|
||||||
|
PROJECT_NAME=nalu_b2b
|
||||||
|
DB_SERVICE_NAME=nalu_b2b
|
||||||
|
DB_SSLMODE=disable
|
||||||
|
|
||||||
|
# App COnfig
|
||||||
|
APP_NAME="B2b Management System"
|
||||||
|
APP_VERSION=2.1.0
|
||||||
|
APP_ENVIRONMENT=development
|
||||||
|
|
||||||
|
# JWT Configuration
|
||||||
|
AUTH_JWT_SECRET=5c020e6ed3d8d6e67e5804d67c83c4bd5ae474df749af6d63d8f20e7e2ba29b3
|
||||||
|
AUTH_JWT_EXPIRATION=86400
|
||||||
|
AUTH_REFRESH_EXPIRATION=604800
|
||||||
|
|
||||||
|
# Meili search
|
||||||
|
MEILISEARCH_URL=http://localhost:7700
|
||||||
|
MEILISEARCH_API_KEY=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||||
|
|
||||||
|
# OpenAI
|
||||||
|
OPENAI_KEY=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
|
||||||
|
|
||||||
|
# Google Translate Client
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS=./google-cred.json
|
||||||
|
GOOGLE_CLOUD_PROJECT_ID=translation-343517
|
||||||
|
|
||||||
|
# Google OAuth2
|
||||||
|
OAUTH_GOOGLE_CLIENT_ID=331979954218-9vrpe08oqhhcgj6bvu6d4lds0dt630m9.apps.googleusercontent.com
|
||||||
|
OAUTH_GOOGLE_CLIENT_SECRET=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
|
||||||
|
OAUTH_GOOGLE_REDIRECT_URL=http://localhost:3000/api/v1/public/auth/google/callback
|
||||||
|
|
||||||
|
# Email Configuration (SMTP)
|
||||||
|
# Set EMAIL_ENABLED=true to require email verification
|
||||||
|
EMAIL_ENABLED=true
|
||||||
|
EMAIL_SMTP_HOST=mail.ma-al.com
|
||||||
|
EMAIL_SMTP_PORT=587
|
||||||
|
EMAIL_SMTP_USER=test@ma-al.com
|
||||||
|
EMAIL_SMTP_PASSWORD=maal12345678
|
||||||
|
EMAIL_FROM=test@ma-al.com
|
||||||
|
EMAIL_FROM_NAME=Gitea Manager
|
||||||
|
EMAIL_ADMIN=goc_marek@ma-al.pl
|
||||||
|
|
||||||
|
I18N_LANGS=en,pl,cs
|
||||||
|
|
||||||
|
PDF_SERVER_URL=http://localhost:8000
|
||||||
|
|
||||||
|
|
||||||
|
FILE_MAAL_PL_USER=git_operator
|
||||||
|
FILE_MAAL_PL_PASSWORD=1FnwqcEgIUjQHjt1
|
||||||
|
|
||||||
|
IMAGE_PREFIX=https://www.naluconcept.com # remove prefix to serv them from same host as presta
|
||||||
@@ -9,3 +9,16 @@ type Country struct {
|
|||||||
CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"`
|
CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"`
|
||||||
CurrencyName string `gorm:"column:name" json:"currency_name"`
|
CurrencyName string `gorm:"column:name" json:"currency_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (Country) TableName() string {
|
||||||
|
return "b2b_countries"
|
||||||
|
}
|
||||||
|
|
||||||
|
type PSCountry struct {
|
||||||
|
ID uint `gorm:"primaryKey;column:id_country" json:"id"`
|
||||||
|
CurrencyID uint `gorm:"column:id_currency" json:"currency_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (PSCountry) TableName() string {
|
||||||
|
return "ps_country"
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,12 +30,22 @@ func (repo *CategoriesRepo) GetAllCategories(id_lang uint) ([]model.ScannedCateg
|
|||||||
ps_category.is_root_category AS is_root_category,
|
ps_category.is_root_category AS is_root_category,
|
||||||
ps_category_lang.link_rewrite AS link_rewrite,
|
ps_category_lang.link_rewrite AS link_rewrite,
|
||||||
ps_lang.iso_code AS iso_code
|
ps_lang.iso_code AS iso_code
|
||||||
FROM ps_category
|
`).
|
||||||
LEFT JOIN ps_category_lang ON ps_category_lang.id_category = ps_category.id_category AND ps_category_lang.id_shop = ? AND ps_category_lang.id_lang = ?
|
Joins(`
|
||||||
LEFT JOIN ps_category_shop ON ps_category_shop.id_category = ps_category.id_category AND ps_category_shop.id_shop = ?
|
LEFT JOIN ps_category_lang
|
||||||
JOIN ps_lang ON ps_lang.id_lang = ps_category_lang.id_lang
|
ON ps_category_lang.id_category = ps_category.id_category
|
||||||
`,
|
AND ps_category_lang.id_shop = ?
|
||||||
constdata.SHOP_ID, id_lang, constdata.SHOP_ID).
|
AND ps_category_lang.id_lang = ?
|
||||||
|
`, constdata.SHOP_ID, id_lang).
|
||||||
|
Joins(`
|
||||||
|
LEFT JOIN ps_category_shop
|
||||||
|
ON ps_category_shop.id_category = ps_category.id_category
|
||||||
|
AND ps_category_shop.id_shop = ?
|
||||||
|
`, constdata.SHOP_ID).
|
||||||
|
Joins(`
|
||||||
|
JOIN ps_lang
|
||||||
|
ON ps_lang.id_lang = ps_category_lang.id_lang
|
||||||
|
`).
|
||||||
Scan(&allCategories).Error
|
Scan(&allCategories).Error
|
||||||
|
|
||||||
return allCategories, err
|
return allCategories, err
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ func (repo *LocaleSelectorRepo) GetLanguages() ([]model.Language, error) {
|
|||||||
func (repo *LocaleSelectorRepo) GetCountriesAndCurrencies() ([]model.Country, error) {
|
func (repo *LocaleSelectorRepo) GetCountriesAndCurrencies() ([]model.Country, error) {
|
||||||
var countries []model.Country
|
var countries []model.Country
|
||||||
|
|
||||||
err := db.DB.Table("b2b_countries").
|
err := db.DB.
|
||||||
Select("b2b_countries.id, b2b_countries.name, b2b_countries.flag, ps_currency.id as id_currency, ps_currency.name as currency_name, ps_currency.iso_code as currency_iso_code").
|
Select("b2b_countries.id, b2b_countries.name, b2b_countries.flag, ps_currency.id_currency as id_currency, ps_currency.name as currency_name, ps_currency.iso_code as currency_iso_code").
|
||||||
Joins("JOIN ps_currency ON ps_currency.id = b2b_countries.currency").
|
Joins("JOIN ps_currency ON ps_currency.id_currency = b2b_countries.currency").
|
||||||
Scan(&countries).Error
|
Scan(&countries).Error
|
||||||
|
|
||||||
return countries, err
|
return countries, err
|
||||||
|
|||||||
Reference in New Issue
Block a user