Compare commits

..

No commits in common. "c3c740ed7847773c8d7d1aa904227c0d3e5ccf91" and "cf5bb3bc7cc608f4dbfe8374997803737134257c" have entirely different histories.

10 changed files with 11 additions and 140 deletions

View File

@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc;
namespace LFlow.Home.Controllers;
public class HomeController(IHomeService<HomeDto, string> service) : BaseController
{
[HttpGet]
[HttpGet("/[controller]/")]
public string Home(string id)
{
return service?.GetById(id)?.ToString() ?? "No service";

View File

@ -1,17 +1,15 @@
using LFlow.Base.Interfaces;
using SqlSugar;
namespace LFlow.Home.Models.DataModels;
[SugarTable("T_B_HOME")]
public class HomeModel : IDataModel
{
/// <summary>
/// ID - GUID
/// ID
/// </summary>
[SugarColumn(ColumnName = "ID", IsPrimaryKey = true)]
public string? Id { get; set; }
public override string ToString()
{
return $"HomeModel {Id}";

View File

@ -3,11 +3,10 @@ using LFlow.Base.Interfaces;
// using LFlow.Interfaces;
using LFlow.Home.Models.DataModels;
using SqlSugar;
namespace LFlow.Home.Repositorys;
public class HomeRepo(ISqlSugarClient db) : IRepo<HomeModel, string>
public class HomeRepo : IRepo<HomeModel, string>
{
public HomeModel Delete(string id)
{

View File

@ -1,16 +1,9 @@
using LFlow.Base.Interfaces;
using LFlow.Base.Interfaces.BusinessInterface;
using LFlow.User.Model.Dto;
using Microsoft.AspNetCore.Mvc;
namespace LFlow.User.Controllers
{
public class UserController(IUserService<UserDto> service) : BaseController
public class UserController : BaseController
{
[HttpGet]
public string Get(string id)
{
return service?.GetById(id)?.ToString() ?? "No service";
}
}
}

View File

@ -13,4 +13,8 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<Folder Include="Services/" />
</ItemGroup>
</Project>

View File

@ -1,14 +0,0 @@
using System;
using LFlow.Base.Interfaces;
namespace LFlow.User.Model.DataModel;
public record UserModel : IDataModel
{
public string? UserID { get; set; }
public string? UserName { get; set; }
public string? UserNickName { get; set; }
public string? EmailAddress { get; set; }
public string? RoleId { get; set; }
}

View File

@ -1,19 +0,0 @@
using System;
using LFlow.Base.Interfaces;
namespace LFlow.User.Model.Dto;
public class UserDto : IModel
{
public string? UserID { get; set; }
public string? UserName { get; set; }
public string? UserNickName { get; set; }
public string? EmailAddress { get; set; }
public string? RoleId { get; set; }
public override string ToString()
{
return $"UserDto [{UserID}_{UserName}_{UserNickName}_{EmailAddress}]";
}
}

View File

@ -1,41 +0,0 @@
using System;
using LFlow.Base.Interfaces;
using LFlow.User.Model.DataModel;
using SqlSugar;
namespace LFlow.User.Repositorys;
public class UserRepo(ISqlSugarClient db) : IRepo<UserModel, string>
{
public UserModel Delete(string id)
{
throw new NotImplementedException();
}
public UserModel Get(string id)
{
return new UserModel
{
UserID = id,
UserName = "Test User",
UserNickName = "Tester",
EmailAddress = "Test@Ling.chat",
};
}
public UserModel SaveOrUpdate(UserModel entity, bool isUpdate)
{
throw new NotImplementedException();
}
public List<UserModel> Search(UserModel whereObj)
{
throw new NotImplementedException();
}
public List<string> WhereSearchId(UserModel whereObj)
{
throw new NotImplementedException();
}
}

View File

@ -1,32 +0,0 @@
using System;
using LFlow.Base.Interfaces;
using LFlow.Base.Interfaces.BusinessInterface;
using LFlow.Base.Utils;
using LFlow.User.Model.DataModel;
using LFlow.User.Model.Dto;
namespace LFlow.User.Services;
public class UserService(IRepo<UserModel, string> repo) : IUserService<UserDto>
{
public UserDto DeleteById(string id)
{
throw new NotImplementedException();
}
public UserDto GetById(string id)
{
var user = repo.Get(id);
return Mapper.Map<UserDto>(user);
}
public UserDto Save(UserDto entity)
{
throw new NotImplementedException();
}
public List<UserDto> Search(UserDto whereObj)
{
throw new NotImplementedException();
}
}

View File

@ -21,20 +21,6 @@ public static class Program
builder.Services.AddHttpContextAccessor();
builder.Services.ConfigureSqlSugar();
builder.Services.AddControllers();
builder.Services.AddSwaggerGen(u =>
{
u.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo
{
Version = "Ver.1",
Title = "LFlow",
Description = "LFlow api test and document",
Contact = new Microsoft.OpenApi.Models.OpenApiContact
{
Name = "ling",
Email = "noemail@ling.chat"
}
});
});
var app = builder.Build();
app.MapControllers();
@ -42,10 +28,7 @@ public static class Program
// if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(u =>
{
u.DocumentTitle = "LFlow";
});
app.UseSwaggerUI();
}
app.Run();
}