123456789101112131415161718192021222324252627282930313233 |
- package models
- import "eta_gn/eta_api/global"
- type ApiUriTest struct {
- ApiUri string `gorm:"column:api_uri"`
- ParentUri string `gorm:"column:parent_uri"`
- Method string `gorm:"column:method"`
- Description string `gorm:"column:description"`
- MenuId string `gorm:"column:menu_id"`
- ParentMenu string `gorm:"column:parent_menu"` // 一级菜单
- ChildMenu string `gorm:"column:child_menu"` // 二级菜单
- ButtonName string `gorm:"column:button_name"` // 按钮名称
- Id int `gorm:"column:id;primaryKey"` // `orm:"column(id);pk"`
- IsPublic int `gorm:"column:is_public"` // 是否公共api,0否,1是
- ChildChildMenu string `gorm:"column:child_child_menu"` // 三级菜单
- }
- func GetApiUriTest() (items []*ApiUriTest, err error) {
- err = global.DEFAULT_DmSQL.Raw("SELECT * FROM api_uri_test").Find(&items).Error
- //o := orm.NewOrmUsingDB("weekly")
- //sql := ` SELECT * FROM api_uri_test `
- //_, err = o.Raw(sql).QueryRows(&items)
- return
- }
- func UpdateApiUriTest(api string, menuId int) (err error) {
- err = global.DEFAULT_DmSQL.Exec("UPDATE sys_menu SET api = ? where menu_id = ?", api, menuId).Error
- //o := orm.NewOrm()
- //sql := ` UPDATE sys_menu SET api = ? where menu_id = ?`
- //_, err = o.Raw(sql, api, menuId).Exec()
- return
- }
|