33 lines
492 B
Go
33 lines
492 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/modules/config/model"
|
|
)
|
|
|
|
type BossService struct {
|
|
*cool.Service
|
|
}
|
|
|
|
func NewBossService() *BossService {
|
|
return &BossService{
|
|
&cool.Service{
|
|
Model: model.NewBossConfig(),
|
|
PageQueryOp: &cool.QueryOp{
|
|
KeyWordField: []string{"desc"},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
func (s *BossService) Get(id uint32) *model.BossConfig {
|
|
if id == 0 {
|
|
return nil
|
|
}
|
|
var item *model.BossConfig
|
|
dbm_fix(s.Model).Where("id", id).Scan(&item)
|
|
|
|
return item
|
|
|
|
}
|