- temp.
This commit is contained in:
20
business/model/dao/sku.go
Normal file
20
business/model/dao/sku.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/gormdb"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetCategory(ID int, db *gorm.DB) (*model.SkuCategory, error) {
|
||||
if db == nil {
|
||||
db = gormdb.GetDB()
|
||||
}
|
||||
item := &model.SkuCategory{}
|
||||
item.ID = ID
|
||||
err := utils.CallFuncLogError(func() error {
|
||||
return db.First(item).Error
|
||||
}, "GetCategory")
|
||||
return item, err
|
||||
}
|
||||
20
business/model/dao/store.go
Normal file
20
business/model/dao/store.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/gormdb"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetStore(ID int, db *gorm.DB) (*model.Store, error) {
|
||||
if db == nil {
|
||||
db = gormdb.GetDB()
|
||||
}
|
||||
item := &model.Store{}
|
||||
item.ID = ID
|
||||
err := utils.CallFuncLogError(func() error {
|
||||
return db.First(item).Error
|
||||
}, "GetStore")
|
||||
return item, err
|
||||
}
|
||||
Reference in New Issue
Block a user