-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Khurshid0109/dev
This keyword replaced with underscore and responce model removed from…
- Loading branch information
Showing
20 changed files
with
219 additions
and
436 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
41 changes: 7 additions & 34 deletions
41
...amsheer.Messenger.Api/Controllers/Authorizations/Channels/ChannelPermissionsController.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 |
---|---|---|
@@ -1,62 +1,35 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Shamsheer.Domain.Enums.Chats; | ||
using Shamsheer.Messenger.Api.Helpers; | ||
using Shamsheer.Service.Interfaces.Authorizations; | ||
using Shamsheer.Service.Interfaces.Authorizations.Channels; | ||
|
||
namespace Shamsheer.Messenger.Api.Controllers.Authorizations.Channels; | ||
|
||
public class ChannelPermissionsController : BaseController | ||
{ | ||
private readonly IChannelPermissionService channelPermissionService; | ||
private readonly IChannelPermissionService _channelPermissionService; | ||
|
||
public ChannelPermissionsController(IChannelPermissionService channelPermissionService) | ||
{ | ||
this.channelPermissionService = channelPermissionService; | ||
_channelPermissionService = channelPermissionService; | ||
} | ||
|
||
[HttpPost] | ||
public async Task<IActionResult> PostAsync([FromBody] ChannelPermissionType type) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelPermissionService.CreateAsync(type) | ||
}); | ||
=> Ok(await _channelPermissionService.CreateAsync(type)); | ||
|
||
[HttpGet()] | ||
public async Task<IActionResult> GetAllAsync() | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelPermissionService.RetrieveAllAsync() | ||
}); | ||
=> Ok(await _channelPermissionService.RetrieveAllAsync()); | ||
|
||
[HttpGet("{id}")] | ||
public async Task<IActionResult> GetAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelPermissionService.RetrieveByIdAsync(id) | ||
}); | ||
=> Ok(await _channelPermissionService.RetrieveByIdAsync(id)); | ||
|
||
[HttpPut("{id}")] | ||
public async Task<IActionResult> PutAsync([FromRoute(Name = "id")] long id, [FromBody] ChannelPermissionType type) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelPermissionService.ModifyAsync(id, type) | ||
}); | ||
=> Ok(await _channelPermissionService.ModifyAsync(id, type)); | ||
|
||
[HttpDelete("{id}")] | ||
public async Task<IActionResult> DeleteAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelPermissionService.RemoveAsync(id) | ||
}); | ||
=> Ok(await _channelPermissionService.RemoveAsync(id)); | ||
} |
41 changes: 7 additions & 34 deletions
41
src/Shamsheer.Messenger.Api/Controllers/Authorizations/Channels/ChannelRolesController.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 |
---|---|---|
@@ -1,63 +1,36 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Shamsheer.Domain.Enums.Chats; | ||
using Shamsheer.Messenger.Api.Helpers; | ||
using Shamsheer.Service.Interfaces.Authorizations; | ||
using Shamsheer.Service.Interfaces.Authorizations.Channels; | ||
|
||
namespace Shamsheer.Messenger.Api.Controllers.Authorizations.Channels | ||
{ | ||
public class ChannelRolesController : BaseController | ||
{ | ||
private readonly IChannelRoleService channelRoleService; | ||
private readonly IChannelRoleService _channelRoleService; | ||
|
||
public ChannelRolesController(IChannelRoleService channelRoleService) | ||
{ | ||
this.channelRoleService = channelRoleService; | ||
_channelRoleService = channelRoleService; | ||
} | ||
|
||
[HttpPost] | ||
public async Task<IActionResult> PostAsync([FromBody] ChatRole chatRole) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelRoleService.CreateAsync(chatRole) | ||
}); | ||
=> Ok(await _channelRoleService.CreateAsync(chatRole)); | ||
|
||
[HttpGet()] | ||
public async Task<IActionResult> GetAllAsync() | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelRoleService.RetrieveAllAsync() | ||
}); | ||
=> Ok(await _channelRoleService.RetrieveAllAsync()); | ||
|
||
[HttpGet("{id}")] | ||
public async Task<IActionResult> GetAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelRoleService.RetrieveByIdAsync(id) | ||
}); | ||
=> Ok(await _channelRoleService.RetrieveByIdAsync(id)); | ||
|
||
[HttpPut("{id}")] | ||
public async Task<IActionResult> PutAsync([FromRoute(Name = "id")] long id, [FromBody] ChatRole chatRole) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelRoleService.ModifyAsync(id, chatRole) | ||
}); | ||
=> Ok(await _channelRoleService.ModifyAsync(id, chatRole)); | ||
|
||
[HttpDelete("{id}")] | ||
public async Task<IActionResult> DeleteAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(new Response() | ||
{ | ||
Code = 200, | ||
Message = "Success", | ||
Data = await this.channelRoleService.RemoveAsync(id) | ||
}); | ||
=> Ok(await _channelRoleService.RemoveAsync(id)); | ||
} | ||
} |
62 changes: 0 additions & 62 deletions
62
src/Shamsheer.Messenger.Api/Controllers/Authorizations/GroupPermissionsController.cs
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
src/Shamsheer.Messenger.Api/Controllers/Authorizations/GroupRolesController.cs
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/Shamsheer.Messenger.Api/Controllers/Authorizations/Groups/GroupPermissionsController.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,36 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Shamsheer.Domain.Enums.Chats; | ||
using Shamsheer.Service.Interfaces.Authorizations; | ||
|
||
namespace Shamsheer.Messenger.Api.Controllers.Authorizations.Groups; | ||
|
||
public class GroupPermissionsController : BaseController | ||
{ | ||
|
||
private readonly IGroupPermissionService _groupPermissionService; | ||
|
||
public GroupPermissionsController(IGroupPermissionService groupPermissionService) | ||
{ | ||
_groupPermissionService = groupPermissionService; | ||
} | ||
|
||
[HttpPost] | ||
public async Task<IActionResult> PostAsync([FromBody] GroupPermissionType type) | ||
=> Ok(await _groupPermissionService.CreateAsync(type)); | ||
|
||
[HttpGet()] | ||
public async Task<IActionResult> GetAllAsync() | ||
=> Ok(await _groupPermissionService.RetrieveAllAsync()); | ||
|
||
[HttpGet("{id}")] | ||
public async Task<IActionResult> GetAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(await _groupPermissionService.RetrieveByIdAsync(id)); | ||
|
||
[HttpPut("{id}")] | ||
public async Task<IActionResult> PutAsync([FromRoute(Name = "id")] long id, [FromBody] GroupPermissionType type) | ||
=> Ok(await _groupPermissionService.ModifyAsync(id, type)); | ||
|
||
[HttpDelete("{id}")] | ||
public async Task<IActionResult> DeleteAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(await _groupPermissionService.RemoveAsync(id)); | ||
} |
35 changes: 35 additions & 0 deletions
35
src/Shamsheer.Messenger.Api/Controllers/Authorizations/Groups/GroupRolesController.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,35 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Shamsheer.Domain.Enums.Chats; | ||
using Shamsheer.Service.Interfaces.Authorizations; | ||
|
||
namespace Shamsheer.Messenger.Api.Controllers.Authorizations.Groups; | ||
|
||
public class GroupRolesController : BaseController | ||
{ | ||
private readonly IGroupRoleService _groupRoleService; | ||
|
||
public GroupRolesController(IGroupRoleService groupRoleService) | ||
{ | ||
_groupRoleService = groupRoleService; | ||
} | ||
|
||
[HttpPost] | ||
public async Task<IActionResult> PostAsync([FromBody] ChatRole chatRole) | ||
=> Ok(await _groupRoleService.CreateAsync(chatRole)); | ||
|
||
[HttpGet()] | ||
public async Task<IActionResult> GetAllAsync() | ||
=> Ok(await _groupRoleService.RetrieveAllAsync()); | ||
|
||
[HttpGet("{id}")] | ||
public async Task<IActionResult> GetAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(await _groupRoleService.RetrieveByIdAsync(id)); | ||
|
||
[HttpPut("{id}")] | ||
public async Task<IActionResult> PutAsync([FromRoute(Name = "id")] long id, [FromBody] ChatRole chatRole) | ||
=> Ok(await _groupRoleService.ModifyAsync(id, chatRole)); | ||
|
||
[HttpDelete("{id}")] | ||
public async Task<IActionResult> DeleteAsync([FromRoute(Name = "id")] long id) | ||
=> Ok(await _groupRoleService.RemoveAsync(id)); | ||
} |
Oops, something went wrong.