Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular Refactoring #491

Merged
merged 10 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions api/schemas/objectbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,210 +4,210 @@
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
"entities": [
{
"id": "1:4508028933515523414",
"lastPropertyId": "13:5569629325911720184",
"id": "1:3544801173480775772",
"lastPropertyId": "13:3755368355153819967",
"name": "CalibrationFrameEntity",
"properties": [
{
"id": "1:279471804400581871",
"id": "1:6440158350156700816",
"name": "id",
"type": 6,
"flags": 1
},
{
"id": "2:9048727858630632737",
"id": "2:7830549305901803879",
"name": "type",
"indexId": "1:3018423918314968566",
"indexId": "1:3705837194399110688",
"type": 5,
"flags": 8
},
{
"id": "3:5712791023807889534",
"name": "name",
"indexId": "2:8432810603549739468",
"id": "3:8490362500884478696",
"name": "group",
"indexId": "2:2460719507268221169",
"type": 9,
"flags": 2048
},
{
"id": "4:3434117744352502900",
"id": "4:169758157435742191",
"name": "filter",
"type": 9
},
{
"id": "5:1871034143652415809",
"id": "5:5772177826523179837",
"name": "exposureTime",
"type": 6
},
{
"id": "6:8846123268014704509",
"id": "6:979735190507089416",
"name": "temperature",
"type": 8
},
{
"id": "7:8561154143050278063",
"id": "7:1567591787936780727",
"name": "width",
"type": 5
},
{
"id": "8:6920579444153489022",
"id": "8:804894592407875320",
"name": "height",
"type": 5
},
{
"id": "9:4300769060778976734",
"id": "9:7150567366206966047",
"name": "binX",
"type": 5
},
{
"id": "10:4693474237106002327",
"id": "10:6904147472104067341",
"name": "binY",
"type": 5
},
{
"id": "11:8369728096653684761",
"id": "11:5805422636156073861",
"name": "gain",
"type": 8
},
{
"id": "12:617052828938607363",
"id": "12:3861144650886065321",
"name": "path",
"type": 9
},
{
"id": "13:5569629325911720184",
"id": "13:3755368355153819967",
"name": "enabled",
"type": 1
}
],
"relations": []
},
{
"id": "2:4800249862026080527",
"lastPropertyId": "3:211299529025119304",
"id": "2:5695036645028998704",
"lastPropertyId": "3:5935807626551879093",
"name": "PreferenceEntity",
"properties": [
{
"id": "1:3593540058272630983",
"id": "1:1241938942467328378",
"name": "id",
"type": 6,
"flags": 1
},
{
"id": "2:2699303611424729430",
"id": "2:5066364999797986961",
"name": "key",
"indexId": "3:2030544424571300028",
"indexId": "3:361394127200064680",
"type": 9,
"flags": 34848
},
{
"id": "3:211299529025119304",
"id": "3:5935807626551879093",
"name": "value",
"type": 9
}
],
"relations": []
},
{
"id": "3:9190695617085753667",
"lastPropertyId": "4:411434182698925224",
"id": "3:13725857459345728",
"lastPropertyId": "4:8575761112465612996",
"name": "SatelliteEntity",
"properties": [
{
"id": "1:7748265871438465999",
"id": "1:7008444193321057279",
"name": "id",
"type": 6,
"flags": 129
},
{
"id": "2:2980713713220488130",
"id": "2:7254931361809919912",
"name": "name",
"type": 9
},
{
"id": "3:8036745814034214740",
"id": "3:7655077553453802998",
"name": "tle",
"type": 9
},
{
"id": "4:411434182698925224",
"id": "4:8575761112465612996",
"name": "groups",
"type": 30
}
],
"relations": []
},
{
"id": "4:6299583728620001761",
"lastPropertyId": "12:4179508964623201115",
"id": "4:2355261488865870711",
"lastPropertyId": "12:8881688937650635468",
"name": "SimbadEntity",
"properties": [
{
"id": "1:7284883107181783588",
"id": "1:8754753767317947963",
"name": "id",
"type": 6,
"flags": 129
},
{
"id": "2:1059978401562504177",
"id": "2:875189598014282513",
"name": "name",
"type": 9
},
{
"id": "3:2238737597611607433",
"id": "3:1840539013499888018",
"name": "type",
"type": 5
},
{
"id": "4:6034348124979703831",
"id": "4:8380920369067256416",
"name": "rightAscensionJ2000",
"type": 8
},
{
"id": "5:6603670815168137185",
"id": "5:4114744755808135895",
"name": "declinationJ2000",
"type": 8
},
{
"id": "6:4798847469480514750",
"id": "6:5877086147655445788",
"name": "magnitude",
"type": 8
},
{
"id": "7:4280564484498302769",
"id": "7:4614518058111040649",
"name": "pmRA",
"type": 8
},
{
"id": "8:1070997648386390650",
"id": "8:5619165542749552220",
"name": "pmDEC",
"type": 8
},
{
"id": "9:7408560810497672822",
"id": "9:8196290885692683478",
"name": "parallax",
"type": 8
},
{
"id": "10:7464931444484734827",
"id": "10:2681231197677728845",
"name": "radialVelocity",
"type": 8
},
{
"id": "11:531497562996887037",
"id": "11:2414643968839286765",
"name": "redshift",
"type": 8
},
{
"id": "12:4179508964623201115",
"id": "12:8881688937650635468",
"name": "constellation",
"type": 5
}
],
"relations": []
}
],
"lastEntityId": "4:6299583728620001761",
"lastIndexId": "3:2030544424571300028",
"lastEntityId": "4:2355261488865870711",
"lastIndexId": "3:361394127200064680",
"lastRelationId": "0:0",
"lastSequenceId": "0:0",
"modelVersion": 5,
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/kotlin/nebulosa/api/atlas/MinorPlanet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data class MinorPlanet(
@JvmField val neo: Boolean = false,
@JvmField val orbitType: String = "",
@JvmField val parameters: List<OrbitalPhysicalParameter> = emptyList(),
@JvmField val searchItems: List<SearchItem> = emptyList(),
@JvmField val list: List<SearchItem> = emptyList(),
) {

data class OrbitalPhysicalParameter(
Expand Down Expand Up @@ -60,8 +60,8 @@ data class MinorPlanet(
body.body!!.pha, body.body!!.neo, body.body?.type?.name ?: "", items,
)
} else if (body.list != null) {
val searchItems = body.list!!.map { SearchItem(it.name, it.pdes) }
return MinorPlanet(searchItems = searchItems)
val list = body.list!!.map { SearchItem(it.name, it.pdes) }
return MinorPlanet(list = list)
} else {
return EMPTY
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package nebulosa.api.beans.annotations

import org.springframework.context.annotation.Lazy

@Retention
@Lazy(false)
@Target(AnnotationTarget.CLASS)
annotation class Subscriber
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package nebulosa.api.beans.converters.angle

@Retention
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class AngleParam(
val name: String = "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nebulosa.api.beans.converters.device

@Target(AnnotationTarget.VALUE_PARAMETER)
@Retention(AnnotationRetention.RUNTIME)
annotation class DeviceOrEntityParam(
val name: String = "",
val defaultValue: String = ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package nebulosa.api.beans.converters.location

@Retention
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class LocationParam
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package nebulosa.api.beans.converters.time

@Retention
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class DateAndTimeParam(
val datePattern: String = "yyyy-MM-dd",
val timePattern: String = "HH:mm",
val timePattern: String = "HH:mm:ss",
val noSeconds: Boolean = true,
val nullable: Boolean = false,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nebulosa.api.calibration

import jakarta.validation.Valid
import jakarta.validation.constraints.NotBlank
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*
import java.nio.file.Path
Expand All @@ -16,26 +15,24 @@ class CalibrationFrameController(
@GetMapping
fun groups() = calibrationFrameService.groups()

@GetMapping("{name}")
fun groupedCalibrationFrames(@PathVariable name: String): List<CalibrationFrameGroup> {
var id = 0
val groupedFrames = calibrationFrameService.groupedCalibrationFrames(name)
return groupedFrames.map { CalibrationFrameGroup(++id, name, it.key, it.value) }
@GetMapping("{group}")
fun frames(@PathVariable group: String): List<CalibrationFrameEntity> {
return calibrationFrameService.frames(group).sorted()
}

@PutMapping("{name}")
fun upload(@PathVariable name: String, @RequestParam path: Path): List<CalibrationFrameEntity> {
return calibrationFrameService.upload(name, path)
@PutMapping("{group}")
fun upload(@PathVariable group: String, @RequestParam path: Path): List<CalibrationFrameEntity> {
return calibrationFrameService.upload(group, path)
}

@PatchMapping("{frame}")
fun edit(
frame: CalibrationFrameEntity,
@Valid @NotBlank @RequestParam name: String, @RequestParam enabled: Boolean,
) = calibrationFrameService.edit(frame, name, enabled)
@PostMapping
fun update(@RequestBody @Valid body: CalibrationFrameEntity): CalibrationFrameEntity {
require(body.id > 0L) { "invalid frame id" }
return calibrationFrameService.edit(body)
}

@DeleteMapping("{frame}")
fun delete(frame: CalibrationFrameEntity) {
calibrationFrameService.delete(frame)
@DeleteMapping("{id}")
fun delete(@PathVariable id: Long) {
calibrationFrameService.delete(id)
}
}
Loading