GetPluginConfByUserAndPath gets plugin configuration by user and file name.
(userid uint, path string)
| 17 | |
| 18 | // GetPluginConfByUserAndPath gets plugin configuration by user and file name. |
| 19 | func (d *GormDatabase) GetPluginConfByUserAndPath(userid uint, path string) (*model.PluginConf, error) { |
| 20 | plugin := new(model.PluginConf) |
| 21 | err := d.DB.Where("user_id = ? AND module_path = ?", userid, path).First(plugin).Error |
| 22 | if err == gorm.ErrRecordNotFound { |
| 23 | err = nil |
| 24 | } |
| 25 | if plugin.ModulePath == path { |
| 26 | return plugin, err |
| 27 | } |
| 28 | return nil, err |
| 29 | } |
| 30 | |
| 31 | // GetPluginConfByApplicationID gets plugin configuration by its internal appid. |
| 32 | func (d *GormDatabase) GetPluginConfByApplicationID(appid uint) (*model.PluginConf, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected