Documentation ¶ Index ¶ type Entity type IUserRole func New() IUserRole Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Entity ¶ type Entity struct { ID int `json:"id"` // 记录ID UserID int `json:"userID" db:"user_id" rel:"t_user.id"` // 用户ID RoleID int `json:"roleID" db:"role_id" rel:"t_role.id"` // 角色ID } Entity 实体-对应数据库表 type IUserRole ¶ type IUserRole interface { Add(ctx context.Context, e Entity) (id int, err error) GetByUserID(ctx context.Context, userID int) (list []Entity, err error) } func New ¶ func New() IUserRole Source Files ¶ View all Source files data.go interface.go user_role.go Click to show internal directories. Click to hide internal directories.