1 Star 0 Fork 0

i-hea / models

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
conf.go 628 Bytes
一键复制 编辑 原始数据 按行查看 历史
Peter 提交于 2021-04-22 18:14 . init
package models
import (
"time"
"github.com/astaxie/beego/orm"
"github.com/pkg/errors"
)
type IpccConfigAsrServ struct {
Id int
Brand string
ServAddr string
Port int
Active bool
CreatTime time.Time
}
func GetAllAsrServs() ([]IpccConfigAsrServ, error) {
var result []IpccConfigAsrServ
o := orm.NewOrm()
o.Using("default")
num, err := o.QueryTable("IpccConfigAsrServ").Filter("Active", true).All(&result)
if err != nil {
return nil, err
}
if 0 == num {
return nil, errors.New("no keys")
}
return result, nil
}
func RegConfAsrServ() {
orm.RegisterModel(new(IpccConfigAsrServ))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/i-hea/models.git
git@gitee.com:i-hea/models.git
i-hea
models
models
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891