using Arch.EntityFrameworkCore.UnitOfWork;
using WorkStation.Server.Context.Entity;
using WorkStation.Share;

namespace WorkStation.Server.Services
{
    public class UserService(IUnitOfWork unitOfWork) : IUserService
    {
        private IUnitOfWork _unitOfWork = unitOfWork;
        public async Task<ApiResponse> AddAsync(User item)
        {
            var repository = _unitOfWork.GetRepository<User>();
            await repository.InsertAsync(item);
            var count = await _unitOfWork.SaveChangesAsync();
            return new ApiResponse(true, "添加数据", count);
        }

        public Task<ApiResponse> DelateAsync(int id)
        {
            throw new NotImplementedException();
        }

        public Task<ApiResponse> GetAllAsync()
        {
            throw new NotImplementedException();
        }

        public Task<ApiResponse> GetByIdAsync(int id)
        {
            throw new NotImplementedException();
        }

        public Task<ApiResponse> UpdateAsync(User item)
        {
            throw new NotImplementedException();
        }
    }
}
