ABP框架記錄

abp默認管理員:admin,密碼:123qwe,這是寫死的,xxx.Core\Authorization\Users\User.cs 行數:10
1.先在Core項目中創建模型
Models》Model.cs/ModelManager.cshtml

2.在Application中創建接口和具體類:
IModelAppService.cs
ModelAppService.cs
創建Dto和QueryInput類
ModelDto/ModelQueryInputgit

3.在EntityFramework的DbContext.cs類中,註冊數據表,而後執行對應的migration命令更新數據庫github

查看全部接口web

http://localhost:6234/api/AbpServiceProxies/GetAll?type=angularsql

swagger:http://localhost:6234/apis/index數據庫

多數據庫:api

abp框架多數據庫:
A56.WMS.EntityFramework中:
增長:對應的 DbContext.cs
增長:對應的 /EntityFramework/Repositories/DbRepositoryBase.cs
增長:對應的 Migrations文件夾,在文件夾裏增長 Configuration.cs框架

4.郵件發送:async

xxx.EntityFramework項目中:Migrations/SeedData/DefaultSettingsCreator.cs中配置郵件服務:spa

 public void Create()
        {
            #region Emailing
            string mail_smtp = ConfigurationManager.AppSettings["mail_smtp"];
            string mail_main = ConfigurationManager.AppSettings["mail_main"];
            string mail_pwd = ConfigurationManager.AppSettings["mail_pwd"];
            string mail_port = ConfigurationManager.AppSettings["mail_port"];
            string mail_ssl = ConfigurationManager.AppSettings["mail_ssl"];
            string mail_name = ConfigurationManager.AppSettings["mail_name"];

            AddSettingIfNotExists(EmailSettingNames.DefaultFromAddress, mail_main);
            AddSettingIfNotExists(EmailSettingNames.DefaultFromDisplayName, mail_name);
            AddSettingIfNotExists(EmailSettingNames.Smtp.Port, mail_port);
            AddSettingIfNotExists(EmailSettingNames.Smtp.Host, mail_smtp);
            AddSettingIfNotExists(EmailSettingNames.Smtp.UserName, mail_main);
            AddSettingIfNotExists(EmailSettingNames.Smtp.Password, mail_pwd);
            AddSettingIfNotExists(EmailSettingNames.Smtp.Domain, "");
            AddSettingIfNotExists(EmailSettingNames.Smtp.EnableSsl, mail_ssl);
            AddSettingIfNotExists(EmailSettingNames.Smtp.UseDefaultCredentials, "false");
            #endregion

            //Languages
            AddSettingIfNotExists(LocalizationSettingNames.DefaultLanguage, "en");
        }

而後 程序包管理器控制檯 執行:update-database

nuget安裝:AbpMailKit,而後在xxx.Core中找到 xxxCoreModule.cs

[DependsOn(typeof(AbpMailKitModule))]    public class xxxCoreModule : AbpModule{}

一切ok,而後就是調用了,注意調用發送郵件的時候若是是多租戶的話,記得設置請求的Header信息》 Authorization bearer ticket

public class TaskManager : IDomainService
    {
        private readonly IEmailSender _emailSender;

        public TaskManager(
        IEmailSender emailSender,
        ISmtpEmailSenderConfiguration smtpEmialSenderConfigtion
        )
        {
            _emailSender = emailSender;
        }
        /// <summary>
        /// 發送郵件
        /// </summary>
        /// <param name="emailAddress">目標郵箱</param>
        /// <param name="subject">郵件標題</param>
        /// <param name="body">郵件內容</param>
        public async void SendMail(string emailAddress, string subject, string body)
        {
            await _emailSender.SendAsync(
                to: emailAddress,
                subject: subject,
                body: body,
                isBodyHtml: true
            );
        }
    }

 

https://www.cnblogs.com/LmuQuan/p/9122143.html

http://www.cnblogs.com/farb/p/ModuleZeroContent.html

http://www.cnblogs.com/farb/p/4849791.html

http://www.cnblogs.com/farb/p/modulezeroInstall.html

http://www.mamicode.com/info-detail-2320070.html

http://www.bubuko.com/infodetail-2594809.html

http://www.cnblogs.com/1zhk/p/5456389.html

https://www.cnblogs.com/farb/p/moduleZeroUserManagement.html

http://www.cnblogs.com/mienreal/p/4687789.html

AbpSession管理:http://www.cnblogs.com/mienreal/p/4561235.html

自定義過濾器:http://www.cnblogs.com/farb/p/ABPDataFilters.html

郵件文件:http://zhaokuohaha.github.io/2016/09/06/abp%E9%82%AE%E4%BB%B6/

https://www.cnblogs.com/Wddpct/p/5919507.html

ABP框架使用Mysql:

https://github.com/ABPFrameWorkGroup/AbpDocument2Chinese/blob/master/Markdown/Abp/9.4ABP%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD%E5%B1%82-%E9%9B%86%E6%88%90EntityFrameworkMySql.md

https://www.cnblogs.com/ixysy/p/6219719.html

添加左側菜單:https://blog.csdn.net/ysj1163620987/article/details/54909635ABP入門系列(16)——經過webapi與系統進行交互:https://www.jianshu.com/p/d14733432dc2

相關文章
相關標籤/搜索