feat: creat main products query
This commit is contained in:
25
app/model/currency.go
Normal file
25
app/model/currency.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Currency struct {
|
||||
ID int `json:"id"`
|
||||
PsIDCurrency uint `json:"ps_id_currency"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
IsActive bool `json:"is_active"`
|
||||
ConversionRate *float64 `json:"conversion_rate,omitempty"`
|
||||
}
|
||||
|
||||
func (Currency) TableName() string {
|
||||
return "b2b_currencies"
|
||||
}
|
||||
|
||||
type CurrencyRate struct {
|
||||
B2bIdCurrency uint `json:"b2b_id_currency"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ConversionRate *float64 `json:"conversion_rate,omitempty"`
|
||||
}
|
||||
|
||||
func (CurrencyRate) TableName() string {
|
||||
return "b2b_currency_rates"
|
||||
}
|
||||
18
app/model/model.go
Normal file
18
app/model/model.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
ID uint `gorm:"primarykey;autoIncrement" swaggerignore:"true" json:"id,omitempty" hidden:"true"`
|
||||
CreatedAt time.Time `gorm:"not null;autoCreateTime" swaggerignore:"true" json:"-"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" swaggerignore:"true" json:"-"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" swaggerignore:"true" json:"-"`
|
||||
}
|
||||
|
||||
// Makes all objects embedding db.Model implementators of ModelWithID interface
|
||||
func (m Model) ModelWithID() {
|
||||
}
|
||||
Reference in New Issue
Block a user