Skip to content
Open
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
2 changes: 2 additions & 0 deletions task-1/AnalyticsAPI/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
33 changes: 33 additions & 0 deletions task-1/AnalyticsAPI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
3 changes: 3 additions & 0 deletions task-1/AnalyticsAPI/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
71 changes: 71 additions & 0 deletions task-1/AnalyticsAPI/API_DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Analytics API Design

## Create Record

POST /analytics

Request

{
"eventType": "LOGIN",
"eventSource": "WEB",
"sessionId": "ABC123"
}

Response: 200 OK

---

## List Records

GET /analytics

Filters:
GET /analytics?eventType=LOGIN
GET /analytics?eventSource=WEB

Response: 200 OK

---

## Get Record

GET /analytics/{id}

Response: 200 OK
Response: 404 Not Found

---

## Update Record

PUT /analytics/{id}

Response: 200 OK
Response: 404 Not Found

---

## Delete Record

DELETE /analytics/{id}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider returning 204 here or return a body with some additional information.

Response: 200 OK
Response: 404 Not Found

---

## Summary

GET /analytics/summary

Response

{
"totalRecords": 10,
"uniqueSessions": 5,
"eventTotals": {
"LOGIN": 6,
"PURCHASE": 4
}
}
Loading