This commit is contained in:
32
modules/config/service/egg.go
Normal file
32
modules/config/service/egg.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/model"
|
||||
)
|
||||
|
||||
type EggService struct {
|
||||
*cool.Service
|
||||
}
|
||||
|
||||
func NewEggService() *EggService {
|
||||
return &EggService{
|
||||
&cool.Service{
|
||||
Model: model.NewEgg(),
|
||||
PageQueryOp: &cool.QueryOp{
|
||||
KeyWordField: []string{"desc"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (s *EggService) Get(id uint32) *model.Egg {
|
||||
if id == 0 {
|
||||
return nil
|
||||
}
|
||||
var item *model.Egg
|
||||
dbm(s.Model).Where("id", id).Scan(&item)
|
||||
|
||||
return item
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user