WarningHandle.go 649 B

123456789101112131415161718192021222324252627282930313233
  1. package Warning
  2. import (
  3. "Cold_Api/controllers/lib"
  4. "github.com/beego/beego/v2/adapter/orm"
  5. "github.com/beego/beego/v2/core/logs"
  6. )
  7. type WarningHandle struct {
  8. Id int `orm:"column(ID);size(11);auto;pk"`
  9. T_name string `orm:"size(256);null"` // 报警处理备注
  10. }
  11. func (t *WarningHandle) TableName() string {
  12. return "warning_handle"
  13. }
  14. func init() {
  15. //注册模型
  16. orm.RegisterModel(new(WarningHandle))
  17. }
  18. func Read_WarningHandle_List() (maps []WarningHandle) {
  19. o := orm.NewOrm()
  20. qs := o.QueryTable(new(WarningHandle))
  21. _, err := qs.OrderBy("Id").All(&maps)
  22. if err != nil {
  23. logs.Error(lib.FuncName(), err)
  24. }
  25. return maps
  26. }