예제 #1
0
func GetPluginSettings(query *m.GetPluginSettingsQuery) error {
	sql := `SELECT org_id, plugin_id, enabled, pinned
					FROM plugin_setting
					WHERE org_id=?`

	sess := x.Sql(sql, query.OrgId)
	query.Result = make([]*m.PluginSettingInfoDTO, 0)
	return sess.Find(&query.Result)
}
예제 #2
0
func GetPluginSettings(query *m.GetPluginSettingsQuery) error {
	sql := `SELECT org_id, plugin_id, enabled, pinned, plugin_version
					FROM plugin_setting `
	params := make([]interface{}, 0)

	if query.OrgId != 0 {
		sql += "WHERE org_id=?"
		params = append(params, query.OrgId)
	}

	sess := x.Sql(sql, params...)
	query.Result = make([]*m.PluginSettingInfoDTO, 0)
	return sess.Find(&query.Result)
}