fusenapi/model/fsproductmodel3dlightmodel.go
laodaming 9a2f74fe64 fix
2023-06-06 17:36:11 +08:00

39 lines
1.2 KiB
Go
Executable File

package model
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"strings"
)
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
ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error)
}
customFsProductModel3dLightModel struct {
*defaultFsProductModel3dLightModel
}
)
// NewFsProductModel3dLightModel returns a model for the database table.
func NewFsProductModel3dLightModel(conn sqlx.SqlConn) FsProductModel3dLightModel {
return &customFsProductModel3dLightModel{
defaultFsProductModel3dLightModel: newFsProductModel3dLightModel(conn),
}
}
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
}