refactor🎨 部分功能重写

This commit is contained in:
wenjianzhang committed 2021-05-21 18:25:51 +08:00
1 parent 765775c54d
commit 408dcc5057
28 files changed
+649 -982

No files matched your search

+4 -5
View File
@@ -41,7 +41,6 @@ func (e *SysApi) GetSysApiPage(c *dto.SysApiSearch, p *actions.DataPermission, l
// GetSysApi 获取SysApi对象
func (e *SysApi) GetSysApi(d *dto.SysApiById, p *actions.DataPermission, model *models.SysApi) *SysApi {
var data models.SysApi
err := e.Orm.Model(&data).
Scopes(
actions.Permission(data.TableName(), p),
@@ -50,18 +49,18 @@ func (e *SysApi) GetSysApi(d *dto.SysApiById, p *actions.DataPermission, model *
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
err = errors.New("查看对象不存在或无权查看")
e.Log.Errorf("Service GetSysApi error:%s", err)
e.AddError(err)
_ = e.AddError(err)
return e
}
if err != nil {
e.Log.Errorf("db error:%s", err)
e.AddError(err)
_ = e.AddError(err)
return e
}
return nil
return e
}
// InsertSysApi 创建SysApi对象
// CheckStorageSysApi 创建SysApi对象
func (e *SysApi) CheckStorageSysApi(c *[]runtime.Router) error {
for _, v := range *c {
err := e.Orm.Debug().Where(models.SysApi{Path: v.RelativePath, Action: v.HttpMethod}).