24 lines
410 B
Go
24 lines
410 B
Go
package model
|
|
|
|
import (
|
|
"lone-services/pkg/modelbase"
|
|
"lone-services/services/product/internal/dao"
|
|
)
|
|
|
|
type ProductModel struct {
|
|
modelbase.Base
|
|
}
|
|
|
|
func (m ProductModel) TableName() string {
|
|
return modelbase.Prefix() + "product"
|
|
}
|
|
|
|
func (m ProductModel) Init() ProductModel {
|
|
m.Table = m.TableName()
|
|
return m
|
|
}
|
|
|
|
func (m ProductModel) Create(data *dao.ProductCreate) error {
|
|
return m.Base.Create(data)
|
|
}
|