ai-first-cli 1.3.1 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai-dev/index.db +0 -0
- package/BETA_EVALUATION_REPORT.md +151 -0
- package/CHANGELOG.md +178 -0
- package/PHASE1_USER_SIMULATION.md +56 -0
- package/PHASE2_USER_SIMULATION.md +81 -0
- package/PHASE3_USER_SIMULATION.md +176 -0
- package/README.es.md +18 -0
- package/README.md +80 -1
- package/ai/graph/knowledge-graph.json +10 -0
- package/ai-context/ai_context.md +130 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/ai_rules.md +10 -5
- package/ai-context/architecture.md +136 -0
- package/ai-context/context/features/src.json +69 -0
- package/ai-context/context/features/test-projects.json +69 -0
- package/ai-context/context/flows/App.json +17 -0
- package/ai-context/context/flows/DashboardPage.json +14 -0
- package/ai-context/context/flows/LoginPage.json +14 -0
- package/ai-context/context/flows/admin.json +10 -0
- package/ai-context/context/flows/ai-first.json +9 -0
- package/ai-context/context/flows/androidresources.json +11 -0
- package/ai-context/context/flows/auth.json +13 -0
- package/ai-context/context/flows/authController.json +14 -0
- package/ai-context/context/flows/doctor.json +9 -0
- package/ai-context/context/flows/entrypoints.json +9 -0
- package/ai-context/context/flows/explore.json +9 -0
- package/ai-context/context/flows/fastapiAdapter.json +14 -0
- package/ai-context/context/flows/fastapiadapter.json +11 -0
- package/ai-context/context/flows/index.json +19 -0
- package/ai-context/context/flows/indexer.json +9 -0
- package/ai-context/context/flows/indexstate.json +9 -0
- package/ai-context/context/flows/init.json +22 -0
- package/ai-context/context/flows/main.json +18 -0
- package/ai-context/context/flows/mainactivity.json +9 -0
- package/ai-context/context/flows/models.json +15 -0
- package/ai-context/context/flows/posts.json +15 -0
- package/ai-context/context/flows/repoMapper.json +20 -0
- package/ai-context/context/flows/repomapper.json +11 -0
- package/ai-context/context/flows/routes.json +15 -0
- package/ai-context/context/flows/serializers.json +10 -0
- package/ai-context/context/flows/user.json +23 -0
- package/ai-context/context/flows/views.json +12 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/conventions.md +3 -2
- package/ai-context/dependencies.json +3360 -0
- package/ai-context/entrypoints.md +45 -0
- package/ai-context/index-state.json +196 -0
- package/ai-context/modules.json +901 -0
- package/ai-context/project.json +33 -0
- package/ai-context/repo_map.json +8857 -0
- package/ai-context/repo_map.md +2002 -0
- package/{test-projects/flask-app/.ai-dev → ai-context}/schema.json +1 -1
- package/ai-context/summary.md +46 -0
- package/ai-context/symbols.json +82467 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/tech_stack.md +15 -7
- package/ai-context-evaluation-report-1774223059505.md +206 -0
- package/dist/analyzers/architecture.d.ts.map +1 -1
- package/dist/analyzers/architecture.js +6 -0
- package/dist/analyzers/architecture.js.map +1 -1
- package/dist/analyzers/entrypoints.d.ts.map +1 -1
- package/dist/analyzers/entrypoints.js +105 -0
- package/dist/analyzers/entrypoints.js.map +1 -1
- package/dist/analyzers/symbols.d.ts.map +1 -1
- package/dist/analyzers/symbols.js +72 -1
- package/dist/analyzers/symbols.js.map +1 -1
- package/dist/analyzers/techStack.d.ts +8 -0
- package/dist/analyzers/techStack.d.ts.map +1 -1
- package/dist/analyzers/techStack.js +75 -0
- package/dist/analyzers/techStack.js.map +1 -1
- package/dist/scripts/ai-context-evaluator.js +367 -0
- package/package.json +1 -1
- package/quick-evaluation-report-1774396002305.md +64 -0
- package/quick-evaluator.ts +200 -0
- package/scripts/ai-context-evaluator.ts +440 -0
- package/src/analyzers/architecture.ts +8 -0
- package/src/analyzers/entrypoints.ts +115 -0
- package/src/analyzers/symbols.ts +77 -1
- package/src/analyzers/techStack.ts +93 -0
- package/tests/apex-parser.test.ts +193 -0
- package/tests/cli-commands-batch1.test.ts +808 -0
- package/tests/cli-commands-batch2.test.ts +1113 -0
- package/tests/cli-commands-batch3.test.ts +1128 -0
- package/tests/cli-index.test.ts +1007 -0
- package/tests/cli-init.test.ts +761 -0
- package/tests/salesforce-apex-classes.test.ts +713 -0
- package/tests/salesforce-apex-triggers.test.ts +871 -0
- package/tests/salesforce-custom-objects.test.ts +918 -0
- package/tests/salesforce-flows.test.ts +710 -0
- package/tests/salesforce-lwc.test.ts +963 -0
- package/tests/salesforce-sfdx-integration.test.ts +1125 -0
- package/ANALISIS_COMPLETO.md +0 -424
- package/ANALISIS_MEJORAS.md +0 -327
- package/CONTRIBUTING.md +0 -89
- package/FLOW.md +0 -129
- package/TEST_RESULTS.md +0 -198
- package/TEST_RESULTS_COMPARATIVE.md +0 -159
- package/TEST_RESULTS_COMPLETE.md +0 -127
- package/TEST_RESULTS_COMPREHENSIVE.md +0 -208
- package/install.sh +0 -188
- package/run-all-tests.sh +0 -184
- package/test-ai-context-understanding.sh +0 -21
- package/test-projects/django-app/.ai-dev/ai_context.md +0 -92
- package/test-projects/django-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/django-app/.ai-dev/architecture.md +0 -57
- package/test-projects/django-app/.ai-dev/cache.json +0 -169
- package/test-projects/django-app/.ai-dev/context/flows/views.json +0 -10
- package/test-projects/django-app/.ai-dev/conventions.md +0 -51
- package/test-projects/django-app/.ai-dev/dependencies.json +0 -312
- package/test-projects/django-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/django-app/.ai-dev/files.json +0 -209
- package/test-projects/django-app/.ai-dev/graph/knowledge-graph.json +0 -36
- package/test-projects/django-app/.ai-dev/graph/module-graph.json +0 -145
- package/test-projects/django-app/.ai-dev/graph/symbol-graph.json +0 -1488
- package/test-projects/django-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/django-app/.ai-dev/index-state.json +0 -294
- package/test-projects/django-app/.ai-dev/modules.json +0 -35
- package/test-projects/django-app/.ai-dev/project.json +0 -11
- package/test-projects/django-app/.ai-dev/repo_map.json +0 -412
- package/test-projects/django-app/.ai-dev/repo_map.md +0 -105
- package/test-projects/django-app/.ai-dev/schema.json +0 -5
- package/test-projects/django-app/.ai-dev/summary.md +0 -15
- package/test-projects/django-app/.ai-dev/symbols.json +0 -1
- package/test-projects/django-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/django-app/README.md +0 -91
- package/test-projects/django-app/blog/__init__.py +0 -0
- package/test-projects/django-app/blog/admin.py +0 -31
- package/test-projects/django-app/blog/models.py +0 -55
- package/test-projects/django-app/blog/serializers.py +0 -69
- package/test-projects/django-app/blog/urls.py +0 -14
- package/test-projects/django-app/blog/views.py +0 -96
- package/test-projects/django-app/django_app/__init__.py +0 -0
- package/test-projects/django-app/django_app/settings.py +0 -90
- package/test-projects/django-app/django_app/urls.py +0 -11
- package/test-projects/django-app/django_app/wsgi.py +0 -9
- package/test-projects/django-app/manage.py +0 -23
- package/test-projects/django-app/requirements.txt +0 -3
- package/test-projects/django-app/users/__init__.py +0 -0
- package/test-projects/django-app/users/admin.py +0 -42
- package/test-projects/django-app/users/models.py +0 -54
- package/test-projects/django-app/users/serializers.py +0 -113
- package/test-projects/django-app/users/urls.py +0 -13
- package/test-projects/django-app/users/views.py +0 -135
- package/test-projects/express-api/.ai-dev/ai_context.md +0 -112
- package/test-projects/express-api/.ai-dev/ai_rules.md +0 -50
- package/test-projects/express-api/.ai-dev/architecture.md +0 -62
- package/test-projects/express-api/.ai-dev/context/features/controllers.json +0 -13
- package/test-projects/express-api/.ai-dev/context/features/services.json +0 -13
- package/test-projects/express-api/.ai-dev/context/flows/auth.json +0 -12
- package/test-projects/express-api/.ai-dev/context/flows/user.json +0 -13
- package/test-projects/express-api/.ai-dev/conventions.md +0 -51
- package/test-projects/express-api/.ai-dev/dependencies.json +0 -54
- package/test-projects/express-api/.ai-dev/entrypoints.md +0 -17
- package/test-projects/express-api/.ai-dev/modules.json +0 -30
- package/test-projects/express-api/.ai-dev/project.json +0 -15
- package/test-projects/express-api/.ai-dev/repo_map.json +0 -100
- package/test-projects/express-api/.ai-dev/repo_map.md +0 -36
- package/test-projects/express-api/.ai-dev/schema.json +0 -5
- package/test-projects/express-api/.ai-dev/summary.md +0 -14
- package/test-projects/express-api/.ai-dev/symbols.json +0 -7
- package/test-projects/express-api/.ai-dev/tech_stack.md +0 -38
- package/test-projects/express-api/.ai-dev/tools.json +0 -10
- package/test-projects/express-api/controllers/authController.js +0 -32
- package/test-projects/express-api/controllers/userController.js +0 -51
- package/test-projects/express-api/index.js +0 -30
- package/test-projects/express-api/middleware/authMiddleware.js +0 -30
- package/test-projects/express-api/models/userRepository.js +0 -25
- package/test-projects/express-api/package.json +0 -18
- package/test-projects/express-api/services/authService.js +0 -17
- package/test-projects/express-api/services/userService.js +0 -28
- package/test-projects/fastapi-app/.ai-dev/ai_context.md +0 -89
- package/test-projects/fastapi-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/fastapi-app/.ai-dev/architecture.md +0 -39
- package/test-projects/fastapi-app/.ai-dev/cache.json +0 -125
- package/test-projects/fastapi-app/.ai-dev/conventions.md +0 -51
- package/test-projects/fastapi-app/.ai-dev/dependencies.json +0 -244
- package/test-projects/fastapi-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/fastapi-app/.ai-dev/files.json +0 -154
- package/test-projects/fastapi-app/.ai-dev/graph/knowledge-graph.json +0 -15
- package/test-projects/fastapi-app/.ai-dev/graph/module-graph.json +0 -78
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-graph.json +0 -1724
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-references.json +0 -51
- package/test-projects/fastapi-app/.ai-dev/index-state.json +0 -217
- package/test-projects/fastapi-app/.ai-dev/modules.json +0 -16
- package/test-projects/fastapi-app/.ai-dev/project.json +0 -9
- package/test-projects/fastapi-app/.ai-dev/repo_map.json +0 -298
- package/test-projects/fastapi-app/.ai-dev/repo_map.md +0 -74
- package/test-projects/fastapi-app/.ai-dev/schema.json +0 -5
- package/test-projects/fastapi-app/.ai-dev/summary.md +0 -12
- package/test-projects/fastapi-app/.ai-dev/symbols.json +0 -1
- package/test-projects/fastapi-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/fastapi-app/.ai-dev/tools.json +0 -10
- package/test-projects/fastapi-app/README.md +0 -118
- package/test-projects/fastapi-app/app/database.py +0 -21
- package/test-projects/fastapi-app/app/dependencies.py +0 -107
- package/test-projects/fastapi-app/app/main.py +0 -47
- package/test-projects/fastapi-app/app/models.py +0 -149
- package/test-projects/fastapi-app/app/routers/auth.py +0 -117
- package/test-projects/fastapi-app/app/routers/posts.py +0 -272
- package/test-projects/fastapi-app/app/schemas.py +0 -191
- package/test-projects/fastapi-app/requirements.txt +0 -10
- package/test-projects/flask-app/.ai-dev/ai_context.md +0 -94
- package/test-projects/flask-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/flask-app/.ai-dev/architecture.md +0 -49
- package/test-projects/flask-app/.ai-dev/cache.json +0 -157
- package/test-projects/flask-app/.ai-dev/context/features/app.json +0 -25
- package/test-projects/flask-app/.ai-dev/context/flows/routes.json +0 -14
- package/test-projects/flask-app/.ai-dev/conventions.md +0 -51
- package/test-projects/flask-app/.ai-dev/dependencies.json +0 -298
- package/test-projects/flask-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/flask-app/.ai-dev/files.json +0 -194
- package/test-projects/flask-app/.ai-dev/graph/knowledge-graph.json +0 -60
- package/test-projects/flask-app/.ai-dev/graph/module-graph.json +0 -95
- package/test-projects/flask-app/.ai-dev/graph/symbol-graph.json +0 -1448
- package/test-projects/flask-app/.ai-dev/graph/symbol-references.json +0 -45
- package/test-projects/flask-app/.ai-dev/index-state.json +0 -273
- package/test-projects/flask-app/.ai-dev/modules.json +0 -21
- package/test-projects/flask-app/.ai-dev/project.json +0 -13
- package/test-projects/flask-app/.ai-dev/repo_map.json +0 -400
- package/test-projects/flask-app/.ai-dev/repo_map.md +0 -98
- package/test-projects/flask-app/.ai-dev/summary.md +0 -13
- package/test-projects/flask-app/.ai-dev/symbols.json +0 -1
- package/test-projects/flask-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/flask-app/.ai-dev/tools.json +0 -10
- package/test-projects/flask-app/README.md +0 -129
- package/test-projects/flask-app/app/__init__.py +0 -46
- package/test-projects/flask-app/app/api/__init__.py +0 -7
- package/test-projects/flask-app/app/api/routes.py +0 -122
- package/test-projects/flask-app/app/auth/__init__.py +0 -7
- package/test-projects/flask-app/app/auth/forms.py +0 -52
- package/test-projects/flask-app/app/auth/routes.py +0 -68
- package/test-projects/flask-app/app/blog/__init__.py +0 -7
- package/test-projects/flask-app/app/blog/forms.py +0 -35
- package/test-projects/flask-app/app/blog/routes.py +0 -140
- package/test-projects/flask-app/app/main/__init__.py +0 -7
- package/test-projects/flask-app/app/main/routes.py +0 -88
- package/test-projects/flask-app/app/models.py +0 -177
- package/test-projects/flask-app/config.py +0 -64
- package/test-projects/flask-app/requirements.txt +0 -10
- package/test-projects/laravel-app/.ai-dev/ai_context.md +0 -97
- package/test-projects/laravel-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/laravel-app/.ai-dev/architecture.md +0 -60
- package/test-projects/laravel-app/.ai-dev/cache.json +0 -161
- package/test-projects/laravel-app/.ai-dev/context/features/app.json +0 -21
- package/test-projects/laravel-app/.ai-dev/context/flows/.json +0 -9
- package/test-projects/laravel-app/.ai-dev/context/flows/category.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/comment.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/post.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/unnamed.json +0 -9
- package/test-projects/laravel-app/.ai-dev/conventions.md +0 -51
- package/test-projects/laravel-app/.ai-dev/dependencies.json +0 -6
- package/test-projects/laravel-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/laravel-app/.ai-dev/files.json +0 -199
- package/test-projects/laravel-app/.ai-dev/graph/knowledge-graph.json +0 -98
- package/test-projects/laravel-app/.ai-dev/graph/module-graph.json +0 -30
- package/test-projects/laravel-app/.ai-dev/graph/symbol-graph.json +0 -5
- package/test-projects/laravel-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/laravel-app/.ai-dev/index-state.json +0 -280
- package/test-projects/laravel-app/.ai-dev/modules.json +0 -29
- package/test-projects/laravel-app/.ai-dev/project.json +0 -17
- package/test-projects/laravel-app/.ai-dev/repo_map.json +0 -419
- package/test-projects/laravel-app/.ai-dev/repo_map.md +0 -106
- package/test-projects/laravel-app/.ai-dev/schema.json +0 -5
- package/test-projects/laravel-app/.ai-dev/summary.md +0 -15
- package/test-projects/laravel-app/.ai-dev/symbols.json +0 -1
- package/test-projects/laravel-app/.ai-dev/tech_stack.md +0 -34
- package/test-projects/laravel-app/.ai-dev/tools.json +0 -10
- package/test-projects/laravel-app/README.md +0 -107
- package/test-projects/laravel-app/app/Http/Controllers/Api/CategoryController.php +0 -88
- package/test-projects/laravel-app/app/Http/Controllers/Api/CommentController.php +0 -56
- package/test-projects/laravel-app/app/Http/Controllers/Api/PostController.php +0 -174
- package/test-projects/laravel-app/app/Http/Controllers/Controller.php +0 -12
- package/test-projects/laravel-app/app/Models/Category.php +0 -34
- package/test-projects/laravel-app/app/Models/Comment.php +0 -51
- package/test-projects/laravel-app/app/Models/Post.php +0 -108
- package/test-projects/laravel-app/app/Models/User.php +0 -85
- package/test-projects/laravel-app/bootstrap/app.php +0 -25
- package/test-projects/laravel-app/composer.json +0 -35
- package/test-projects/laravel-app/routes/api.php +0 -40
- package/test-projects/nestjs-backend/.ai-dev/ai_context.md +0 -111
- package/test-projects/nestjs-backend/.ai-dev/ai_rules.md +0 -52
- package/test-projects/nestjs-backend/.ai-dev/architecture.md +0 -49
- package/test-projects/nestjs-backend/.ai-dev/cache.json +0 -169
- package/test-projects/nestjs-backend/.ai-dev/context/features/src.json +0 -23
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +0 -14
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users..json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.controller.json +0 -14
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/conventions.md +0 -52
- package/test-projects/nestjs-backend/.ai-dev/dependencies.json +0 -152
- package/test-projects/nestjs-backend/.ai-dev/entrypoints.md +0 -18
- package/test-projects/nestjs-backend/.ai-dev/files.json +0 -209
- package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +0 -132
- package/test-projects/nestjs-backend/.ai-dev/graph/module-graph.json +0 -29
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-graph.json +0 -304
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-references.json +0 -5
- package/test-projects/nestjs-backend/.ai-dev/index-state.json +0 -294
- package/test-projects/nestjs-backend/.ai-dev/modules.json +0 -19
- package/test-projects/nestjs-backend/.ai-dev/project.json +0 -18
- package/test-projects/nestjs-backend/.ai-dev/repo_map.json +0 -427
- package/test-projects/nestjs-backend/.ai-dev/repo_map.md +0 -104
- package/test-projects/nestjs-backend/.ai-dev/schema.json +0 -5
- package/test-projects/nestjs-backend/.ai-dev/summary.md +0 -13
- package/test-projects/nestjs-backend/.ai-dev/symbols.json +0 -1
- package/test-projects/nestjs-backend/.ai-dev/tech_stack.md +0 -38
- package/test-projects/nestjs-backend/.ai-dev/tools.json +0 -10
- package/test-projects/nestjs-backend/package.json +0 -22
- package/test-projects/nestjs-backend/src/app.module.ts +0 -8
- package/test-projects/nestjs-backend/src/auth/auth.controller.ts +0 -22
- package/test-projects/nestjs-backend/src/auth/auth.module.ts +0 -11
- package/test-projects/nestjs-backend/src/auth/auth.service.ts +0 -28
- package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +0 -4
- package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +0 -18
- package/test-projects/nestjs-backend/src/main.ts +0 -9
- package/test-projects/nestjs-backend/src/users/users.controller.ts +0 -32
- package/test-projects/nestjs-backend/src/users/users.module.ts +0 -10
- package/test-projects/nestjs-backend/src/users/users.service.ts +0 -42
- package/test-projects/nestjs-backend/tsconfig.json +0 -21
- package/test-projects/python-cli/.ai-dev/ai_context.md +0 -95
- package/test-projects/python-cli/.ai-dev/ai_rules.md +0 -47
- package/test-projects/python-cli/.ai-dev/architecture.md +0 -55
- package/test-projects/python-cli/.ai-dev/cache.json +0 -149
- package/test-projects/python-cli/.ai-dev/context/features/cli.json +0 -16
- package/test-projects/python-cli/.ai-dev/context/flows/list_.json +0 -9
- package/test-projects/python-cli/.ai-dev/context/flows/remove_.json +0 -9
- package/test-projects/python-cli/.ai-dev/conventions.md +0 -51
- package/test-projects/python-cli/.ai-dev/dependencies.json +0 -66
- package/test-projects/python-cli/.ai-dev/entrypoints.md +0 -4
- package/test-projects/python-cli/.ai-dev/files.json +0 -184
- package/test-projects/python-cli/.ai-dev/graph/knowledge-graph.json +0 -83
- package/test-projects/python-cli/.ai-dev/graph/module-graph.json +0 -31
- package/test-projects/python-cli/.ai-dev/graph/symbol-graph.json +0 -358
- package/test-projects/python-cli/.ai-dev/graph/symbol-references.json +0 -11
- package/test-projects/python-cli/.ai-dev/index-state.json +0 -259
- package/test-projects/python-cli/.ai-dev/modules.json +0 -21
- package/test-projects/python-cli/.ai-dev/project.json +0 -15
- package/test-projects/python-cli/.ai-dev/repo_map.json +0 -367
- package/test-projects/python-cli/.ai-dev/repo_map.md +0 -93
- package/test-projects/python-cli/.ai-dev/schema.json +0 -5
- package/test-projects/python-cli/.ai-dev/summary.md +0 -14
- package/test-projects/python-cli/.ai-dev/symbols.json +0 -1
- package/test-projects/python-cli/.ai-dev/tech_stack.md +0 -32
- package/test-projects/python-cli/.ai-dev/tools.json +0 -10
- package/test-projects/python-cli/__init__.py +0 -1
- package/test-projects/python-cli/cli/__init__.py +0 -1
- package/test-projects/python-cli/cli/add_command.py +0 -6
- package/test-projects/python-cli/cli/list_command.py +0 -7
- package/test-projects/python-cli/cli/remove_command.py +0 -6
- package/test-projects/python-cli/main.py +0 -34
- package/test-projects/python-cli/models/__init__.py +0 -2
- package/test-projects/python-cli/models/task.py +0 -19
- package/test-projects/python-cli/models/task_repository.py +0 -44
- package/test-projects/rails-app/.ai-dev/ai_context.md +0 -94
- package/test-projects/rails-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/rails-app/.ai-dev/architecture.md +0 -49
- package/test-projects/rails-app/.ai-dev/cache.json +0 -193
- package/test-projects/rails-app/.ai-dev/context/features/app.json +0 -24
- package/test-projects/rails-app/.ai-dev/context/features/config.json +0 -13
- package/test-projects/rails-app/.ai-dev/context/flows/application.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/application_.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/comments.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/comments_.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/posts.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/posts_.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/routes.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/users.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/users_.json +0 -11
- package/test-projects/rails-app/.ai-dev/conventions.md +0 -51
- package/test-projects/rails-app/.ai-dev/dependencies.json +0 -6
- package/test-projects/rails-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/rails-app/.ai-dev/files.json +0 -239
- package/test-projects/rails-app/.ai-dev/graph/knowledge-graph.json +0 -130
- package/test-projects/rails-app/.ai-dev/graph/module-graph.json +0 -27
- package/test-projects/rails-app/.ai-dev/graph/symbol-graph.json +0 -5
- package/test-projects/rails-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/rails-app/.ai-dev/index-state.json +0 -336
- package/test-projects/rails-app/.ai-dev/modules.json +0 -26
- package/test-projects/rails-app/.ai-dev/project.json +0 -22
- package/test-projects/rails-app/.ai-dev/repo_map.json +0 -486
- package/test-projects/rails-app/.ai-dev/repo_map.md +0 -117
- package/test-projects/rails-app/.ai-dev/schema.json +0 -5
- package/test-projects/rails-app/.ai-dev/summary.md +0 -13
- package/test-projects/rails-app/.ai-dev/symbols.json +0 -1
- package/test-projects/rails-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/rails-app/.ai-dev/tools.json +0 -10
- package/test-projects/rails-app/Gemfile +0 -38
- package/test-projects/rails-app/README.md +0 -140
- package/test-projects/rails-app/Rakefile +0 -8
- package/test-projects/rails-app/app/controllers/api/comments_controller.rb +0 -75
- package/test-projects/rails-app/app/controllers/api/posts_controller.rb +0 -68
- package/test-projects/rails-app/app/controllers/api/users_controller.rb +0 -54
- package/test-projects/rails-app/app/controllers/application_controller.rb +0 -31
- package/test-projects/rails-app/app/models/comment.rb +0 -34
- package/test-projects/rails-app/app/models/post.rb +0 -36
- package/test-projects/rails-app/app/models/user.rb +0 -28
- package/test-projects/rails-app/app/services/post_service.rb +0 -92
- package/test-projects/rails-app/app/services/user_service.rb +0 -76
- package/test-projects/rails-app/config/application.rb +0 -27
- package/test-projects/rails-app/config/environment.rb +0 -7
- package/test-projects/rails-app/config/routes.rb +0 -15
- package/test-projects/react-app/.ai-dev/ai_context.md +0 -96
- package/test-projects/react-app/.ai-dev/architecture.md +0 -39
- package/test-projects/react-app/.ai-dev/cache.json +0 -153
- package/test-projects/react-app/.ai-dev/context/features/src.json +0 -18
- package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +0 -14
- package/test-projects/react-app/.ai-dev/context/flows/dashboard.json +0 -9
- package/test-projects/react-app/.ai-dev/context/flows/login.json +0 -9
- package/test-projects/react-app/.ai-dev/context/flows/users.json +0 -9
- package/test-projects/react-app/.ai-dev/dependencies.json +0 -128
- package/test-projects/react-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/react-app/.ai-dev/files.json +0 -189
- package/test-projects/react-app/.ai-dev/graph/knowledge-graph.json +0 -112
- package/test-projects/react-app/.ai-dev/graph/module-graph.json +0 -31
- package/test-projects/react-app/.ai-dev/graph/symbol-graph.json +0 -868
- package/test-projects/react-app/.ai-dev/graph/symbol-references.json +0 -31
- package/test-projects/react-app/.ai-dev/index-state.json +0 -266
- package/test-projects/react-app/.ai-dev/modules.json +0 -17
- package/test-projects/react-app/.ai-dev/project.json +0 -16
- package/test-projects/react-app/.ai-dev/repo_map.json +0 -391
- package/test-projects/react-app/.ai-dev/repo_map.md +0 -94
- package/test-projects/react-app/.ai-dev/schema.json +0 -5
- package/test-projects/react-app/.ai-dev/summary.md +0 -13
- package/test-projects/react-app/.ai-dev/symbols.json +0 -1
- package/test-projects/react-app/.ai-dev/tools.json +0 -10
- package/test-projects/react-app/package.json +0 -16
- package/test-projects/react-app/src/App.tsx +0 -21
- package/test-projects/react-app/src/context/AuthContext.tsx +0 -41
- package/test-projects/react-app/src/hooks/useAuth.ts +0 -10
- package/test-projects/react-app/src/main.tsx +0 -10
- package/test-projects/react-app/src/pages/DashboardPage.tsx +0 -17
- package/test-projects/react-app/src/pages/LoginPage.tsx +0 -41
- package/test-projects/react-app/src/pages/UsersPage.tsx +0 -36
- package/test-projects/react-app/src/services/userService.ts +0 -37
- package/test-projects/salesforce-cli/.ai-dev/ai_context.md +0 -89
- package/test-projects/salesforce-cli/.ai-dev/ai_rules.md +0 -47
- package/test-projects/salesforce-cli/.ai-dev/architecture.md +0 -39
- package/test-projects/salesforce-cli/.ai-dev/cache.json +0 -125
- package/test-projects/salesforce-cli/.ai-dev/context/features/force-app.json +0 -14
- package/test-projects/salesforce-cli/.ai-dev/context/flows/account.json +0 -9
- package/test-projects/salesforce-cli/.ai-dev/context/flows/opportunity.json +0 -9
- package/test-projects/salesforce-cli/.ai-dev/conventions.md +0 -51
- package/test-projects/salesforce-cli/.ai-dev/dependencies.json +0 -6
- package/test-projects/salesforce-cli/.ai-dev/entrypoints.md +0 -4
- package/test-projects/salesforce-cli/.ai-dev/files.json +0 -154
- package/test-projects/salesforce-cli/.ai-dev/graph/knowledge-graph.json +0 -64
- package/test-projects/salesforce-cli/.ai-dev/graph/module-graph.json +0 -13
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-graph.json +0 -148
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/salesforce-cli/.ai-dev/index-state.json +0 -217
- package/test-projects/salesforce-cli/.ai-dev/modules.json +0 -12
- package/test-projects/salesforce-cli/.ai-dev/project.json +0 -14
- package/test-projects/salesforce-cli/.ai-dev/repo_map.json +0 -328
- package/test-projects/salesforce-cli/.ai-dev/repo_map.md +0 -80
- package/test-projects/salesforce-cli/.ai-dev/schema.json +0 -5
- package/test-projects/salesforce-cli/.ai-dev/summary.md +0 -13
- package/test-projects/salesforce-cli/.ai-dev/symbols.json +0 -1
- package/test-projects/salesforce-cli/.ai-dev/tech_stack.md +0 -31
- package/test-projects/salesforce-cli/.ai-dev/tools.json +0 -10
- package/test-projects/salesforce-cli/.forceignore +0 -27
- package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +0 -24
- package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +0 -25
- package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +0 -45
- package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +0 -33
- package/test-projects/salesforce-cli/sfdx-project.json +0 -11
- package/test-projects/spring-boot-app/.ai-dev/ai_context.md +0 -91
- package/test-projects/spring-boot-app/.ai-dev/ai_rules.md +0 -48
- package/test-projects/spring-boot-app/.ai-dev/architecture.md +0 -39
- package/test-projects/spring-boot-app/.ai-dev/cache.json +0 -173
- package/test-projects/spring-boot-app/.ai-dev/context/features/src.json +0 -26
- package/test-projects/spring-boot-app/.ai-dev/context/flows/PostController.json +0 -19
- package/test-projects/spring-boot-app/.ai-dev/context/flows/UserController.json +0 -19
- package/test-projects/spring-boot-app/.ai-dev/context/flows/comment.json +0 -11
- package/test-projects/spring-boot-app/.ai-dev/context/flows/post.json +0 -14
- package/test-projects/spring-boot-app/.ai-dev/context/flows/user.json +0 -14
- package/test-projects/spring-boot-app/.ai-dev/conventions.md +0 -52
- package/test-projects/spring-boot-app/.ai-dev/dependencies.json +0 -326
- package/test-projects/spring-boot-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/spring-boot-app/.ai-dev/files.json +0 -214
- package/test-projects/spring-boot-app/.ai-dev/graph/knowledge-graph.json +0 -231
- package/test-projects/spring-boot-app/.ai-dev/graph/module-graph.json +0 -22
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-graph.json +0 -794
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-references.json +0 -70
- package/test-projects/spring-boot-app/.ai-dev/index-state.json +0 -301
- package/test-projects/spring-boot-app/.ai-dev/modules.json +0 -21
- package/test-projects/spring-boot-app/.ai-dev/project.json +0 -17
- package/test-projects/spring-boot-app/.ai-dev/repo_map.json +0 -461
- package/test-projects/spring-boot-app/.ai-dev/repo_map.md +0 -109
- package/test-projects/spring-boot-app/.ai-dev/schema.json +0 -5
- package/test-projects/spring-boot-app/.ai-dev/summary.md +0 -12
- package/test-projects/spring-boot-app/.ai-dev/symbols.json +0 -1
- package/test-projects/spring-boot-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/spring-boot-app/.ai-dev/tools.json +0 -10
- package/test-projects/spring-boot-app/.classpath +0 -57
- package/test-projects/spring-boot-app/.factorypath +0 -69
- package/test-projects/spring-boot-app/.project +0 -34
- package/test-projects/spring-boot-app/.settings/org.eclipse.core.resources.prefs +0 -4
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.apt.core.prefs +0 -4
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.core.prefs +0 -10
- package/test-projects/spring-boot-app/.settings/org.eclipse.m2e.core.prefs +0 -4
- package/test-projects/spring-boot-app/README.md +0 -122
- package/test-projects/spring-boot-app/pom.xml +0 -79
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/DemoApplication.java +0 -12
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/CommentController.java +0 -89
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java +0 -92
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java +0 -84
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Comment.java +0 -38
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Post.java +0 -56
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/User.java +0 -44
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/CommentRepository.java +0 -21
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/PostRepository.java +0 -18
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/UserRepository.java +0 -15
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/PostService.java +0 -83
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/UserService.java +0 -62
- package/test-projects/spring-boot-app/src/main/resources/application.properties +0 -22
- package/test-projects/spring-boot-app/target/classes/com/example/demo/DemoApplication.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Comment.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Post.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/User.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/CommentRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/PostRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/UserRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/services/PostService.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/services/UserService.class +0 -0
- package/tests/e2e/run-e2e.sh +0 -88
- /package/{test-projects/django-app/.ai-dev → ai-context}/tools.json +0 -0
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<factorypath>
|
|
2
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-web/3.2.5/spring-boot-starter-web-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
3
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter/3.2.5/spring-boot-starter-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
4
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot/3.2.5/spring-boot-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
5
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-autoconfigure/3.2.5/spring-boot-autoconfigure-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
6
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/3.2.5/spring-boot-starter-logging-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
7
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-classic/1.4.14/logback-classic-1.4.14.jar" enabled="true" runInBatchMode="false"/>
|
|
8
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-core/1.4.14/logback-core-1.4.14.jar" enabled="true" runInBatchMode="false"/>
|
|
9
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/logging/log4j/log4j-to-slf4j/2.21.1/log4j-to-slf4j-2.21.1.jar" enabled="true" runInBatchMode="false"/>
|
|
10
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/logging/log4j/log4j-api/2.21.1/log4j-api-2.21.1.jar" enabled="true" runInBatchMode="false"/>
|
|
11
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/jul-to-slf4j/2.0.13/jul-to-slf4j-2.0.13.jar" enabled="true" runInBatchMode="false"/>
|
|
12
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar" enabled="true" runInBatchMode="false"/>
|
|
13
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar" enabled="true" runInBatchMode="false"/>
|
|
14
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-json/3.2.5/spring-boot-starter-json-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
15
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-databind/2.15.4/jackson-databind-2.15.4.jar" enabled="true" runInBatchMode="false"/>
|
|
16
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.15.4/jackson-annotations-2.15.4.jar" enabled="true" runInBatchMode="false"/>
|
|
17
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-core/2.15.4/jackson-core-2.15.4.jar" enabled="true" runInBatchMode="false"/>
|
|
18
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.15.4/jackson-datatype-jdk8-2.15.4.jar" enabled="true" runInBatchMode="false"/>
|
|
19
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.15.4/jackson-datatype-jsr310-2.15.4.jar" enabled="true" runInBatchMode="false"/>
|
|
20
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/module/jackson-module-parameter-names/2.15.4/jackson-module-parameter-names-2.15.4.jar" enabled="true" runInBatchMode="false"/>
|
|
21
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-tomcat/3.2.5/spring-boot-starter-tomcat-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
22
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-core/10.1.20/tomcat-embed-core-10.1.20.jar" enabled="true" runInBatchMode="false"/>
|
|
23
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.20/tomcat-embed-websocket-10.1.20.jar" enabled="true" runInBatchMode="false"/>
|
|
24
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-web/6.1.6/spring-web-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
25
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-beans/6.1.6/spring-beans-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
26
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-observation/1.12.5/micrometer-observation-1.12.5.jar" enabled="true" runInBatchMode="false"/>
|
|
27
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-commons/1.12.5/micrometer-commons-1.12.5.jar" enabled="true" runInBatchMode="false"/>
|
|
28
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-webmvc/6.1.6/spring-webmvc-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
29
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-aop/6.1.6/spring-aop-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
30
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-context/6.1.6/spring-context-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
31
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-expression/6.1.6/spring-expression-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
32
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-data-jpa/3.2.5/spring-boot-starter-data-jpa-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
33
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-aop/3.2.5/spring-boot-starter-aop-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
34
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/aspectj/aspectjweaver/1.9.22/aspectjweaver-1.9.22.jar" enabled="true" runInBatchMode="false"/>
|
|
35
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-jdbc/3.2.5/spring-boot-starter-jdbc-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
36
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/zaxxer/HikariCP/5.0.1/HikariCP-5.0.1.jar" enabled="true" runInBatchMode="false"/>
|
|
37
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jdbc/6.1.6/spring-jdbc-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
38
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/orm/hibernate-core/6.4.4.Final/hibernate-core-6.4.4.Final.jar" enabled="true" runInBatchMode="false"/>
|
|
39
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/persistence/jakarta.persistence-api/3.1.0/jakarta.persistence-api-3.1.0.jar" enabled="true" runInBatchMode="false"/>
|
|
40
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/transaction/jakarta.transaction-api/2.0.1/jakarta.transaction-api-2.0.1.jar" enabled="true" runInBatchMode="false"/>
|
|
41
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/jboss/logging/jboss-logging/3.5.3.Final/jboss-logging-3.5.3.Final.jar" enabled="true" runInBatchMode="false"/>
|
|
42
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/common/hibernate-commons-annotations/6.0.6.Final/hibernate-commons-annotations-6.0.6.Final.jar" enabled="true" runInBatchMode="false"/>
|
|
43
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/io/smallrye/jandex/3.1.2/jandex-3.1.2.jar" enabled="true" runInBatchMode="false"/>
|
|
44
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/classmate/1.6.0/classmate-1.6.0.jar" enabled="true" runInBatchMode="false"/>
|
|
45
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/net/bytebuddy/byte-buddy/1.14.13/byte-buddy-1.14.13.jar" enabled="true" runInBatchMode="false"/>
|
|
46
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/jaxb/jaxb-runtime/4.0.5/jaxb-runtime-4.0.5.jar" enabled="true" runInBatchMode="false"/>
|
|
47
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/jaxb/jaxb-core/4.0.5/jaxb-core-4.0.5.jar" enabled="true" runInBatchMode="false"/>
|
|
48
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/eclipse/angus/angus-activation/2.0.2/angus-activation-2.0.2.jar" enabled="true" runInBatchMode="false"/>
|
|
49
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/glassfish/jaxb/txw2/4.0.5/txw2-4.0.5.jar" enabled="true" runInBatchMode="false"/>
|
|
50
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/istack/istack-commons-runtime/4.1.2/istack-commons-runtime-4.1.2.jar" enabled="true" runInBatchMode="false"/>
|
|
51
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar" enabled="true" runInBatchMode="false"/>
|
|
52
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/antlr/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar" enabled="true" runInBatchMode="false"/>
|
|
53
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/data/spring-data-jpa/3.2.5/spring-data-jpa-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
54
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/data/spring-data-commons/3.2.5/spring-data-commons-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
55
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-orm/6.1.6/spring-orm-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
56
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-tx/6.1.6/spring-tx-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
57
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-api/2.0.13/slf4j-api-2.0.13.jar" enabled="true" runInBatchMode="false"/>
|
|
58
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-aspects/6.1.6/spring-aspects-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
59
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-validation/3.2.5/spring-boot-starter-validation-3.2.5.jar" enabled="true" runInBatchMode="false"/>
|
|
60
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-el/10.1.20/tomcat-embed-el-10.1.20.jar" enabled="true" runInBatchMode="false"/>
|
|
61
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/validator/hibernate-validator/8.0.1.Final/hibernate-validator-8.0.1.Final.jar" enabled="true" runInBatchMode="false"/>
|
|
62
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/validation/jakarta.validation-api/3.0.2/jakarta.validation-api-3.0.2.jar" enabled="true" runInBatchMode="false"/>
|
|
63
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/com/h2database/h2/2.2.224/h2-2.2.224.jar" enabled="true" runInBatchMode="false"/>
|
|
64
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.32/lombok-1.18.32.jar" enabled="true" runInBatchMode="false"/>
|
|
65
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/xml/bind/jakarta.xml.bind-api/4.0.2/jakarta.xml.bind-api-4.0.2.jar" enabled="true" runInBatchMode="false"/>
|
|
66
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/activation/jakarta.activation-api/2.1.3/jakarta.activation-api-2.1.3.jar" enabled="true" runInBatchMode="false"/>
|
|
67
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-core/6.1.6/spring-core-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
68
|
-
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jcl/6.1.6/spring-jcl-6.1.6.jar" enabled="true" runInBatchMode="false"/>
|
|
69
|
-
</factorypath>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<projectDescription>
|
|
3
|
-
<name>demo</name>
|
|
4
|
-
<comment></comment>
|
|
5
|
-
<projects>
|
|
6
|
-
</projects>
|
|
7
|
-
<buildSpec>
|
|
8
|
-
<buildCommand>
|
|
9
|
-
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
10
|
-
<arguments>
|
|
11
|
-
</arguments>
|
|
12
|
-
</buildCommand>
|
|
13
|
-
<buildCommand>
|
|
14
|
-
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
15
|
-
<arguments>
|
|
16
|
-
</arguments>
|
|
17
|
-
</buildCommand>
|
|
18
|
-
</buildSpec>
|
|
19
|
-
<natures>
|
|
20
|
-
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
21
|
-
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
22
|
-
</natures>
|
|
23
|
-
<filteredResources>
|
|
24
|
-
<filter>
|
|
25
|
-
<id>1773853601801</id>
|
|
26
|
-
<name></name>
|
|
27
|
-
<type>30</type>
|
|
28
|
-
<matcher>
|
|
29
|
-
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
30
|
-
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
31
|
-
</matcher>
|
|
32
|
-
</filter>
|
|
33
|
-
</filteredResources>
|
|
34
|
-
</projectDescription>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
eclipse.preferences.version=1
|
|
2
|
-
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
|
|
3
|
-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
|
4
|
-
org.eclipse.jdt.core.compiler.compliance=17
|
|
5
|
-
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
|
6
|
-
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
|
7
|
-
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
|
8
|
-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
|
|
9
|
-
org.eclipse.jdt.core.compiler.release=enabled
|
|
10
|
-
org.eclipse.jdt.core.compiler.source=17
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Spring Boot REST API Blog Application
|
|
2
|
-
|
|
3
|
-
A simple blog application built with Spring Boot that demonstrates a RESTful API with users, posts, and comments.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **User Management**: Create, read, update, and delete users
|
|
8
|
-
- **Post Management**: Create posts, publish them, and manage content
|
|
9
|
-
- **Comment System**: Users can comment on posts
|
|
10
|
-
|
|
11
|
-
## Technology Stack
|
|
12
|
-
|
|
13
|
-
- **Java 17+**
|
|
14
|
-
- **Spring Boot 3.2.x**
|
|
15
|
-
- **Spring Data JPA**
|
|
16
|
-
- **H2 Database** (in-memory)
|
|
17
|
-
- **Lombok**
|
|
18
|
-
|
|
19
|
-
## Project Structure
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
src/main/java/com/example/demo/
|
|
23
|
-
├── DemoApplication.java # Main application entry point
|
|
24
|
-
├── models/ # JPA Entities
|
|
25
|
-
│ ├── User.java # User entity with posts and comments
|
|
26
|
-
│ ├── Post.java # Post entity with comments
|
|
27
|
-
│ └── Comment.java # Comment entity
|
|
28
|
-
├── controllers/ # REST Controllers
|
|
29
|
-
│ ├── UserController.java # User CRUD endpoints
|
|
30
|
-
│ ├── PostController.java # Post CRUD endpoints
|
|
31
|
-
│ └── CommentController.java # Comment CRUD endpoints
|
|
32
|
-
├── services/ # Business Logic
|
|
33
|
-
│ ├── UserService.java # User operations
|
|
34
|
-
│ └── PostService.java # Post operations
|
|
35
|
-
├── repositories/ # Data Access
|
|
36
|
-
│ ├── UserRepository.java
|
|
37
|
-
│ ├── PostRepository.java
|
|
38
|
-
│ └── CommentRepository.java
|
|
39
|
-
└── DTOs/ # Data Transfer Objects
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## API Endpoints
|
|
43
|
-
|
|
44
|
-
### Users
|
|
45
|
-
|
|
46
|
-
| Method | Endpoint | Description |
|
|
47
|
-
|--------|----------|-------------|
|
|
48
|
-
| GET | `/api/users` | Get all users |
|
|
49
|
-
| GET | `/api/users/{id}` | Get user by ID |
|
|
50
|
-
| GET | `/api/users/email/{email}` | Get user by email |
|
|
51
|
-
| POST | `/api/users` | Create a new user |
|
|
52
|
-
| PUT | `/api/users/{id}` | Update a user |
|
|
53
|
-
| DELETE | `/api/users/{id}` | Delete a user |
|
|
54
|
-
|
|
55
|
-
### Posts
|
|
56
|
-
|
|
57
|
-
| Method | Endpoint | Description |
|
|
58
|
-
|--------|----------|-------------|
|
|
59
|
-
| GET | `/api/posts` | Get all posts |
|
|
60
|
-
| GET | `/api/posts/{id}` | Get post by ID |
|
|
61
|
-
| GET | `/api/posts/user/{userId}` | Get posts by user |
|
|
62
|
-
| GET | `/api/posts/published` | Get published posts |
|
|
63
|
-
| POST | `/api/posts` | Create a new post |
|
|
64
|
-
| PUT | `/api/posts/{id}` | Update a post |
|
|
65
|
-
| POST | `/api/posts/{id}/publish` | Publish a post |
|
|
66
|
-
| DELETE | `/api/posts/{id}` | Delete a post |
|
|
67
|
-
|
|
68
|
-
### Comments
|
|
69
|
-
|
|
70
|
-
| Method | Endpoint | Description |
|
|
71
|
-
|--------|----------|-------------|
|
|
72
|
-
| GET | `/api/comments` | Get all comments |
|
|
73
|
-
| GET | `/api/comments/{id}` | Get comment by ID |
|
|
74
|
-
| GET | `/api/comments/post/{postId}` | Get comments by post |
|
|
75
|
-
| GET | `/api/comments/user/{userId}` | Get comments by user |
|
|
76
|
-
| POST | `/api/comments` | Create a new comment |
|
|
77
|
-
| PUT | `/api/comments/{id}` | Update a comment |
|
|
78
|
-
| DELETE | `/api/comments/{id}` | Delete a comment |
|
|
79
|
-
|
|
80
|
-
## Running the Application
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
./mvnw spring-boot:run
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
The application will start on `http://localhost:8080`.
|
|
87
|
-
|
|
88
|
-
## H2 Console
|
|
89
|
-
|
|
90
|
-
Access the H2 database console at: `http://localhost:8080/h2-console`
|
|
91
|
-
|
|
92
|
-
- JDBC URL: `jdbc:h2:mem:testdb`
|
|
93
|
-
- Username: `sa`
|
|
94
|
-
- Password: (empty)
|
|
95
|
-
|
|
96
|
-
## Example Requests
|
|
97
|
-
|
|
98
|
-
### Create a User
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
curl -X POST http://localhost:8080/api/users \
|
|
102
|
-
-H "Content-Type: application/json" \
|
|
103
|
-
-d '{"name": "John Doe", "email": "john@example.com"}'
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Create a Post
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
curl -X POST http://localhost:8080/api/posts \
|
|
110
|
-
-H "Content-Type: application/json" \
|
|
111
|
-
-d '{"title": "My First Post", "content": "Hello World!", "userId": 1}'
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Publish a Post
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
curl -X POST http://localhost:8080/api/posts/1/publish
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## License
|
|
121
|
-
|
|
122
|
-
This project is for educational purposes.
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
5
|
-
<modelVersion>4.0.0</modelVersion>
|
|
6
|
-
|
|
7
|
-
<parent>
|
|
8
|
-
<groupId>org.springframework.boot</groupId>
|
|
9
|
-
<artifactId>spring-boot-starter-parent</artifactId>
|
|
10
|
-
<version>3.2.5</version>
|
|
11
|
-
<relativePath/>
|
|
12
|
-
</parent>
|
|
13
|
-
|
|
14
|
-
<groupId>com.example</groupId>
|
|
15
|
-
<artifactId>demo</artifactId>
|
|
16
|
-
<version>0.0.1-SNAPSHOT</version>
|
|
17
|
-
<name>demo</name>
|
|
18
|
-
<description>Spring Boot REST API Blog Application</description>
|
|
19
|
-
|
|
20
|
-
<properties>
|
|
21
|
-
<java.version>17</java.version>
|
|
22
|
-
</properties>
|
|
23
|
-
|
|
24
|
-
<dependencies>
|
|
25
|
-
<!-- Spring Boot Starters -->
|
|
26
|
-
<dependency>
|
|
27
|
-
<groupId>org.springframework.boot</groupId>
|
|
28
|
-
<artifactId>spring-boot-starter-web</artifactId>
|
|
29
|
-
</dependency>
|
|
30
|
-
|
|
31
|
-
<dependency>
|
|
32
|
-
<groupId>org.springframework.boot</groupId>
|
|
33
|
-
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
34
|
-
</dependency>
|
|
35
|
-
|
|
36
|
-
<dependency>
|
|
37
|
-
<groupId>org.springframework.boot</groupId>
|
|
38
|
-
<artifactId>spring-boot-starter-validation</artifactId>
|
|
39
|
-
</dependency>
|
|
40
|
-
|
|
41
|
-
<!-- Database -->
|
|
42
|
-
<dependency>
|
|
43
|
-
<groupId>com.h2database</groupId>
|
|
44
|
-
<artifactId>h2</artifactId>
|
|
45
|
-
<scope>runtime</scope>
|
|
46
|
-
</dependency>
|
|
47
|
-
|
|
48
|
-
<!-- Lombok -->
|
|
49
|
-
<dependency>
|
|
50
|
-
<groupId>org.projectlombok</groupId>
|
|
51
|
-
<artifactId>lombok</artifactId>
|
|
52
|
-
<optional>true</optional>
|
|
53
|
-
</dependency>
|
|
54
|
-
|
|
55
|
-
<!-- Testing -->
|
|
56
|
-
<dependency>
|
|
57
|
-
<groupId>org.springframework.boot</groupId>
|
|
58
|
-
<artifactId>spring-boot-starter-test</artifactId>
|
|
59
|
-
<scope>test</scope>
|
|
60
|
-
</dependency>
|
|
61
|
-
</dependencies>
|
|
62
|
-
|
|
63
|
-
<build>
|
|
64
|
-
<plugins>
|
|
65
|
-
<plugin>
|
|
66
|
-
<groupId>org.springframework.boot</groupId>
|
|
67
|
-
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
68
|
-
<configuration>
|
|
69
|
-
<excludes>
|
|
70
|
-
<exclude>
|
|
71
|
-
<groupId>org.projectlombok</groupId>
|
|
72
|
-
<artifactId>lombok</artifactId>
|
|
73
|
-
</exclude>
|
|
74
|
-
</excludes>
|
|
75
|
-
</configuration>
|
|
76
|
-
</plugin>
|
|
77
|
-
</plugins>
|
|
78
|
-
</build>
|
|
79
|
-
</project>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
package com.example.demo;
|
|
2
|
-
|
|
3
|
-
import org.springframework.boot.SpringApplication;
|
|
4
|
-
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
5
|
-
|
|
6
|
-
@SpringBootApplication
|
|
7
|
-
public class DemoApplication {
|
|
8
|
-
|
|
9
|
-
public static void main(String[] args) {
|
|
10
|
-
SpringApplication.run(DemoApplication.class, args);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
package com.example.demo.controllers;
|
|
2
|
-
|
|
3
|
-
import com.example.demo.models.Comment;
|
|
4
|
-
import com.example.demo.repositories.CommentRepository;
|
|
5
|
-
import jakarta.validation.Valid;
|
|
6
|
-
import jakarta.validation.constraints.NotBlank;
|
|
7
|
-
import jakarta.validation.constraints.NotNull;
|
|
8
|
-
import lombok.RequiredArgsConstructor;
|
|
9
|
-
import org.springframework.http.HttpStatus;
|
|
10
|
-
import org.springframework.http.ResponseEntity;
|
|
11
|
-
import org.springframework.web.bind.annotation.*;
|
|
12
|
-
|
|
13
|
-
import java.util.List;
|
|
14
|
-
|
|
15
|
-
@RestController
|
|
16
|
-
@RequestMapping("/api/comments")
|
|
17
|
-
@RequiredArgsConstructor
|
|
18
|
-
public class CommentController {
|
|
19
|
-
|
|
20
|
-
private final CommentRepository commentRepository;
|
|
21
|
-
|
|
22
|
-
@GetMapping
|
|
23
|
-
public ResponseEntity<List<Comment>> getAllComments() {
|
|
24
|
-
return ResponseEntity.ok(commentRepository.findAll());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@GetMapping("/{id}")
|
|
28
|
-
public ResponseEntity<Comment> getCommentById(@PathVariable Long id) {
|
|
29
|
-
return commentRepository.findById(id)
|
|
30
|
-
.map(ResponseEntity::ok)
|
|
31
|
-
.orElse(ResponseEntity.notFound().build());
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@GetMapping("/post/{postId}")
|
|
35
|
-
public ResponseEntity<List<Comment>> getCommentsByPost(@PathVariable Long postId) {
|
|
36
|
-
return ResponseEntity.ok(commentRepository.findByPostId(postId));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@GetMapping("/user/{userId}")
|
|
40
|
-
public ResponseEntity<List<Comment>> getCommentsByUser(@PathVariable Long userId) {
|
|
41
|
-
return ResponseEntity.ok(commentRepository.findByUserId(userId));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@PostMapping
|
|
45
|
-
public ResponseEntity<Comment> createComment(@Valid @RequestBody CommentCreateRequest request) {
|
|
46
|
-
Comment comment = new Comment();
|
|
47
|
-
comment.setContent(request.content());
|
|
48
|
-
// Note: In a real application, you would set the post and user from the request
|
|
49
|
-
// This requires additional service logic
|
|
50
|
-
|
|
51
|
-
Comment createdComment = commentRepository.save(comment);
|
|
52
|
-
return ResponseEntity.status(HttpStatus.CREATED).body(createdComment);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@PutMapping("/{id}")
|
|
56
|
-
public ResponseEntity<Comment> updateComment(@PathVariable Long id, @Valid @RequestBody CommentUpdateRequest request) {
|
|
57
|
-
return commentRepository.findById(id)
|
|
58
|
-
.map(comment -> {
|
|
59
|
-
comment.setContent(request.content());
|
|
60
|
-
return ResponseEntity.ok(commentRepository.save(comment));
|
|
61
|
-
})
|
|
62
|
-
.orElse(ResponseEntity.notFound().build());
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@DeleteMapping("/{id}")
|
|
66
|
-
public ResponseEntity<Void> deleteComment(@PathVariable Long id) {
|
|
67
|
-
if (!commentRepository.existsById(id)) {
|
|
68
|
-
return ResponseEntity.notFound().build();
|
|
69
|
-
}
|
|
70
|
-
commentRepository.deleteById(id);
|
|
71
|
-
return ResponseEntity.noContent().build();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public record CommentCreateRequest(
|
|
75
|
-
@NotBlank(message = "Content is required")
|
|
76
|
-
String content,
|
|
77
|
-
|
|
78
|
-
@NotNull(message = "Post ID is required")
|
|
79
|
-
Long postId,
|
|
80
|
-
|
|
81
|
-
@NotNull(message = "User ID is required")
|
|
82
|
-
Long userId
|
|
83
|
-
) {}
|
|
84
|
-
|
|
85
|
-
public record CommentUpdateRequest(
|
|
86
|
-
@NotBlank(message = "Content is required")
|
|
87
|
-
String content
|
|
88
|
-
) {}
|
|
89
|
-
}
|
package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
package com.example.demo.controllers;
|
|
2
|
-
|
|
3
|
-
import com.example.demo.models.Post;
|
|
4
|
-
import com.example.demo.services.PostService;
|
|
5
|
-
import jakarta.validation.Valid;
|
|
6
|
-
import jakarta.validation.constraints.NotBlank;
|
|
7
|
-
import jakarta.validation.constraints.NotNull;
|
|
8
|
-
import lombok.RequiredArgsConstructor;
|
|
9
|
-
import org.springframework.http.HttpStatus;
|
|
10
|
-
import org.springframework.http.ResponseEntity;
|
|
11
|
-
import org.springframework.web.bind.annotation.*;
|
|
12
|
-
|
|
13
|
-
import java.util.List;
|
|
14
|
-
|
|
15
|
-
@RestController
|
|
16
|
-
@RequestMapping("/api/posts")
|
|
17
|
-
@RequiredArgsConstructor
|
|
18
|
-
public class PostController {
|
|
19
|
-
|
|
20
|
-
private final PostService postService;
|
|
21
|
-
|
|
22
|
-
@GetMapping
|
|
23
|
-
public ResponseEntity<List<Post>> getAllPosts() {
|
|
24
|
-
return ResponseEntity.ok(postService.findAll());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@GetMapping("/{id}")
|
|
28
|
-
public ResponseEntity<Post> getPostById(@PathVariable Long id) {
|
|
29
|
-
return postService.findById(id)
|
|
30
|
-
.map(ResponseEntity::ok)
|
|
31
|
-
.orElse(ResponseEntity.notFound().build());
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@GetMapping("/user/{userId}")
|
|
35
|
-
public ResponseEntity<List<Post>> getPostsByUser(@PathVariable Long userId) {
|
|
36
|
-
return ResponseEntity.ok(postService.findByUserId(userId));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@GetMapping("/published")
|
|
40
|
-
public ResponseEntity<List<Post>> getPublishedPosts() {
|
|
41
|
-
return ResponseEntity.ok(postService.findPublished());
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@PostMapping
|
|
45
|
-
public ResponseEntity<Post> createPost(@Valid @RequestBody PostCreateRequest request) {
|
|
46
|
-
Post post = new Post();
|
|
47
|
-
post.setTitle(request.title());
|
|
48
|
-
post.setContent(request.content());
|
|
49
|
-
|
|
50
|
-
Post createdPost = postService.create(post, request.userId());
|
|
51
|
-
return ResponseEntity.status(HttpStatus.CREATED).body(createdPost);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@PutMapping("/{id}")
|
|
55
|
-
public ResponseEntity<Post> updatePost(@PathVariable Long id, @Valid @RequestBody PostUpdateRequest request) {
|
|
56
|
-
Post postDetails = new Post();
|
|
57
|
-
postDetails.setTitle(request.title());
|
|
58
|
-
postDetails.setContent(request.content());
|
|
59
|
-
|
|
60
|
-
Post updatedPost = postService.update(id, postDetails);
|
|
61
|
-
return ResponseEntity.ok(updatedPost);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@PostMapping("/{id}/publish")
|
|
65
|
-
public ResponseEntity<Post> publishPost(@PathVariable Long id) {
|
|
66
|
-
Post publishedPost = postService.publish(id);
|
|
67
|
-
return ResponseEntity.ok(publishedPost);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@DeleteMapping("/{id}")
|
|
71
|
-
public ResponseEntity<Void> deletePost(@PathVariable Long id) {
|
|
72
|
-
postService.delete(id);
|
|
73
|
-
return ResponseEntity.noContent().build();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public record PostCreateRequest(
|
|
77
|
-
@NotBlank(message = "Title is required")
|
|
78
|
-
String title,
|
|
79
|
-
|
|
80
|
-
String content,
|
|
81
|
-
|
|
82
|
-
@NotNull(message = "User ID is required")
|
|
83
|
-
Long userId
|
|
84
|
-
) {}
|
|
85
|
-
|
|
86
|
-
public record PostUpdateRequest(
|
|
87
|
-
@NotBlank(message = "Title is required")
|
|
88
|
-
String title,
|
|
89
|
-
|
|
90
|
-
String content
|
|
91
|
-
) {}
|
|
92
|
-
}
|
package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
package com.example.demo.controllers;
|
|
2
|
-
|
|
3
|
-
import com.example.demo.models.User;
|
|
4
|
-
import com.example.demo.services.UserService;
|
|
5
|
-
import jakarta.validation.Valid;
|
|
6
|
-
import jakarta.validation.constraints.Email;
|
|
7
|
-
import jakarta.validation.constraints.NotBlank;
|
|
8
|
-
import lombok.RequiredArgsConstructor;
|
|
9
|
-
import org.springframework.http.HttpStatus;
|
|
10
|
-
import org.springframework.http.ResponseEntity;
|
|
11
|
-
import org.springframework.web.bind.annotation.*;
|
|
12
|
-
|
|
13
|
-
import java.util.List;
|
|
14
|
-
|
|
15
|
-
@RestController
|
|
16
|
-
@RequestMapping("/api/users")
|
|
17
|
-
@RequiredArgsConstructor
|
|
18
|
-
public class UserController {
|
|
19
|
-
|
|
20
|
-
private final UserService userService;
|
|
21
|
-
|
|
22
|
-
@GetMapping
|
|
23
|
-
public ResponseEntity<List<User>> getAllUsers() {
|
|
24
|
-
return ResponseEntity.ok(userService.findAll());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@GetMapping("/{id}")
|
|
28
|
-
public ResponseEntity<User> getUserById(@PathVariable Long id) {
|
|
29
|
-
return userService.findById(id)
|
|
30
|
-
.map(ResponseEntity::ok)
|
|
31
|
-
.orElse(ResponseEntity.notFound().build());
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@GetMapping("/email/{email}")
|
|
35
|
-
public ResponseEntity<User> getUserByEmail(@PathVariable String email) {
|
|
36
|
-
return userService.findByEmail(email)
|
|
37
|
-
.map(ResponseEntity::ok)
|
|
38
|
-
.orElse(ResponseEntity.notFound().build());
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@PostMapping
|
|
42
|
-
public ResponseEntity<User> createUser(@Valid @RequestBody UserCreateRequest request) {
|
|
43
|
-
User user = new User();
|
|
44
|
-
user.setName(request.name());
|
|
45
|
-
user.setEmail(request.email());
|
|
46
|
-
|
|
47
|
-
User createdUser = userService.create(user);
|
|
48
|
-
return ResponseEntity.status(HttpStatus.CREATED).body(createdUser);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@PutMapping("/{id}")
|
|
52
|
-
public ResponseEntity<User> updateUser(@PathVariable Long id, @Valid @RequestBody UserUpdateRequest request) {
|
|
53
|
-
User userDetails = new User();
|
|
54
|
-
userDetails.setName(request.name());
|
|
55
|
-
userDetails.setEmail(request.email());
|
|
56
|
-
|
|
57
|
-
User updatedUser = userService.update(id, userDetails);
|
|
58
|
-
return ResponseEntity.ok(updatedUser);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@DeleteMapping("/{id}")
|
|
62
|
-
public ResponseEntity<Void> deleteUser(@PathVariable Long id) {
|
|
63
|
-
userService.delete(id);
|
|
64
|
-
return ResponseEntity.noContent().build();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public record UserCreateRequest(
|
|
68
|
-
@NotBlank(message = "Name is required")
|
|
69
|
-
String name,
|
|
70
|
-
|
|
71
|
-
@NotBlank(message = "Email is required")
|
|
72
|
-
@Email(message = "Invalid email format")
|
|
73
|
-
String email
|
|
74
|
-
) {}
|
|
75
|
-
|
|
76
|
-
public record UserUpdateRequest(
|
|
77
|
-
@NotBlank(message = "Name is required")
|
|
78
|
-
String name,
|
|
79
|
-
|
|
80
|
-
@NotBlank(message = "Email is required")
|
|
81
|
-
@Email(message = "Invalid email format")
|
|
82
|
-
String email
|
|
83
|
-
) {}
|
|
84
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
package com.example.demo.models;
|
|
2
|
-
|
|
3
|
-
import jakarta.persistence.*;
|
|
4
|
-
import lombok.*;
|
|
5
|
-
import java.time.LocalDateTime;
|
|
6
|
-
|
|
7
|
-
@Entity
|
|
8
|
-
@Table(name = "comments")
|
|
9
|
-
@Getter
|
|
10
|
-
@Setter
|
|
11
|
-
@NoArgsConstructor
|
|
12
|
-
@AllArgsConstructor
|
|
13
|
-
@Builder
|
|
14
|
-
public class Comment {
|
|
15
|
-
|
|
16
|
-
@Id
|
|
17
|
-
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
18
|
-
private Long id;
|
|
19
|
-
|
|
20
|
-
@Column(length = 1000, nullable = false)
|
|
21
|
-
private String content;
|
|
22
|
-
|
|
23
|
-
@ManyToOne(fetch = FetchType.LAZY)
|
|
24
|
-
@JoinColumn(name = "post_id", nullable = false)
|
|
25
|
-
private Post post;
|
|
26
|
-
|
|
27
|
-
@ManyToOne(fetch = FetchType.LAZY)
|
|
28
|
-
@JoinColumn(name = "user_id", nullable = false)
|
|
29
|
-
private User user;
|
|
30
|
-
|
|
31
|
-
@Column(name = "created_at")
|
|
32
|
-
private LocalDateTime createdAt;
|
|
33
|
-
|
|
34
|
-
@PrePersist
|
|
35
|
-
protected void onCreate() {
|
|
36
|
-
createdAt = LocalDateTime.now();
|
|
37
|
-
}
|
|
38
|
-
}
|