|
|
@@ -23,9 +23,11 @@ namespace @Model.NameSpace;
|
|
|
/// @(@Model.BusName)服务
|
|
|
/// </summary>
|
|
|
[ApiDescriptionSettings(@(@Model.ProjectLastName)Const.GroupName, Order = 100)]
|
|
|
+[DisplayName("@(@Model.BusName)服务")]
|
|
|
public class @(@Model.ClassName)Service : IDynamicApiController, ITransient
|
|
|
{
|
|
|
private SqlSugarRepository<@(@Model.ClassName)> @(@Model.LowerClassName)Rep = null;
|
|
|
+
|
|
|
public @(@Model.ClassName)Service()
|
|
|
{
|
|
|
}
|
|
|
@@ -46,6 +48,7 @@ public class @(@Model.ClassName)Service : IDynamicApiController, ITransient
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ApiDescriptionSettings(Name = "Page")]
|
|
|
+ [DisplayName("分页查询@(@Model.BusName)")]
|
|
|
public async Task<SqlSugarPagedList<@(@Model.ClassName)Output>> Page(@(@Model.ClassName)Input input)
|
|
|
{
|
|
|
@if (haveLikeCdt) {
|
|
|
@@ -128,6 +131,7 @@ if (@column.QueryWhether == "Y"){
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ApiDescriptionSettings(Name = "Add")]
|
|
|
+ [DisplayName("增加@(@Model.BusName)")]
|
|
|
public async Task<long> Add(Add@(@Model.ClassName)Input input)
|
|
|
{
|
|
|
var entity = input.Adapt<@(@Model.ClassName)>();
|
|
|
@@ -142,6 +146,7 @@ if (@column.QueryWhether == "Y"){
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ApiDescriptionSettings(Name = "Delete")]
|
|
|
+ [DisplayName("删除@(@Model.BusName)")]
|
|
|
public async Task Delete(Delete@(@Model.ClassName)Input input)
|
|
|
{
|
|
|
@foreach (var column in Model.TableField){
|
|
|
@@ -160,6 +165,7 @@ if (@column.ColumnKey == "True"){
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ApiDescriptionSettings(Name = "Update")]
|
|
|
+ [DisplayName("更新@(@Model.BusName)")]
|
|
|
public async Task Update(Update@(@Model.ClassName)Input input)
|
|
|
{
|
|
|
var entity = input.Adapt<@(@Model.ClassName)>();
|
|
|
@@ -173,6 +179,7 @@ if (@column.ColumnKey == "True"){
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
[ApiDescriptionSettings(Name = "Detail")]
|
|
|
+ [DisplayName("获取@(@Model.BusName)")]
|
|
|
public async Task<@(@Model.ClassName)> Detail([FromQuery] QueryById@(@Model.ClassName)Input input)
|
|
|
{
|
|
|
@foreach (var column in Model.TableField){
|
|
|
@@ -189,6 +196,7 @@ if (@column.ColumnKey == "True"){
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
[ApiDescriptionSettings(Name = "List")]
|
|
|
+ [DisplayName("获取@(@Model.BusName)列表")]
|
|
|
public async Task<List<@(@Model.ClassName)Output>> List([FromQuery] @(@Model.ClassName)Input input)
|
|
|
{
|
|
|
return await @(@Model.ClassName)Rep.AsQueryable().Select<@(@Model.ClassName)Output>().ToListAsync();
|
|
|
@@ -201,7 +209,9 @@ if(@column.EffectType == "fk" && (@column.WhetherAddUpdate == "Y" || column.Quer
|
|
|
@:/// </summary>
|
|
|
@:/// <param name="input"></param>
|
|
|
@:/// <returns></returns>
|
|
|
- @:[ApiDescriptionSettings(Name = "@(@column.FkEntityName)@(@column.PropertyName)Dropdown"), HttpGet]
|
|
|
+ @:[HttpGet]
|
|
|
+ @:[ApiDescriptionSettings(Name = "@(@column.FkEntityName)@(@column.PropertyName)Dropdown")]
|
|
|
+ @:[DisplayName("获取@(@Model.ColumnComment)列表")]
|
|
|
@:public async Task<dynamic> @(@column.FkEntityName)@(@column.PropertyName)Dropdown()
|
|
|
@:{
|
|
|
@:return await @(@Model.ClassName)Rep.Context.Queryable<@(@column.FkEntityName)>()
|
|
|
@@ -222,7 +232,9 @@ if(@column.EffectType == "Upload"){
|
|
|
@:/// </summary>
|
|
|
@:/// <param name="file"></param>
|
|
|
@:/// <returns></returns>
|
|
|
- @:[ApiDescriptionSettings(Name = "Upload@(@column.PropertyName)"), HttpPost]
|
|
|
+ @:[HttpPost]
|
|
|
+ @:[ApiDescriptionSettings(Name = "Upload@(@column.PropertyName)")]
|
|
|
+ @:[DisplayName("上传@(@Model.ColumnComment)")]
|
|
|
@:public async Task<SysFile> Upload@(@column.PropertyName)([Required] IFormFile file)
|
|
|
@:{
|
|
|
@:var service = App.GetRequiredService<SysFileService>();
|