You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
376 B
24 lines
376 B
4 years ago
|
package models
|
||
|
|
||
|
import (
|
||
|
"github.com/beego/beego/v2/client/orm"
|
||
|
)
|
||
|
|
||
|
type SysUsersRoles struct {
|
||
|
Id int64
|
||
|
UserId *SysUser `orm:"column(user_id);rel(fk)"`
|
||
|
RoleId *SysRole `orm:"column(role_id);rel(fk)"`
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
orm.RegisterModel(new(SysUsersRoles))
|
||
|
}
|
||
|
|
||
|
func AddUserRole(m *SysUsersRoles) (id int64, err error) {
|
||
|
o := orm.NewOrm()
|
||
|
id, err = o.Insert(m)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
|