123456789101112131415161718192021222324252627282930313233 |
- package Warning
- import (
- "ColdP_server/controllers/lib"
- "ColdP_server/logs"
- "github.com/beego/beego/v2/adapter/orm"
- )
- type WarningHandle struct {
- Id int `orm:"column(ID);size(11);auto;pk"`
- T_name string `orm:"size(256);null"` // 报警处理备注
- }
- func (t *WarningHandle) TableName() string {
- return "warning_handle"
- }
- func init() {
- //注册模型
- orm.RegisterModel(new(WarningHandle))
- }
- func Read_WarningHandle_List() (maps []WarningHandle) {
- o := orm.NewOrm()
- qs := o.QueryTable(new(WarningHandle))
- _, err := qs.OrderBy("Id").All(&maps)
- if err != nil {
- logs.Error(lib.FuncName(), err)
- }
- return maps
- }
|