Add AI home cam baby-watching state API (WATCHING / NOTWATCHING)#8
Draft
Add AI home cam baby-watching state API (WATCHING / NOTWATCHING)#8
Conversation
Agent-Logs-Url: https://github.com/jowh324/BBS/sessions/59e68de0-17d8-4cfe-8174-587105722157 Co-authored-by: hgjwilly-koreatech <183201303+hgjwilly-koreatech@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
hgjwilly-koreatech
March 30, 2026 12:14
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a singleton state resource to track whether the AI home cam is actively observing the baby, with JWT-authenticated GET and PUT endpoints.
New files
Entity/CamStateType— enum withWATCHING/NOTWATCHINGvaluesEntity/CamState— JPA entity; singleton row (id = 1), stores@Enumerated(EnumType.STRING)state +updatedAtRepository/CamStateRepository— standardJpaRepository<CamState, Long>DTO/CamStateDTOs—UpdateRequest(@NotNull CamStateType state) andStateResponse(state,updatedAt)Service/CamStateService— upserts the singleton row;getState()returnsNOTWATCHING/nullas logical default when no row exists (no write on read)controller/CamStateController—GET /api/cam/stateandPUT /api/cam/stateAuth
Both endpoints fall under the existing
.anyRequest().authenticated()catch-all inSecurityConfig— no config changes needed. Unauthenticated requests get the standard 401 response.API