23 lines
563 B
Go
23 lines
563 B
Go
|
|
package repository
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"gorm.io/gorm"
|
||
|
|
)
|
||
|
|
|
||
|
|
// RawMaterialRepository 定义了与原料相关的数据库操作接口
|
||
|
|
type RawMaterialRepository interface {
|
||
|
|
}
|
||
|
|
|
||
|
|
// gormRawMaterialRepository 是 RawMaterialRepository 的 GORM 实现
|
||
|
|
type gormRawMaterialRepository struct {
|
||
|
|
ctx context.Context
|
||
|
|
db *gorm.DB
|
||
|
|
}
|
||
|
|
|
||
|
|
// NewGormRawMaterialRepository 创建一个新的 RawMaterialRepository GORM 实现实例
|
||
|
|
func NewGormRawMaterialRepository(ctx context.Context, db *gorm.DB) RawMaterialRepository {
|
||
|
|
return &gormRawMaterialRepository{ctx: ctx, db: db}
|
||
|
|
}
|