First commit
This commit is contained in:
30
ShopAPI/.dockerignore
Normal file
30
ShopAPI/.dockerignore
Normal file
@@ -0,0 +1,30 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
!**/.gitignore
|
||||
!.git/HEAD
|
||||
!.git/config
|
||||
!.git/packed-refs
|
||||
!.git/refs/heads/**
|
||||
BIN
ShopAPI/.vs/ProjectEvaluation/shopapi.metadata.v9.bin
Normal file
BIN
ShopAPI/.vs/ProjectEvaluation/shopapi.metadata.v9.bin
Normal file
Binary file not shown.
BIN
ShopAPI/.vs/ProjectEvaluation/shopapi.projects.v9.bin
Normal file
BIN
ShopAPI/.vs/ProjectEvaluation/shopapi.projects.v9.bin
Normal file
Binary file not shown.
BIN
ShopAPI/.vs/ProjectEvaluation/shopapi.strings.v9.bin
Normal file
BIN
ShopAPI/.vs/ProjectEvaluation/shopapi.strings.v9.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/.vs/ShopAPI/DesignTimeBuild/.dtbcache.v2
Normal file
BIN
ShopAPI/.vs/ShopAPI/DesignTimeBuild/.dtbcache.v2
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/.vs/ShopAPI/v17/.futdcache.v2
Normal file
BIN
ShopAPI/.vs/ShopAPI/v17/.futdcache.v2
Normal file
Binary file not shown.
BIN
ShopAPI/.vs/ShopAPI/v17/.suo
Normal file
BIN
ShopAPI/.vs/ShopAPI/v17/.suo
Normal file
Binary file not shown.
177
ShopAPI/.vs/ShopAPI/v17/DocumentLayout.backup.json
Normal file
177
ShopAPI/.vs/ShopAPI/v17/DocumentLayout.backup.json
Normal file
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\data\\appdbcontext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\data\\appdbcontext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\models\\user.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\models\\user.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\models\\payment.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\models\\payment.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\models\\category.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\models\\category.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\models\\product.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\models\\product.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\models\\orderitem.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\models\\orderitem.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\models\\order.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\models\\order.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Program.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Program.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Program.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Program.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Program.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-14T00:02:06.62Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"Title": "User.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\User.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Models\\User.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\User.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Models\\User.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAABLAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-11T09:48:28.817Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "AppDbContext.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Data\\AppDbContext.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Data\\AppDbContext.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Data\\AppDbContext.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Data\\AppDbContext.cs",
|
||||
"ViewState": "AgIAACgAAAAAAAAAAAAYwDkAAAAJAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-13T23:17:21.987Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "appsettings.json",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\appsettings.json",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\appsettings.json",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\appsettings.json",
|
||||
"RelativeToolTip": "ShopAPI\\appsettings.json",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAFAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
|
||||
"WhenOpened": "2026-03-12T11:39:23.536Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"Title": "Payment.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Payment.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Models\\Payment.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Payment.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Models\\Payment.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAbAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-12T11:32:19.944Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 7,
|
||||
"Title": "OrderItem.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\OrderItem.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Models\\OrderItem.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\OrderItem.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Models\\OrderItem.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAQAAAASAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-12T11:31:26.081Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 6,
|
||||
"Title": "Product.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Product.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Models\\Product.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Product.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Models\\Product.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAoAAAAwAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-12T11:27:05.792Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"Title": "Category.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Category.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Models\\Category.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Category.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Models\\Category.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAYAAABRAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-12T11:25:09.147Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 8,
|
||||
"Title": "Order.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Order.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Models\\Order.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Models\\Order.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Models\\Order.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAYAAAA2AAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-11T09:49:53.306Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
126
ShopAPI/.vs/ShopAPI/v17/DocumentLayout.json
Normal file
126
ShopAPI/.vs/ShopAPI/v17/DocumentLayout.json
Normal file
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\controllers\\authcontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\controllers\\authcontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\services\\authservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\services\\authservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\dtos\\registerdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\dtos\\registerdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\data\\appdbcontext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\data\\appdbcontext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|c:\\users\\bib\\desktop\\projekt-fluxon\\website_fluxon\\shopapi\\shopapi\\dtos\\logindto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{154C8A2E-F4A9-49D0-B845-3319E9C04489}|ShopAPI\\ShopAPI.csproj|solutionrelative:shopapi\\dtos\\logindto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "AuthController.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Controllers\\AuthController.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Controllers\\AuthController.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Controllers\\AuthController.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Controllers\\AuthController.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-15T00:14:13.509Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "AuthService.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Services\\AuthService.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Services\\AuthService.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Services\\AuthService.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Services\\AuthService.cs",
|
||||
"ViewState": "AgIAAAMAAAAAAAAAAAAAABsAAAANAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-14T23:14:57.991Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "appsettings.json",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\appsettings.json",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\appsettings.json",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\appsettings.json",
|
||||
"RelativeToolTip": "ShopAPI\\appsettings.json",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
|
||||
"WhenOpened": "2026-03-14T23:24:15.85Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"Title": "RegisterDto.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\DTOs\\RegisterDto.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\DTOs\\RegisterDto.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\DTOs\\RegisterDto.cs",
|
||||
"RelativeToolTip": "ShopAPI\\DTOs\\RegisterDto.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-14T23:13:07.276Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"Title": "LoginDto.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\DTOs\\LoginDto.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\DTOs\\LoginDto.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\DTOs\\LoginDto.cs",
|
||||
"RelativeToolTip": "ShopAPI\\DTOs\\LoginDto.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAbAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-14T23:14:22.424Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"Title": "AppDbContext.cs",
|
||||
"DocumentMoniker": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Data\\AppDbContext.cs",
|
||||
"RelativeDocumentMoniker": "ShopAPI\\Data\\AppDbContext.cs",
|
||||
"ToolTip": "C:\\Users\\bib\\Desktop\\Projekt-Fluxon\\website_Fluxon\\ShopAPI\\ShopAPI\\Data\\AppDbContext.cs",
|
||||
"RelativeToolTip": "ShopAPI\\Data\\AppDbContext.cs",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2026-03-13T23:17:21.987Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
25
ShopAPI/ShopAPI.sln
Normal file
25
ShopAPI/ShopAPI.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36930.0 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShopAPI", "ShopAPI\ShopAPI.csproj", "{154C8A2E-F4A9-49D0-B845-3319E9C04489}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{154C8A2E-F4A9-49D0-B845-3319E9C04489}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{154C8A2E-F4A9-49D0-B845-3319E9C04489}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{154C8A2E-F4A9-49D0-B845-3319E9C04489}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{154C8A2E-F4A9-49D0-B845-3319E9C04489}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B0479CBD-9707-4A24-B675-4705F810EE8C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
20
ShopAPI/ShopAPI/Controllers/AuthController.cs
Normal file
20
ShopAPI/ShopAPI/Controllers/AuthController.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ShopAPI.DTOs;
|
||||
using ShopAPI.Services;
|
||||
|
||||
namespace ShopAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class AuthController : ControllerBase
|
||||
{
|
||||
private readonly AuthService _authService;
|
||||
|
||||
public AuthController(AuthService authService)
|
||||
{
|
||||
_authService = authService;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/Controllers/CategoryController.cs
Normal file
6
ShopAPI/ShopAPI/Controllers/CategoryController.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.Controllers
|
||||
{
|
||||
public class CategoryController
|
||||
{
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/Controllers/OrderController.cs
Normal file
6
ShopAPI/ShopAPI/Controllers/OrderController.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.Controllers
|
||||
{
|
||||
public class OrderController
|
||||
{
|
||||
}
|
||||
}
|
||||
7
ShopAPI/ShopAPI/Controllers/PaymentController.cs
Normal file
7
ShopAPI/ShopAPI/Controllers/PaymentController.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace ShopAPI.Controllers
|
||||
{
|
||||
public class PaymentController
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/Controllers/ProductController.cs
Normal file
6
ShopAPI/ShopAPI/Controllers/ProductController.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.Controllers
|
||||
{
|
||||
public class ProductController
|
||||
{
|
||||
}
|
||||
}
|
||||
33
ShopAPI/ShopAPI/Controllers/WeatherForecastController.cs
Normal file
33
ShopAPI/ShopAPI/Controllers/WeatherForecastController.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ShopAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class WeatherForecastController : ControllerBase
|
||||
{
|
||||
private static readonly string[] Summaries = new[]
|
||||
{
|
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||
};
|
||||
|
||||
private readonly ILogger<WeatherForecastController> _logger;
|
||||
|
||||
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetWeatherForecast")]
|
||||
public IEnumerable<WeatherForecast> Get()
|
||||
{
|
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
TemperatureC = Random.Shared.Next(-20, 55),
|
||||
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
8
ShopAPI/ShopAPI/DTOs/LoginDto.cs
Normal file
8
ShopAPI/ShopAPI/DTOs/LoginDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace ShopAPI.DTOs
|
||||
{
|
||||
public class LoginDto
|
||||
{
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/DTOs/OrderDto.cs
Normal file
6
ShopAPI/ShopAPI/DTOs/OrderDto.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.DTOs
|
||||
{
|
||||
public class OrderDto
|
||||
{
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/DTOs/ProductDto.cs
Normal file
6
ShopAPI/ShopAPI/DTOs/ProductDto.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.DTOs
|
||||
{
|
||||
public class ProductDto
|
||||
{
|
||||
}
|
||||
}
|
||||
9
ShopAPI/ShopAPI/DTOs/RegisterDto.cs
Normal file
9
ShopAPI/ShopAPI/DTOs/RegisterDto.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace ShopAPI.DTOs
|
||||
{
|
||||
public class RegisterDto
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
62
ShopAPI/ShopAPI/Data/AppDbContext.cs
Normal file
62
ShopAPI/ShopAPI/Data/AppDbContext.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ShopAPI.Models;
|
||||
|
||||
|
||||
namespace ShopAPI.Data
|
||||
{
|
||||
public class AppDbContext : DbContext
|
||||
{
|
||||
// Appdbcontext ist Brücke zwischen Datenbank und Anwendung
|
||||
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
|
||||
|
||||
public DbSet<User> Users => Set<User>();
|
||||
public DbSet<Product> Products => Set<Product>();
|
||||
public DbSet<Category> Categories => Set<Category>();
|
||||
public DbSet<Order> Orders => Set<Order>();
|
||||
public DbSet<OrderItem> OrderItems => Set<OrderItem>();
|
||||
public DbSet<Payment> Payments => Set<Payment>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
// Das nennt man Fluent API, damit können wir die Beziehungen zwischen den Tabellen definieren
|
||||
modelBuilder.Entity<Order>()
|
||||
.HasOne(o => o.User)
|
||||
.WithMany(u => u.orders)
|
||||
.HasForeignKey(o => o.UserId);
|
||||
|
||||
modelBuilder.Entity<OrderItem>()
|
||||
.HasOne(oi => oi.Order)
|
||||
.WithMany(o => o.OrderItems)
|
||||
.HasForeignKey(oi => oi.OrderId);
|
||||
|
||||
modelBuilder.Entity<OrderItem>()
|
||||
.HasOne(oi => oi.Product)
|
||||
.WithMany()
|
||||
.HasForeignKey(oi => oi.ProductId);
|
||||
|
||||
modelBuilder.Entity<Product>()
|
||||
.HasOne(p => p.Category)
|
||||
.WithMany(c => c.Products)
|
||||
.HasForeignKey(p => p.CategoryId);
|
||||
|
||||
modelBuilder.Entity<Order>()
|
||||
.HasOne(o => o.Payment)
|
||||
.WithOne(p => p.Order)
|
||||
.HasForeignKey<Payment>(p => p.OrderId);
|
||||
|
||||
modelBuilder.Entity<Product>()
|
||||
.Property(p => p.Price)
|
||||
.HasColumnType("decimal(10,2)");
|
||||
|
||||
modelBuilder.Entity<OrderItem>()
|
||||
.Property(oi => oi.UnitPrice)
|
||||
.HasColumnType("decimal(10,2)");
|
||||
|
||||
modelBuilder.Entity<Payment>()
|
||||
.Property(p => p.Amount)
|
||||
.HasColumnType("decimal(10,2)");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
30
ShopAPI/ShopAPI/Dockerfile
Normal file
30
ShopAPI/ShopAPI/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# Unter https://aka.ms/customizecontainer erfahren Sie, wie Sie Ihren Debugcontainer anpassen und wie Visual Studio dieses Dockerfile verwendet, um Ihre Images für ein schnelleres Debuggen zu erstellen.
|
||||
|
||||
# Diese Stufe wird verwendet, wenn sie von VS im Schnellmodus ausgeführt wird (Standardeinstellung für Debugkonfiguration).
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
|
||||
# Diese Stufe wird zum Erstellen des Dienstprojekts verwendet.
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["ShopAPI/ShopAPI.csproj", "ShopAPI/"]
|
||||
RUN dotnet restore "./ShopAPI/ShopAPI.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/ShopAPI"
|
||||
RUN dotnet build "./ShopAPI.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
# Diese Stufe wird verwendet, um das Dienstprojekt zu veröffentlichen, das in die letzte Phase kopiert werden soll.
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./ShopAPI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# Diese Stufe wird in der Produktion oder bei Ausführung von VS im regulären Modus verwendet (Standard, wenn die Debugkonfiguration nicht verwendet wird).
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "ShopAPI.dll"]
|
||||
9
ShopAPI/ShopAPI/Models/Category.cs
Normal file
9
ShopAPI/ShopAPI/Models/Category.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace ShopAPI.Models
|
||||
{
|
||||
public class Category
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
}
|
||||
}
|
||||
13
ShopAPI/ShopAPI/Models/Order.cs
Normal file
13
ShopAPI/ShopAPI/Models/Order.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ShopAPI.Models
|
||||
{
|
||||
public class Order
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime Createdat { get; set; } = DateTime.UtcNow;
|
||||
public string Status { get; set; } = "Pending";
|
||||
public int UserId { get; set; }
|
||||
public User? User { get; set; }
|
||||
public ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
|
||||
public Payment? Payment { get; set; }
|
||||
}
|
||||
}
|
||||
13
ShopAPI/ShopAPI/Models/OrderItem.cs
Normal file
13
ShopAPI/ShopAPI/Models/OrderItem.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ShopAPI.Models
|
||||
{
|
||||
public class OrderItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
public int OrderId { get; set; }
|
||||
public Order Order { get; set; } = null!;
|
||||
public int ProductId { get; set; }
|
||||
public Product Product { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
13
ShopAPI/ShopAPI/Models/Payment.cs
Normal file
13
ShopAPI/ShopAPI/Models/Payment.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ShopAPI.Models
|
||||
{
|
||||
public class Payment
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
public string Method { get; set; } = string.Empty; //"CreditCard", "PayPal"
|
||||
public string Status { get; set; } = "Pending";
|
||||
public DateTime PaidAt { get; set; }
|
||||
public int OrderId { get; set; }
|
||||
public Order Order { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
13
ShopAPI/ShopAPI/Models/Product.cs
Normal file
13
ShopAPI/ShopAPI/Models/Product.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ShopAPI.Models
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public decimal Price { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public int CategoryId { get; set; }
|
||||
public Category? Category { get; set; }
|
||||
}
|
||||
}
|
||||
12
ShopAPI/ShopAPI/Models/User.cs
Normal file
12
ShopAPI/ShopAPI/Models/User.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace ShopAPI.Models
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string name { get; set; } = string.Empty;
|
||||
public string email { get; set; } = string.Empty;
|
||||
public string passwordHash { get; set; } = string.Empty;
|
||||
public string Role { get; set; } = "Customer";
|
||||
public ICollection<Order> orders { get; set; } = new List<Order>();
|
||||
}
|
||||
}
|
||||
26
ShopAPI/ShopAPI/Program.cs
Normal file
26
ShopAPI/ShopAPI/Program.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ShopAPI.Data;
|
||||
|
||||
namespace ShopAPI
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// MySQL Verbindung
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
builder.Services.AddDbContext<AppDbContext>(options =>
|
||||
options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString))
|
||||
);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapControllers();
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
ShopAPI/ShopAPI/Properties/launchSettings.json
Normal file
52
ShopAPI/ShopAPI/Properties/launchSettings.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5276"
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "https://localhost:7280;http://localhost:5276"
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Container (Dockerfile)": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_HTTPS_PORTS": "8081",
|
||||
"ASPNETCORE_HTTP_PORTS": "8080"
|
||||
},
|
||||
"publishAllPorts": true,
|
||||
"useSSL": true
|
||||
}
|
||||
},
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:8726",
|
||||
"sslPort": 44320
|
||||
}
|
||||
}
|
||||
}
|
||||
87
ShopAPI/ShopAPI/Services/AuthService.cs
Normal file
87
ShopAPI/ShopAPI/Services/AuthService.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using ShopAPI.Data;
|
||||
using ShopAPI.DTOs;
|
||||
using ShopAPI.Models;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.IdentityModel.Tokens; // Hinzugefügt für SymmetricSecurityKey
|
||||
using System.Text;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
namespace ShopAPI.Services
|
||||
{
|
||||
public class AuthService
|
||||
{
|
||||
|
||||
private readonly AppDbContext _db;
|
||||
private readonly IConfiguration _config;
|
||||
|
||||
public AuthService(AppDbContext db, IConfiguration config)
|
||||
{
|
||||
_db = db;
|
||||
_config = config;
|
||||
}
|
||||
|
||||
// Register
|
||||
public async Task<string> RegisterAsync(RegisterDto dto)
|
||||
{
|
||||
// hier ob email breits vergeben ist
|
||||
if(_db.Users.Any(u => u.email == dto.Email))
|
||||
{
|
||||
throw new Exception("Email already in use");
|
||||
}
|
||||
|
||||
var user = new User
|
||||
{
|
||||
name = dto.Name,
|
||||
email = dto.Email,
|
||||
passwordHash = BCrypt.Net.BCrypt.HashPassword(dto.Password),
|
||||
Role = "Customer"
|
||||
};
|
||||
|
||||
// hna i make spricher im db
|
||||
_db.Users.Add(user);
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
// Direkt einloggen -> JWT token zurückgeben
|
||||
return GenerateToken(user);
|
||||
}
|
||||
// Login
|
||||
public async Task<string> LoginAsysc(LoginDto dto)
|
||||
{
|
||||
var user = await _db.Users.FirstOrDefaultAsync(u => u.email == dto.Email);
|
||||
|
||||
if(user == null || !BCrypt.Net.BCrypt.Verify(dto.Password, user.passwordHash))
|
||||
{
|
||||
throw new Exception("Invalid email or password");
|
||||
}
|
||||
|
||||
return GenerateToken(user);
|
||||
|
||||
}
|
||||
|
||||
// Jwttoken geben
|
||||
private string GenerateToken(User user)
|
||||
{
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(ClaimTypes.NameIdentifier, user.Id.ToString()),
|
||||
new Claim(ClaimTypes.Email, user.email),
|
||||
new Claim(ClaimTypes.Role, user.Role)
|
||||
};
|
||||
|
||||
var key = new SymmetricSecurityKey(
|
||||
Encoding.UTF8.GetBytes(_config["Jwt:Secret"]!));
|
||||
|
||||
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
|
||||
var token = new JwtSecurityToken(
|
||||
issuer : _config["Jwt:Issuer"],
|
||||
audience : _config["Jwt:Audience"],
|
||||
claims : claims,
|
||||
expires : DateTime.Now.AddDays(7),
|
||||
signingCredentials : creds
|
||||
);
|
||||
|
||||
return new JwtSecurityTokenHandler().WriteToken(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/Services/OrderService.cs
Normal file
6
ShopAPI/ShopAPI/Services/OrderService.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.Services
|
||||
{
|
||||
public class OrderService
|
||||
{
|
||||
}
|
||||
}
|
||||
6
ShopAPI/ShopAPI/Services/ProductService.cs
Normal file
6
ShopAPI/ShopAPI/Services/ProductService.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ShopAPI.Services
|
||||
{
|
||||
public class ProductService
|
||||
{
|
||||
}
|
||||
}
|
||||
29
ShopAPI/ShopAPI/ShopAPI.csproj
Normal file
29
ShopAPI/ShopAPI/ShopAPI.csproj
Normal file
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>33e8cb0c-ba59-4213-842e-10895258ce75</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt.Net-Next" Version="4.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.25" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.16.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
6
ShopAPI/ShopAPI/ShopAPI.csproj.user
Normal file
6
ShopAPI/ShopAPI/ShopAPI.csproj.user
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ActiveDebugProfile>Container (Dockerfile)</ActiveDebugProfile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
6
ShopAPI/ShopAPI/ShopAPI.http
Normal file
6
ShopAPI/ShopAPI/ShopAPI.http
Normal file
@@ -0,0 +1,6 @@
|
||||
@ShopAPI_HostAddress = http://localhost:5276
|
||||
|
||||
GET {{ShopAPI_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
13
ShopAPI/ShopAPI/WeatherForecast.cs
Normal file
13
ShopAPI/ShopAPI/WeatherForecast.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ShopAPI
|
||||
{
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateOnly Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string? Summary { get; set; }
|
||||
}
|
||||
}
|
||||
8
ShopAPI/ShopAPI/appsettings.Development.json
Normal file
8
ShopAPI/ShopAPI/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
15
ShopAPI/ShopAPI/appsettings.json
Normal file
15
ShopAPI/ShopAPI/appsettings.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=mysql.pb.bib.de;uid=pbt3h24aka;pwd=K5F2K6NqZkYf;database=pbt3h24aka_WebShop;"
|
||||
|
||||
},
|
||||
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Humanizer.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Humanizer.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Microsoft.Build.Locator.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Microsoft.Build.Locator.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Microsoft.CodeAnalysis.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Microsoft.CodeAnalysis.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Microsoft.OpenApi.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Microsoft.OpenApi.dll
Normal file
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Mono.TextTemplating.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/Mono.TextTemplating.dll
Normal file
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/MySqlConnector.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/MySqlConnector.dll
Normal file
Binary file not shown.
Binary file not shown.
1072
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.deps.json
Normal file
1072
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.dll
Normal file
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.exe
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.exe
Normal file
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.pdb
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.pdb
Normal file
Binary file not shown.
20
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.runtimeconfig.json
Normal file
20
ShopAPI/ShopAPI/bin/Debug/net8.0/ShopAPI.runtimeconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App",
|
||||
"version": "8.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.GC.Server": true,
|
||||
"System.Reflection.NullabilityInfoContext.IsSupported": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"Version":1,"ManifestType":"Build","Endpoints":[]}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.CodeDom.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.CodeDom.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.Composition.Hosting.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.Composition.Hosting.dll
Normal file
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.Composition.Runtime.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.Composition.Runtime.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.IO.Pipelines.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.IO.Pipelines.dll
Normal file
Binary file not shown.
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.Text.Encodings.Web.dll
Normal file
BIN
ShopAPI/ShopAPI/bin/Debug/net8.0/System.Text.Encodings.Web.dll
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user