1
This commit is contained in:
24
iMES.WebApi/Template/Controller/Controller.html
Normal file
24
iMES.WebApi/Template/Controller/Controller.html
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 此代码由框架生成,请勿随意更改
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using {Namespace}.IServices;
|
||||
using {StartName}.Core.Controllers.Basic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using iMES.Entity.AttributeManager;
|
||||
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
[PermissionTable(Name = "{TableName}")]
|
||||
public partial class {TableName}Controller : BaseController<I{TableName}Service>
|
||||
{
|
||||
public {TableName}Controller(I{TableName}Service service)
|
||||
: base({BaseOptions}, service)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
21
iMES.WebApi/Template/Controller/ControllerApi.html
Normal file
21
iMES.WebApi/Template/Controller/ControllerApi.html
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*如果要增加方法请在当前目录下Partial文件夹{TableName}Controller编写
|
||||
*/
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using iMES.Core.Controllers.Basic;
|
||||
using iMES.Entity.AttributeManager;
|
||||
using {Namespace}.IServices;
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
[Route("api/{TableName}")]
|
||||
[PermissionTable(Name = "{TableName}")]
|
||||
public partial class {TableName}Controller : ApiBaseController<I{TableName}Service>
|
||||
{
|
||||
public {TableName}Controller(I{TableName}Service service)
|
||||
: base(service)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
iMES.WebApi/Template/Controller/ControllerApiPartial.html
Normal file
33
iMES.WebApi/Template/Controller/ControllerApiPartial.html
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
*接口编写处...
|
||||
*如果接口需要做Action的权限验证,请在Action上使用属性
|
||||
*如: [ApiActionPermission("{TableName}",Enums.ActionPermissionOptions.Search)]
|
||||
*/
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using {Namespace}.IServices;
|
||||
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
public partial class {TableName}Controller
|
||||
{
|
||||
private readonly I{TableName}Service _service;//访问业务代码
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
[ActivatorUtilitiesConstructor]
|
||||
public {TableName}Controller(
|
||||
I{TableName}Service service,
|
||||
IHttpContextAccessor httpContextAccessor
|
||||
)
|
||||
: base(service)
|
||||
{
|
||||
_service = service;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
iMES.WebApi/Template/Controller/ControllerPartial.html
Normal file
15
iMES.WebApi/Template/Controller/ControllerPartial.html
Normal file
@@ -0,0 +1,15 @@
|
||||
using {StartName}.Core.Extensions;
|
||||
using {StartName}.Core.Filter;
|
||||
using {StartName}.Core.Utility;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
public partial class {TableName}Controller
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user