package service
|
|
import (
|
"apsClient/model"
|
)
|
|
type ConfigService struct {
|
}
|
|
func NewConfigService() *ConfigService {
|
return &ConfigService{}
|
}
|
|
// GetNetConfigList 获取网络配置列表
|
func (slf ConfigService) GetNetConfigList() (ConfigData []*model.NetConfig, err error) {
|
return model.NewNetConfigSearch(nil).FindNotTotal()
|
}
|
|
// GetNetConfig 获取网络配置
|
func (slf ConfigService) GetNetConfig(id uint) (ConfigData *model.NetConfig, err error) {
|
return model.NewNetConfigSearch(nil).SetId(id).First()
|
}
|
|
// SetNetConfig 设置网络配置
|
func (slf ConfigService) SetNetConfig(id uint, config *model.NetConfig) error {
|
return model.NewNetConfigSearch(nil).SetId(id).Save(config)
|
}
|