Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
22
pkg/db/queries/car_config_data.go
Normal file
22
pkg/db/queries/car_config_data.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package queries
|
||||
|
||||
import (
|
||||
"fiskerinc.com/modules/common"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type CarConfigDataInterface interface {
|
||||
SelectByVIN(vin string) (common.CarConfigData, error)
|
||||
}
|
||||
|
||||
type CarConfigData struct {
|
||||
QueryBase
|
||||
}
|
||||
|
||||
func (c *CarConfigData) SelectByVIN(vin string) (common.CarConfigData, error) {
|
||||
config := common.CarConfigData{}
|
||||
|
||||
err := c.GetDBConn().Model(&config).Where("vin = ?", vin).Select()
|
||||
|
||||
return config, errors.WithStack(err)
|
||||
}
|
||||
Reference in New Issue
Block a user