2023-06-06 07:01:13 +00:00
|
|
|
package model
|
|
|
|
|
2023-06-06 09:36:11 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
|
|
|
"strings"
|
|
|
|
)
|
2023-06-06 07:01:13 +00:00
|
|
|
|
|
|
|
var _ FsProductModel3dLightModel = (*customFsProductModel3dLightModel)(nil)
|
|
|
|
|
|
|
|
type (
|
|
|
|
// FsProductModel3dLightModel is an interface to be customized, add more methods here,
|
|
|
|
// and implement the added methods in customFsProductModel3dLightModel.
|
|
|
|
FsProductModel3dLightModel interface {
|
|
|
|
fsProductModel3dLightModel
|
2023-06-06 09:36:11 +00:00
|
|
|
ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error)
|
2023-06-06 07:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
customFsProductModel3dLightModel struct {
|
|
|
|
*defaultFsProductModel3dLightModel
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
// NewFsProductModel3dLightModel returns a model for the database table.
|
|
|
|
func NewFsProductModel3dLightModel(conn sqlx.SqlConn) FsProductModel3dLightModel {
|
|
|
|
return &customFsProductModel3dLightModel{
|
|
|
|
defaultFsProductModel3dLightModel: newFsProductModel3dLightModel(conn),
|
|
|
|
}
|
|
|
|
}
|
2023-06-06 09:36:11 +00:00
|
|
|
func (m *defaultFsProductModel3dLightModel) ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error) {
|
|
|
|
query := fmt.Sprintf("select %s from %s where `id` in (?)", fsProductModel3dLightRows, m.table)
|
|
|
|
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","))
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|