优化角色创建,新增批量方法

This commit is contained in:
郝大全
2018-08-30 00:01:07 +08:00
parent 51a71930c2
commit dbcc43aab2
2 changed files with 20 additions and 5 deletions

View File

@@ -28,6 +28,10 @@ func RoleAuthAdd(ra *RoleAuth) (int64, error) {
return orm.NewOrm().Insert(ra)
}
func RoleAuthBatchAdd(ras *[]RoleAuth) (int64, error) {
return orm.NewOrm().InsertMulti(100, ras)
}
func RoleAuthGetById(id int) ([]*RoleAuth, error) {
list := make([]*RoleAuth, 0)
query := orm.NewOrm().QueryTable(TableName("uc_role_auth"))