完成模板模块动态支持命名空间

This commit is contained in:
橙子
2023-01-24 20:46:00 +08:00
parent 8a9c7e54e2
commit ec440f13b1
33 changed files with 63 additions and 263 deletions

View File

@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.BBS.Application.Contracts.School.Dtos
{
public class StudentGetOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public int? Height { get; set; }
public string? Phone { get; set; }
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.BBS.Application.Contracts.School.Dtos
{
/// <summary>
/// Student输入创建对象
/// </summary>
public class StudentCreateInputVo
{
public long Id { get; set; }
public string Name { get; set; }
public int? Height { get; set; }
public string? Phone { get; set; }
}
}

View File

@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.BBS.Application.Contracts.School.Dtos
{
public class StudentGetListInputVo : PagedAndSortedResultRequestDto
{
public long Id { get; set; }
public string Name { get; set; }
public int? Height { get; set; }
public string? Phone { get; set; }
}
}

View File

@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Ddd.Dtos;
namespace Yi.BBS.Application.Contracts.School.Dtos
{
public class StudentGetListOutputDto : IEntityDto<long>
{
public long Id { get; set; }
public string Name { get; set; }
public int? Height { get; set; }
public string? Phone { get; set; }
}
}

View File

@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.BBS.Application.Contracts.School.Dtos
{
public class StudentUpdateInputVo
{
public long Id { get; set; }
public string Name { get; set; }
public int? Height { get; set; }
public string? Phone { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.BBS.Application.Contracts.School.Dtos;
using Yi.Framework.Ddd.Services.Abstract;
namespace Yi.BBS.Application.Contracts.School
{
/// <summary>
/// Student
/// </summary>
public interface IStudentService : ICrudAppService<StudentGetOutputDto, StudentGetListOutputDto, long, StudentGetListInputVo, StudentCreateInputVo, StudentUpdateInputVo>
{
}
}

View File

@@ -1,23 +0,0 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.BBS.Application.Contracts.School.Dtos;
using Yi.BBS.Domain.School.Entities;
namespace Yi.BBS.Application.School.MapperConfig
{
public class StudentProfile: Profile
{
public StudentProfile()
{
CreateMap<StudentGetListInputVo, StudentEntity>();
CreateMap<StudentCreateInputVo, StudentEntity>();
CreateMap<StudentUpdateInputVo, StudentEntity>();
CreateMap<StudentEntity, StudentGetListOutputDto>();
CreateMap<StudentEntity, StudentGetOutputDto>();
}
}
}

View File

@@ -1,17 +0,0 @@
using Yi.BBS.Application.Contracts.School;
using NET.AutoWebApi.Setting;
using Yi.BBS.Application.Contracts.School.Dtos;
using Yi.BBS.Domain.School.Entities;
using Yi.Framework.Ddd.Services;
namespace Yi.BBS.Application.School
{
/// <summary>
/// Student服务实现
/// </summary>
[AppService]
public class StudentService : CrudAppService<StudentEntity, StudentGetOutputDto, StudentGetListOutputDto, long, StudentGetListInputVo, StudentCreateInputVo, StudentUpdateInputVo>,
IStudentService, IAutoApiService
{
}
}

View File

@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.BBS.Domain.Shared.School.ConstClasses
{
/// <summary>
/// 常量定义
/// </summary>
public class StudentConst
{
}
}

View File

@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.DataSeeds;
using Yi.Framework.Ddd.Repositories;
using Yi.BBS.Domain.School.Entities;
namespace Yi.BBS.Domain.School.DataSeeds
{
[AppService(typeof(IDataSeed))]
public class StudentDataSeed : AbstractDataSeed<StudentEntity>
{
public StudentDataSeed(IRepository<StudentEntity> repository) : base(repository)
{
}
public override List<StudentEntity> GetSeedData()
{
return new List<StudentEntity>() { new StudentEntity { Id = SnowflakeHelper.NextId, Name = "你好", Phone = "123", Height = 188, IsDeleted = false } ,
new StudentEntity { Id = SnowflakeHelper.NextId, Name = "你好1", Phone = "123", Height = 188, IsDeleted = false },
new StudentEntity { Id = SnowflakeHelper.NextId, Name = "你好2", Phone = "123", Height = 188, IsDeleted = false }
};
}
}
}

View File

@@ -1,25 +0,0 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.Entities;
using Yi.Framework.Ddd.Entities;
namespace Yi.BBS.Domain.School.Entities
{
[SugarTable("Student")]
public class StudentEntity : IEntity<long>,ISoftDelete
{
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public string Name { get; set; }
public int? Height { get; set; }
public string? Phone { get; set; }
public bool IsDeleted { get; set; } = false;
}
}