增加了bus 增加了分块区滚动 增加了table 增加了分页 修改了某些分页接口 角色增删
This commit is contained in:
@@ -3,12 +3,14 @@ package dbModel
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/pkg/errors"
|
||||
"main/controller/servers"
|
||||
"main/init/qmsql"
|
||||
"main/model/modelInterface"
|
||||
)
|
||||
|
||||
type Authority struct {
|
||||
gorm.Model `json:"-"`
|
||||
AuthorityId uint `json:"authorityId" gorm:"not null;unique"`
|
||||
AuthorityId string `json:"authorityId" gorm:"not null;unique"`
|
||||
AuthorityName string `json:"authorityName"`
|
||||
}
|
||||
|
||||
@@ -28,3 +30,18 @@ func (a *Authority) DeleteAuthority() (err error) {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 分页获取数据 需要分页实现这个接口即可
|
||||
func (a *Authority) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
|
||||
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
|
||||
err, db, total := servers.PagingServer(a, info)
|
||||
if err != nil {
|
||||
return
|
||||
} else {
|
||||
var authority []Authority
|
||||
err = db.Find(&authority).Error
|
||||
return err, authority, total
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user