BodeAbp服务端介绍


BodeAbp.Frame:abp框架
BodeAbp.Modules:业务模块
BodeAbp.Plugins:插件
BodeAbp.Samples:示例



using System.Reflection;
using Abp.EntityFramework.Default;
using Abp.Localization.Dictionaries;
using Abp.Localization.Dictionaries.Xml;
using Abp.Modules;
using BodeAbp.Product.Providers; namespace BodeAbp.Product
{
/// <summary>
/// 产品模块
/// </summary>
public class BodeAbpProductModule : AbpModule
{
/// <summary>
/// 版本号
/// </summary>
public const string CurrentVersion = "0.1.0"; /// <summary>
/// 初始化前执行
/// </summary>
public override void PreInitialize()
{
Configuration.Localization.Sources.Add(
new DictionaryBasedLocalizationSource(
BodeAbpProductConsts.LocalizationSourceName,
new XmlEmbeddedFileLocalizationDictionaryProvider(
Assembly.GetExecutingAssembly(),
"BodeAbp.Product.Localization.Source"
)
)
); Configuration.Settings.Providers.Add<BodeAbpProductSettingProvider>();
Configuration.Navigation.Providers.Add<BodeAbpProductNavigationProvider>();
Configuration.Authorization.Providers.Add<BodeAbpProductAuthorizationProvider>(); DefaultDbContextInitializer.Instance.MapperAssemblies.Add(Assembly.GetExecutingAssembly());
} /// <summary>
/// 初始化执行
/// </summary>
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
} /// <summary>
/// 初始化后执行
/// </summary>
public override void PostInitialize()
{
base.PostInitialize();
}
}
}

using Abp.Application.Services;
using System.ComponentModel;
using Abp.Application.Services.Dto;
using BodeAbp.Product.Attributes.Dtos;
using System.Collections.Generic;
using System.Threading.Tasks; namespace BodeAbp.Product.Attributes
{
/// <summary>
/// 属性 服务
/// </summary>
[Description("属性接口")]
public interface IAttributesAppService : IApplicationService
{
#region 属性模版 /// <summary>
/// 获取 属性模版分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<PagedResultOutput<GetAttributeListOutput>> GetAttributePagedList(QueryListPagedRequestInput input); /// <summary>
/// 获取 属性模版详情
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
Task<GetAttributeOutput> GetAttribute(int id); /// <summary>
/// 添加 属性模版
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task CreateAttribute(CreateAttributeInput input); /// <summary>
/// 更新 属性模版
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task UpdateAttribute(UpdateAttributeInput input); /// <summary>
/// 删除 属性模版
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task DeleteAttribute(List<IdInput> input); #endregion #region 属性值 /// <summary>
/// 获取 属性值分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<PagedResultOutput<GetAttributeOptionListOutput>> GetAttributeOptionPagedList(QueryListPagedRequestInput input); /// <summary>
/// 获取 属性值详情
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
Task<GetAttributeOptionOutput> GetAttributeOption(int id); /// <summary>
/// 添加 属性值
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task CreateAttributeOption(CreateAttributeOptionInput input); /// <summary>
/// 更新 属性值
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task UpdateAttributeOption(UpdateAttributeOptionInput input); /// <summary>
/// 删除 属性值
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task DeleteAttributeOption(List<IdInput> input); #endregion #region 分类 /// <summary>
/// 获取 分类分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<PagedResultOutput<GetProductClassifyListOutput>> GetClassifyPagedList(QueryListPagedRequestInput input); /// <summary>
/// 获取 分类详情
/// </summary>
/// <param name="id">id</param>
/// <returns></returns>
Task<GetProductClassifyOutput> GetClassify(int id); /// <summary>
/// 添加 分类
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task CreateClassify(CreateProductClassifyInput input); /// <summary>
/// 更新 分类
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task UpdateClassify(UpdateProductClassifyInput input); /// <summary>
/// 删除 分类
/// </summary>
/// <param name="classifyId">分类Id</param>
/// <returns></returns>
Task DeleteClassify(int classifyId); #endregion
}
}
加载模块:

