mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-09-26 20:11:20 +08:00
34 lines
584 B
Go
34 lines
584 B
Go
package dao
|
|
|
|
import (
|
|
"msm/model"
|
|
)
|
|
|
|
type pushDao struct{}
|
|
|
|
var PushDao = new(pushDao)
|
|
|
|
func (p *pushDao) GetPushList() (result []model.Push) {
|
|
db.Find(&result)
|
|
return
|
|
}
|
|
|
|
func (p *pushDao) GetPushConfigById(id int) (result model.Push) {
|
|
db.Where("id = ?", id).First(&result)
|
|
return
|
|
}
|
|
|
|
func (p *pushDao) UpdatePushConfig(data model.Push) error {
|
|
return db.Save(&data).Error
|
|
}
|
|
|
|
func (p *pushDao) AddPushConfig(data model.Push) error {
|
|
return db.Create(&data).Error
|
|
}
|
|
|
|
func (p *pushDao) DeletePushConfig(id int) error {
|
|
return db.Delete(&model.Push{
|
|
Id: int64(id),
|
|
}).Error
|
|
}
|