release v1.2.0
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"next-terminal/pkg/guacd"
|
||||
"next-terminal/server/model"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@ -33,6 +32,10 @@ func (r PropertyRepository) UpdateByName(o *model.Property, name string) error {
|
||||
return r.DB.Updates(o).Error
|
||||
}
|
||||
|
||||
func (r PropertyRepository) DeleteByName(name string) error {
|
||||
return r.DB.Where("name = ?", name).Delete(model.Property{}).Error
|
||||
}
|
||||
|
||||
func (r PropertyRepository) FindByName(name string) (o model.Property, err error) {
|
||||
err = r.DB.Where("name = ?", name).First(&o).Error
|
||||
return
|
||||
@ -46,19 +49,3 @@ func (r PropertyRepository) FindAllMap() map[string]string {
|
||||
}
|
||||
return propertyMap
|
||||
}
|
||||
|
||||
func (r PropertyRepository) GetDrivePath() (string, error) {
|
||||
property, err := r.FindByName(guacd.DrivePath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return property.Value, nil
|
||||
}
|
||||
|
||||
func (r PropertyRepository) GetRecordingPath() (string, error) {
|
||||
property, err := r.FindByName(guacd.RecordingPath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return property.Value, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user