using System.Reflection;
using System.Web.Http;
using Abp.Application.Services;
using Abp.Configuration.Startup;
using Abp.Modules;
using Abp.WebApi;
using Abp.WebApi.Controllers.Dynamic.Builders;
using Swashbuckle.Application;
using System.Linq;
using System.Web.Http.Cors;
using BodeAbp.Zero;
using System;
using WebDemo.WebApi.Swagger;
using BodeAbp.Activity;
using BodeAbp.Product; namespace WebDemo.WebApi
{
[DependsOn(
typeof(AbpWebApiModule)
, typeof(WebDemoCoreModule)
, typeof(BodeAbpZeroModule)
, typeof(BodeAbpActivityModule)
, typeof(BodeAbpProductModule))]
public class WebDemoWebApiModule : AbpModule
{
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); DynamicApiControllerBuilder
.ForAll<IApplicationService>(typeof(WebDemoCoreModule).Assembly, "app")
.Build(); DynamicApiControllerBuilder
.ForAll<IApplicationService>(typeof(BodeAbpZeroModule).Assembly, "zero")
.Build(); DynamicApiControllerBuilder
.ForAll<IApplicationService>(typeof(BodeAbpActivityModule).Assembly, "activity")
.Build(); DynamicApiControllerBuilder
.ForAll<IApplicationService>(typeof(BodeAbpProductModule).Assembly, "product")
.Build(); Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer")); var cors = new EnableCorsAttribute("*", "*", "*");
GlobalConfiguration.Configuration.EnableCors(cors); ConfigureSwaggerUi();
} private void ConfigureSwaggerUi()
{
Configuration.Modules.AbpWebApi().HttpConfiguration
.EnableSwagger(c =>
{
c.SingleApiVersion("v1", "WebDemo.WebApi");
//c.OperationFilter<AuthorizationOperationFilter>();
c.DocumentFilter<ApplicationDocumentFilter>();
c.IncludeXmlComments(GetXmlCommentsPath(typeof(WebDemoCoreModule)));
c.IncludeXmlComments(GetXmlCommentsPath(typeof(BodeAbpZeroModule)));
c.IncludeXmlComments(GetXmlCommentsPath(typeof(BodeAbpActivityModule)));
c.IncludeXmlComments(GetXmlCommentsPath(typeof(BodeAbpProductModule)));
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
})
.EnableSwaggerUi(c => {
c.CustomAsset("index", typeof(WebDemoWebApiModule).Assembly, "WebDemo.WebApi.Swagger.index.html");
c.InjectStylesheet(typeof(WebDemoWebApiModule).Assembly, "WebDemo.WebApi.Swagger.theme-flattop.css");
c.InjectJavaScript(typeof(WebDemoWebApiModule).Assembly, "WebDemo.WebApi.Swagger.translator.js");
});
} private static string GetXmlCommentsPath(Type moduleType)
{
return string.Format(@"{0}\bin\{1}.XML", AppDomain.CurrentDomain.BaseDirectory, moduleType.Assembly.GetName().Name);
}
}
}
确保webconfig中数据库连接正确,直接运行项目,浏览器访问:http://localhost:61759/swagger/ui/index#/,效果图如下:

