-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/Smartstore.Modules/Smartstore.WebApi/Controllers/Identity/WalletHistoryController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using Smartstore.Core.Checkout.Orders; | ||
using Smartstore.Core.Identity; | ||
|
||
namespace Smartstore.Web.Api.Controllers | ||
{ | ||
/// <summary> | ||
/// The endpoint for operations on WalletHistory entity. | ||
/// </summary> | ||
public class WalletHistoryController : WebApiController<WalletHistory> | ||
{ | ||
[HttpGet("WalletHistory"), ApiQueryable] | ||
[Permission("Wallet.read")] | ||
public IQueryable<WalletHistory> Get() | ||
{ | ||
return Entities.AsNoTracking(); | ||
} | ||
|
||
[HttpGet("WalletHistory({key})"), ApiQueryable] | ||
[Permission("Wallet.read")] | ||
public SingleResult<WalletHistory> Get(int key) | ||
{ | ||
return GetById(key); | ||
} | ||
|
||
[HttpGet("WalletHistory({key})/Customer"), ApiQueryable] | ||
[Permission(Permissions.Customer.Read)] | ||
public SingleResult<Customer> GetCustomer(int key) | ||
{ | ||
return GetRelatedEntity(key, x => x.Customer); | ||
} | ||
|
||
[HttpGet("WalletHistory({key})/Order"), ApiQueryable] | ||
[Permission(Permissions.Order.Read)] | ||
public SingleResult<Order> GetOrder(int key) | ||
{ | ||
return GetRelatedEntity(key, x => x.Order); | ||
} | ||
|
||
[HttpPost] | ||
[Permission("Wallet.create")] | ||
public Task<IActionResult> Post([FromBody] WalletHistory model) | ||
{ | ||
return PostAsync(model); | ||
} | ||
|
||
[HttpPut] | ||
[Permission("Wallet.update")] | ||
public Task<IActionResult> Put(int key, Delta<WalletHistory> model) | ||
{ | ||
return PutAsync(key, model); | ||
} | ||
|
||
[HttpPatch] | ||
[Permission("Wallet.update")] | ||
public Task<IActionResult> Patch(int key, Delta<WalletHistory> model) | ||
{ | ||
return PatchAsync(key, model); | ||
} | ||
|
||
[HttpDelete] | ||
[Permission("Wallet.delete")] | ||
public Task<IActionResult> Delete(int key) | ||
{ | ||
return DeleteAsync(key); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters