• 自定义开发需要遵循规则
    1 新项目宿主文件必须以RG3.开头(项目底层使用),然后继承对应的2到3接口,服务会自动进行注入
    2 控制器:RG3.PF.Web.Controllers. BaseController
    3 服务:RG3.PF.Abstractions.Interfaces. IService
    4 仓储:RG3.PF.Abstractions.Interfaces. IRepository
    5 实体:RG3.PF.Abstractions.Interfaces. IEntity
    6 接口
    7、数据库相关的服务

private readonly IMapperProvider _imapperProvider;
        private readonly IDbConnectionProvider _dbConnectionProvider;
        private IDbContext _db;
        private readonly SqlConfigService _sqlConfigService;

        private readonly IConfigurationBuilderProvider _configurationBuilderService;
        private readonly DbSqlService _dbSqlService;


        /// <summary>
        /// 注入服务
        /// </summary>
        /// <param name="mapperCollectService"></param>
        /// <param name="accessor"></param>
        public ListRepository(IDbConnectionProvider dbConnectionProvider, DbSqlService dbSqlService, IHttpContextAccessor accessor, SqlConfigService sqlConfigService, IMapperProvider imapperProvider, IDbContext db, IConfigurationBuilderProvider configurationBuilderService)
        {
            _accessor = accessor;
            _imapperProvider = imapperProvider;
            _db = db;
            _configurationBuilderService = configurationBuilderService;
            _sqlConfigService = sqlConfigService;
            _dbConnectionProvider = dbConnectionProvider;
            _dbSqlService = dbSqlService;
        }

8、权限相关的服务

private readonly IConfigurationBuilderProvider _configurationBuilderService;
        private readonly IConfiguration _configuration;
        private readonly Base64Service _base64Service;
        private readonly IAuthProvider _authProvider;
        private readonly DesService _desService;
        /// <summary>
        /// 注入服务
        /// </summary>
        /// <param name="responseLoginRepository"></param>
        /// <param name="userRepository"></param>
        public TokenController(DesService desService, IConfigurationBuilderProvider configurationBuilderService, IAuthProvider authProvider, IConfiguration configuration, Base64Service base64Service)
        {
            _configurationBuilderService = configurationBuilderService;
            _configuration = configuration;
            _base64Service = base64Service;
            _authProvider = authProvider;
            _desService = desService;
        }
文档更新时间: 2021-08-07 12:09   作者:admin