BodeAbp服务端介绍的更多相关文章
- 数据同步canal服务端介绍
1.下载安装包 canal&github的地址,最权威的学习canal相关知识的地方 https://github.com/alibaba/canal 在下面的wiki列表中找到AdminGu ...
- 服务端预渲染之Nuxt(介绍篇)
现在前端开发一般都是前后端分离,mvvm和mvc的开发框架,如Angular.React和Vue等,虽然写框架能够使我们快速的完成开发,但是由于前后台分离,给项目SEO带来很大的不便,搜索引擎在检索的 ...
- 服务端渲染和nuxt简单介绍
概述 最近研究了一下服务端渲染,有一些心得,记录下来供以后开发时参考,相信对其他人也有用. 参考资料: Vue SSR指南 nuxt.js官网 服务端渲染介绍 服务端渲染简单来说,就是分别对项目用we ...
- NFS介绍 NFS服务端安装配置 NFS配置选项
NFS 介绍 • NFS是Network File System的缩写 • NFS最早由Sun公司开发,分2,,4三个版本,2和3由Sun起草开发,.0开始Netapp公司参与并主导开发,最新为4.1 ...
- 关于消息推送的补充,主要介绍服务端的实现,包含object c 版本 c 版本 java 版本 php 版本 (转)
要实现消息推送功能,我们可以采用第三方(腾讯:信鸽:百度:云推送:极光推送:友盟):当然,因为各种原因,我们不能使用第三方的推送服务,那我们就需要自己编写服务端.在网上寻觅了很久,找到一篇很不错的讲解 ...
- NFS介绍、服务端安装配置、NFS配置选项
6月21日任务 14.1 NFS介绍14.2 NFS服务端安装配置14.3 NFS配置选项 14.1 NFS介绍 14.2 NFS服务端安装配置 1.首先需要2台机器,一台是服务端,一台是客户端,分别 ...
- Linux centosVMware NFS介绍、NFS服务端安装配置、NFS配置选项
一.NFS介绍 NFS是Network File System的缩写 NFS最早由Sun公司开发,分2,3,4三个版本,2和3由Sun起草开发,4.0开始Netapp公司参与并主导开发,最新为4.1版 ...
- JSR-303 Bean Validation 介绍及 Spring MVC 服务端参数验证最佳实践
任何时候,当要处理一个应用程序的业务逻辑,数据校验是你必须要考虑和面对的事情. 应用程序必须通过某种手段来确保输入参数在上下文来说是正确的. 分层的应用很多时候同样的数据验证逻辑会出现在不同的层,这样 ...
- JSR-303 Bean Validation 介绍及 Spring MVC 服务端验证最佳实践
任何时候,当要处理一个应用程序的业务逻辑,数据校验是你必须要考虑和面对的事情. 应用程序必须通过某种手段来确保输入参数在上下文来说是正确的. 分层的应用在很多时候,同样的数据验证逻辑会出现在不同的层, ...
随机推荐
- MySQL——优化嵌套查询和分页查询
优化嵌套查询 嵌套查询(子查询)可以使用SELECT语句来创建一个单列的查询结果,然后把这个结果作为过滤条件用在另一个查询中.嵌套查询写起来简单,也容易理解.但是,有时候可以被更有效率的连接(JOIN ...
- VMware虚拟机安装教程详解图文
学习Linux系统最好的方式就是在自己的虚拟机上安装Linux:接下来就给大家简单介绍一下VMware虚拟机的安装以及Linux的安装:VMware虚拟机只是为了更好的学习Linux: ...
- Spring 12 种 常用注解!
1.声明bean的注解 @Component 组件,没有明确的角色 @Service 在业务逻辑层使用(service层) @Repository 在数据访问层使用(dao层) @Controller ...
- NAudio音频文件转换
1.NuGet安装 NAudio,项目及demo的网址:https://github.com/naudio/NAudio Encode to MP3, WMA and AAC with MediaFo ...
- win7计划任务报该任务映像己损坏或己篡改
目录 win7计划任务报该任务映像己损坏或己篡改 前言 解决方案 排查损坏的计划任务映像 win7计划任务报该任务映像己损坏或己篡改 文:铁乐与猫 2018-9-20 前言 win7下想自定义一些计划 ...
- 【Beta阶段】测试报告
兼容性测试 功能 描述 效果 Chrome浏览器 FireFox浏览器 IE浏览器 搜狗浏览器 主页实用小工具按钮 跳转到实用小工具首页 跳转到实用小工具首页 ü ü ü ü 鼠标移动到逐差法计算 ...
- ASP.NET WebAPI 双向token实现对接小程序登录逻辑
最近在学习用asp.net webapi搭建小程序的后台服务,因为基于小程序端和后台二者的通信,不像OAuth(开放授权),存在第三方应用.所以这个token是双向的,一个是对用户的,一个是对接口的. ...
- Flex布局新写法兼容写法详解
很久之前用过flex,但是没有考虑过兼容性问题,为了兼容ios一定要加上-webkit前缀: ul{ display: flex; /* 新版本语法: Opera 12.1, Firefox 22+ ...
- ByteArrayInputStream与ByteArrayOutputStream_操作数组的流
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOExceptio ...
- 【BZOJ4259】残缺的字符串
[BZOJ4259]残缺的字符串 Description 很久很久以前,在你刚刚学习字符串匹配的时候,有两个仅包含小写字母的字符串A和B,其中A串长度为m,B串长度为n.可当你现在再次碰到这两个串时, ...