api_uri.go 827 B

12345678910111213141516171819202122232425262728293031
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type ApiUriTest struct {
  4. ApiUri string
  5. ParentUri string
  6. Method string
  7. Description string
  8. MenuId string
  9. ParentMenu string // 一级菜单
  10. ChildMenu string // 二级菜单
  11. ButtonName string // 按钮名称
  12. Id int `orm:"column(id);pk"`
  13. IsPublic int // 是否公共api,0否,1是
  14. ChildChildMenu string // 三级菜单
  15. }
  16. func GetApiUriTest() (items []*ApiUriTest, err error) {
  17. o := orm.NewOrmUsingDB("weekly")
  18. sql := ` SELECT * FROM api_uri_test `
  19. _,err = o.Raw(sql).QueryRows(&items)
  20. return
  21. }
  22. func UpdateApiUriTest(api string, menuId int) (err error) {
  23. o := orm.NewOrm()
  24. sql := ` UPDATE sys_menu SET api = ? where menu_id = ?`
  25. _, err = o.Raw(sql, api, menuId).Exec()
  26. return
  27. }