Skip to content

ayseglaydgan/Patika-FordOtosan-.Net_Bootcamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patika Ford Otosan Bootcamp HW-02 NICEAPI

Data Tables

My Image

API Reference for Account

GetAll()

  GET patika/hw01/NiceAPI/Account
Parameter Type Description
no parameter Required. Authorization

Shows all account infos

GetUserDetail()

  GET /patika/hw01/NiceAPI/Account/GetUserDetail
Parameter Type Description
no parameter Required. Id of item to fetch

Shows infos which is belong to the Authorized account

POST()

  POST patika/hw01/NiceAPI/Account
Parameter Type Description
Request AccountDTO Required. Authorization & Roles = Role.Admin

If Authorized account is "admin", then it can post new Account infos.

PUT()

  PUT patika/hw01/NiceAPI/Account/{id}
Parameter Type Description
id, Request AccountDTO Required. Authorization & Roles = Role.Admin

If Authorized account is "admin", then it can update every Account infos.

PUT()

  Put patika/hw01/NiceAPI/Account
Parameter Type Description
Request AccountDTO Required. Authorization & Roles = RolesExceptAdmin

If Authorized account is NOT "admin", then it can update only its own infos.

DELETE()

  DELETE patika/hw01/NiceAPI/Account/{id}
Parameter Type Description
id int Required. Authorization & Roles = Role.Admin

If Authorized account is "admin", then it can delete every Account infos.

DELETE()

  Put patika/hw01/NiceAPI/Account
Parameter Type Description
no parameter Required. Authorization & Roles = RolesExceptAdmin

If Authorized account is NOT "admin", then it can delete only its own infos.

API Reference for Person

GetAll()

  GET /patika/hw01/NiceAPI/Person
Parameter Type Description
no parameter Required. Authorization

Shows all person infos which belongs to Authorized account

GetById()

  GET /patika/hw01/NiceAPI/Person/{id}
Parameter Type Description
id int Required. Id of item to fetch

Shows person infos if Authorized account has a access to see that person. In this endpoint, admin has not have advantage. It can be modified.

POST()

  POST patika/hw01/NiceAPI/Account
Parameter Type Description
Request PersonDTO Required. Authorization

Post new person infos to the your Authorized account. That means accountId of the new person cames from Authorized account's id. If the role is admin, it can post new person any account.

PUT()

  PUT patika/hw01/NiceAPI/Account/{id}
Parameter Type Description
id, Request PersonDTO Required. Authorization

If Authorized account is "admin", then it can update every Account infos. OR if your account's id is the same as person's accountId, then you can update it.

DELETE()

  DELETE patika/hw01/NiceAPI/Account/{id}
Parameter Type Description
id, Request PersonDTO Required. Authorization

If Authorized account is "admin", then it can delete every Account infos. OR if your account's id is the same as person's accountId, then you can delete it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages