123456789101112131415 |
- package db
- import (
- "context"
- "youngee_b_api/model/gorm_model"
- )
- func CreateProduct(ctx context.Context, product gorm_model.YounggeeProduct) (*int, error) {
- db := GetReadDB(ctx)
- err := db.Create(&product).Error
- if err != nil {
- return nil, err
- }
- return &product.ProductID, nil
- }
|