first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Fitness_core_BE.Services.ActivityLog;
|
||||
using Fitness_core_BE.Interfaces.Services;
|
||||
|
||||
namespace Fitness_core_BE.Services.FunctionHandler
|
||||
{
|
||||
public class ActivityLogFuncHandler
|
||||
{
|
||||
private readonly IActivityLogService _activityLogService;
|
||||
|
||||
public ActivityLogFuncHandler(IActivityLogService activityLogService)
|
||||
{
|
||||
_activityLogService = activityLogService;
|
||||
}
|
||||
|
||||
public async Task<object> ExecuteAsync(string functionName, object payload, HttpContext httpContext)
|
||||
{
|
||||
return functionName switch
|
||||
{
|
||||
"LogActivity" => await _activityLogService.LogActivity(payload, httpContext),
|
||||
"GetActivityLogs" => await _activityLogService.GetActivityLogs(payload, httpContext),
|
||||
_ => throw new NotImplementedException($"Function '{functionName}' is not implemented.")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user