package mysql import ( "context" "gorm.io/gen" "pji_desktop_http/biz/dal/query" "pji_desktop_http/biz/model" ) func QuerySystemConfig(ctx context.Context) (*model.SystemConfig, error) { r := query.SystemConfig config, err := r.WithContext(ctx).First() if err != nil { return &model.SystemConfig{}, err } return config, nil } func UpdateSystemConfig(ctx context.Context, config *model.SystemConfig) (gen.ResultInfo, error) { r := query.SystemConfig info, err := r.WithContext(ctx).Where(r.DeletedAt.Eq(nil)).Update(r.RescanReminderThreshold, config.RescanReminderThreshold) if err != nil { return info, err } return info, nil }