<develop>:(Web 端)<无> ShopERP 项目 WebAPI 接口代码提交。

parent 24baaf06
...@@ -3,6 +3,7 @@ using System; ...@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace CoreCms.Net.IRepository.Order namespace CoreCms.Net.IRepository.Order
...@@ -10,5 +11,8 @@ namespace CoreCms.Net.IRepository.Order ...@@ -10,5 +11,8 @@ namespace CoreCms.Net.IRepository.Order
public interface ICoreOrderRepository : IBaseRepository<CoreOrder> public interface ICoreOrderRepository : IBaseRepository<CoreOrder>
{ {
Task<List<CoreOrder>> GetListAsync(); Task<List<CoreOrder>> GetListAsync();
Task<List<CoreOrder>> GetOrderInfoAsync(string platOrderId, CancellationToken cancellationToken);
} }
} }
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar; using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace CoreCms.Net.IServices.Order namespace CoreCms.Net.IServices.Order
{ {
public interface ICoreOrderServices : IBaseServices<CoreOrder> public interface ICoreOrderServices : IBaseServices<CoreOrder>
{ {
Task<WebApiCallBack> CreateOrderAsync(CreateOrder input, CancellationToken cancellationToken);
} }
} }
...@@ -19,6 +19,9 @@ namespace CoreCms.Net.Model.Entities ...@@ -19,6 +19,9 @@ namespace CoreCms.Net.Model.Entities
[SugarColumn(ColumnName = "orderId", ColumnDataType = "varchar", Length = 20, IsPrimaryKey = true, IsNullable = false, ColumnDescription = "订单号")] [SugarColumn(ColumnName = "orderId", ColumnDataType = "varchar", Length = 20, IsPrimaryKey = true, IsNullable = false, ColumnDescription = "订单号")]
public string OrderId { get; set; } public string OrderId { get; set; }
[SugarColumn(ColumnName = "platOrderID", ColumnDataType = "varchar", Length = 20, IsPrimaryKey = true, IsNullable = false, ColumnDescription = "平台订单号")]
public string platOrderID { get; set; }
/// <summary> /// <summary>
/// 商品总价 /// 商品总价
/// </summary> /// </summary>
...@@ -50,18 +53,6 @@ namespace CoreCms.Net.Model.Entities ...@@ -50,18 +53,6 @@ namespace CoreCms.Net.Model.Entities
public int? StockStatus { get; set; } public int? StockStatus { get; set; }
/// <summary> /// <summary>
/// 支付状态
/// </summary>
[SugarColumn(ColumnName = "payStatus", ColumnDataType = "int", IsNullable = false, ColumnDescription = "支付状态")]
public int PayStatus { get; set; }
/// <summary>
/// 发货状态
/// </summary>
[SugarColumn(ColumnName = "shipStatus", ColumnDataType = "int", IsNullable = false, ColumnDescription = "发货状态")]
public int ShipStatus { get; set; }
/// <summary>
/// 订单状态 /// 订单状态
/// </summary> /// </summary>
[SugarColumn(ColumnName = "status", ColumnDataType = "int", IsNullable = false, ColumnDescription = "订单状态")] [SugarColumn(ColumnName = "status", ColumnDataType = "int", IsNullable = false, ColumnDescription = "订单状态")]
......
...@@ -4,6 +4,7 @@ using System; ...@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SqlSugar;
namespace CoreCms.Net.Model.ViewModels.DTO namespace CoreCms.Net.Model.ViewModels.DTO
{ {
...@@ -39,95 +40,158 @@ namespace CoreCms.Net.Model.ViewModels.DTO ...@@ -39,95 +40,158 @@ namespace CoreCms.Net.Model.ViewModels.DTO
/// </summary> /// </summary>
public class CreateOrder public class CreateOrder
{ {
public string platOrderID { get; set; }
/// <summary> /// <summary>
/// 区域序列 /// 商品总价
/// </summary> /// </summary>
public int areaId { get; set; } public decimal GoodsAmount { get; set; }
/// <summary> /// <summary>
/// 购物车货品数据 /// 已支付的金额
/// </summary> /// </summary>
public string cartIds { get; set; } public decimal PayedAmount { get; set; }
/// <summary> /// <summary>
/// 优惠券码 /// 订单实际销售总额
/// </summary> /// </summary>
public string couponCode { get; set; } public decimal OrderAmount { get; set; }
/// <summary> /// <summary>
/// 买家留言 /// 币种
/// </summary> /// </summary>
public string memo { get; set; } public string CurrencyCode { get; set; }
/// <summary> /// <summary>
/// 积分 /// 支付状态
/// </summary> /// </summary>
public int point { get; set; } = 0; public int PayStatus { get; set; }
/// <summary> /// <summary>
/// 收货方式,1快递物流,2同城配送,3门店自提 /// 发货状态
/// </summary> /// </summary>
public int receiptType { get; set; } = 1; public int ShipStatus { get; set; }
/// <summary> /// <summary>
/// 来源平台 /// 订单状态
/// </summary> /// </summary>
public int source { get; set; } = 2; public int Status { get; set; }
/// <summary> /// <summary>
/// 发票税务编号 /// 订单类型
/// </summary> /// </summary>
public string taxCode { get; set; } public int OrderType { get; set; }
/// <summary> /// <summary>
/// 发票抬头 /// 支付时间
/// </summary> /// </summary>
public string taxName { get; set; } public DateTime? PaymentTime { get; set; }
/// <summary> /// <summary>
/// 发票类型 /// 物流方式ID
/// </summary> /// </summary>
public int taxType { get; set; } = 1; public int LogisticsId { get; set; }
/// <summary> /// <summary>
/// 用户地址库序列 /// 配送方式名称
/// </summary> /// </summary>
public int ushipId { get; set; } = 0; public string LogisticsName { get; set; }
/// <summary> /// <summary>
/// 门店序列 /// 配送费用
/// </summary> /// </summary>
public int storeId { get; set; } = 0; public decimal CostFreight { get; set; }
/// <summary>
/// 店铺名称
/// </summary>
public string SellerId { get; set; }
/// <summary>
/// 收货人FirstName
/// </summary>
public string FirstName { get; set; }
/// <summary>
/// 收货人LastName
/// </summary>
public string LastName { get; set; }
/// <summary> /// <summary>
/// 订单类型,1是普通订单,2是拼团订单 /// 收货地址1
/// </summary> /// </summary>
public int orderType { get; set; } = 1; public string Address1 { get; set; }
/// <summary> /// <summary>
/// 提货人姓名 /// 收货地址2
/// </summary> /// </summary>
public string ladingName { get; set; } public string Address2 { get; set; }
/// <summary> /// <summary>
/// 提货人联系方式 /// 邮编
/// </summary> /// </summary>
public string ladingMobile { get; set; } public string PostCode { get; set; }
/// <summary> /// <summary>
/// 非普通订单关联营销对象序列 /// 国家
/// </summary> /// </summary>
public int objectId { get; set; } = 0; public string Country { get; set; }
/// <summary> /// <summary>
/// 拼团订单分组序列 /// 国家编码
/// </summary> /// </summary>
public int teamId { get; set; } = 0; public string CountryCode { get; set; }
/// <summary> /// <summary>
/// 场景值 /// 州/省
/// </summary> /// </summary>
public int scene { get; set; } = 0; public string Province { get; set; }
/// <summary>
/// 城市
/// </summary>
public string City { get; set; }
/// <summary>
/// 跟踪号
/// </summary>
public string TrackingNumber { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 电话号码
/// </summary>
public string PhoneNO { get; set; }
/// <summary>
/// 商品总重量
/// </summary>
public decimal Weight { get; set; }
/// <summary>
/// 税号
/// </summary>
public string TaxCode { get; set; }
/// <summary>
/// 卖家备注
/// </summary>
public string Mark { get; set; }
/// <summary>
/// 用户id
/// </summary>
public int? UserId { get; set; }
/// <summary>
/// 订单来源
/// </summary>
public int Source { get; set; }
} }
/// <summary> /// <summary>
......
using CoreCms.Net.IRepository; using Consul.Filtering;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.Order; using CoreCms.Net.IRepository.Order;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using DotLiquid;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace CoreCms.Net.Repository.Order namespace CoreCms.Net.Repository.Order
...@@ -25,8 +28,21 @@ namespace CoreCms.Net.Repository.Order ...@@ -25,8 +28,21 @@ namespace CoreCms.Net.Repository.Order
return await DbClient.Queryable<CoreOrder>().ToListAsync(); return await DbClient.Queryable<CoreOrder>().ToListAsync();
} }
#region 通过平台订单查询订单信息
/// <summary>
/// 通过平台订单查询订单信息
/// </summary>
/// <param name="supplierIds"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<List<CoreOrder>> GetOrderInfoAsync(string platOrderId, CancellationToken cancellationToken)
{
var items = await DbClient.Queryable<CoreOrder>()
.Where(d => d.platOrderID == platOrderId)
.ToListAsync(cancellationToken);
return items;
}
#endregion
} }
......
using CoreCms.Net.IRepository; using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.Order; using CoreCms.Net.IRepository.Order;
using CoreCms.Net.IServices; using CoreCms.Net.IServices;
using CoreCms.Net.IServices.Order; using CoreCms.Net.IServices.Order;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Threading;
using CoreCms.Net.Model.ViewModels.DTO;
using static CoreCms.Net.Configuration.GlobalEnumVars;
namespace CoreCms.Net.Services.Order namespace CoreCms.Net.Services.Order
{ {
...@@ -26,6 +34,74 @@ namespace CoreCms.Net.Services.Order ...@@ -26,6 +34,74 @@ namespace CoreCms.Net.Services.Order
} }
#region 创建订单
/// <summary>
/// 创建订单
/// </summary>
/// <returns></returns>
public async Task<WebApiCallBack> CreateOrderAsync(CreateOrder input, CancellationToken cancellationToken)
{
var jm = new WebApiCallBack() { methodDescription = "创建订单" };
var existModel=await _dal.GetOrderInfoAsync(input.platOrderID,cancellationToken);
if (existModel != null && existModel.Count > 0)
{
jm.code = 201;
jm.msg = "平台订单号:" + input.platOrderID + ",已经成功生成,无法重新生成!";
return jm;
}
string strOrderID = CommonHelper.GetSerialNumberType((int)GlobalEnumVars.SerialNumberType.订单编号);
CoreOrder coreOrder = new CoreOrder();
coreOrder.OrderId = strOrderID;
coreOrder.platOrderID = strOrderID;
coreOrder.GoodsAmount = input.GoodsAmount;
coreOrder.PayedAmount = input.PayedAmount;
coreOrder.OrderAmount = input.OrderAmount;
coreOrder.CurrencyCode = input.CurrencyCode;
coreOrder.GoodsAmount = input.GoodsAmount;
coreOrder.StockStatus = 0;
coreOrder.Status = (int)GlobalEnumVars.OrderStatus.Normal;
coreOrder.OrderType = input.OrderType;
coreOrder.PaymentTime = input.PaymentTime;
coreOrder.LogisticsId = input.LogisticsId;
coreOrder.LogisticsName = input.LogisticsName;
coreOrder.CostFreight = input.CostFreight;
coreOrder.SellerId = input.SellerId;
coreOrder.FirstName = input.FirstName;
coreOrder.LastName= input.LastName;
coreOrder.Address1 = input.Address1;
coreOrder.Address2 = input.Address2;
coreOrder.PostCode = input.PostCode;
coreOrder.Country = input.Country;
coreOrder.CountryCode = input.CountryCode;
coreOrder.Province = input.Province;
coreOrder.City = input.City;
coreOrder.TrackingNumber = input.TrackingNumber;
coreOrder.Email = input.Email;
coreOrder.PhoneNO = input.PhoneNO;
coreOrder.Weight = input.Weight;
coreOrder.TaxCode = input.TaxCode;
coreOrder.Mark = input.Mark;
coreOrder.Source = input.Source;
coreOrder.CreateTime = DateTime.Now;
coreOrder.UpdateTime = DateTime.Now;
var result = await _dal.InsertAsync(coreOrder);
jm.status = result > 1;
//发送消息
//await _messageCenterServices.SendMessage(order.userId, GlobalEnumVars.PlatformMessageTypes.CreateOrder.ToString(), JObject.FromObject(order));
return jm;
}
#endregion
} }
} }
...@@ -61,7 +61,7 @@ namespace CoreCms.Net.Utility.Consul ...@@ -61,7 +61,7 @@ namespace CoreCms.Net.Utility.Consul
Check = new AgentServiceCheck() Check = new AgentServiceCheck()
{ {
Interval = TimeSpan.FromSeconds(10),//多久检查一次心跳 Interval = TimeSpan.FromSeconds(10),//多久检查一次心跳
HTTP = $"http://{ip}:{port}/Health",//健康检查地址 HTTP = $"http://{ip}:{port}/Health/Index",//健康检查地址
Timeout = TimeSpan.FromSeconds(5), //超时时间 Timeout = TimeSpan.FromSeconds(5), //超时时间
DeregisterCriticalServiceAfter = TimeSpan.FromSeconds(5)//服务启动多久后注册 DeregisterCriticalServiceAfter = TimeSpan.FromSeconds(5)//服务启动多久后注册
} }
......

using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 购物车操作
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class CartController : ControllerBase
{
private readonly IHttpContextUser _user;
private readonly ICoreCmsCartServices _cartServices;
/// <summary>
/// 构造函数
/// </summary>
public CartController(IHttpContextUser user, ICoreCmsCartServices cartServices)
{
_user = user;
_cartServices = cartServices;
}
#region 添加单个货品到购物车
/// <summary>
/// 添加单个货品到购物车
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> AddCart([FromBody] FMCartAdd entity)
{
var jm = await _cartServices.Add(_user.ID, entity.ProductId, entity.Nums, entity.type, entity.cartType, entity.objectId);
return jm;
}
#endregion 添加单个货品到购物车
#region 获取购物车列表======================================================================
/// <summary>
/// 获取购物车列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetList([FromBody] FMCartGetList entity)
{
var ids = CommonHelper.StringToIntArray(entity.ids);
//判断免费运费
var freeFreight = entity.receiptType != 1;
//获取数据
var jm = await _cartServices.GetCartInfos(_user.ID, ids, entity.type, entity.areaId, entity.point, entity.couponCode, freeFreight, entity.receiptType, entity.objectId);
return jm;
}
#endregion 获取购物车列表======================================================================
#region 删除购物车信息
/// <summary>
/// 获取购物车列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> DoDelete([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
if (entity.id <= 0)
{
jm.msg = "请提交要删除的货品";
return jm;
}
jm = await _cartServices.DeleteByIdsAsync(entity.id, _user.ID);
return jm;
}
#endregion 删除购物车信息
}
}
\ No newline at end of file
using Microsoft.AspNetCore.Mvc;
namespace ShopERP.WebApi.Controllers
{
/// <summary>
/// 健康检查
/// </summary>
[Route("[controller]/[action]")]
public class HealthController : Controller
{
[HttpGet]
public IActionResult Index()
{
return Ok();
}
}
}
...@@ -16,6 +16,8 @@ using CoreCms.Net.Utility.Helper; ...@@ -16,6 +16,8 @@ using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SqlSugar; using SqlSugar;
using CoreCms.Net.IServices.Order;
using System.Threading;
namespace CoreCms.Net.Web.WebApi.Controllers namespace CoreCms.Net.Web.WebApi.Controllers
{ {
...@@ -26,40 +28,14 @@ namespace CoreCms.Net.Web.WebApi.Controllers ...@@ -26,40 +28,14 @@ namespace CoreCms.Net.Web.WebApi.Controllers
[ApiController] [ApiController]
public class OrderController : ControllerBase public class OrderController : ControllerBase
{ {
private readonly IHttpContextUser _user; private readonly ICoreOrderServices _orderServices;
private readonly ICoreCmsOrderServices _orderServices;
private readonly ICoreCmsBillAftersalesServices _aftersalesServices;
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsAreaServices _areaServices;
private readonly ICoreCmsBillReshipServices _reshipServices;
private readonly ICoreCmsShipServices _shipServices;
private readonly ICoreCmsBillDeliveryServices _billDeliveryServices;
private readonly ICoreCmsLogisticsServices _logisticsServices;
private readonly ICoreCmsGoodsServices _goodsServices;
private readonly ICoreCmsStoreServices _storeServices;
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
/// </summary> /// </summary>
public OrderController(IHttpContextUser user public OrderController(ICoreOrderServices orderServices)
, ICoreCmsOrderServices orderServices
, ICoreCmsBillAftersalesServices aftersalesServices
, ICoreCmsSettingServices settingServices
, ICoreCmsAreaServices areaServices
, ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices)
{ {
_user = user;
_orderServices = orderServices; _orderServices = orderServices;
_aftersalesServices = aftersalesServices;
_settingServices = settingServices;
_areaServices = areaServices;
_reshipServices = reshipServices;
_shipServices = shipServices;
_billDeliveryServices = billDeliveryServices;
_logisticsServices = logisticsServices;
_goodsServices = goodsServices;
_storeServices = storeServices;
} }
#region 创建订单================================================== #region 创建订单==================================================
...@@ -68,79 +44,23 @@ namespace CoreCms.Net.Web.WebApi.Controllers ...@@ -68,79 +44,23 @@ namespace CoreCms.Net.Web.WebApi.Controllers
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Authorize] public async Task<WebApiCallBack> CreateOrder([FromBody] CreateOrder entity, CancellationToken cancellationToken)
public async Task<WebApiCallBack> CreateOrder([FromBody] CreateOrder entity)
{ {
var jm = new WebApiCallBack(); var jm = new WebApiCallBack();
var type = entity.receiptType; if (string.IsNullOrEmpty(entity.platOrderID))
if (type == (int)GlobalEnumVars.OrderReceiptType.Logistics || type == (int)GlobalEnumVars.OrderReceiptType.IntraCityService)
{
//收货地址id
if (entity.ushipId == 0)
{
jm.data = 13001;
jm.msg = GlobalErrorCodeVars.Code13001;
}
}
else if (type == (int)GlobalEnumVars.OrderReceiptType.SelfDelivery)
{
//提货门店
if (entity.storeId == 0)
{
jm.data = 13001;
jm.msg = GlobalErrorCodeVars.Code13001;
}
//提货人姓名 提货人电话
if (string.IsNullOrEmpty(entity.ladingName))
{
jm.data = 13001;
jm.msg = "请输入姓名";
}
if (string.IsNullOrEmpty(entity.ladingMobile))
{
jm.data = 13001;
jm.msg = "请输入电话";
}
}
else
{
jm.data = 13001;
jm.msg = "未查询到配送方式";
}
if (string.IsNullOrEmpty(entity.cartIds))
{ {
jm.data = 10000; jm.data = 10000;
jm.msg = GlobalErrorCodeVars.Code10000; jm.msg = "平台订单号不能为空!";
return jm;
} }
jm = await _orderServices.ToAdd(_user.ID, entity.orderType, entity.cartIds, entity.receiptType,
entity.ushipId, entity.storeId, entity.ladingName, entity.ladingMobile, entity.memo,
entity.point, entity.couponCode, entity.source, entity.scene, entity.taxType, entity.taxName,
entity.taxCode, entity.objectId, entity.teamId);
jm.otherData = entity;
jm = await _orderServices.CreateOrderAsync(entity, cancellationToken);
return jm; return jm;
} }
#endregion #endregion
#region 获取个人订单列表=======================================================
/// <summary>
/// 获取个人订单列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetOrderList([FromBody] GetOrderListPost entity)
{
var jm = await _orderServices.GetOrderList(entity.status, _user.ID, entity.page, entity.limit);
return jm;
}
#endregion
#region 取消订单==================================================== #region 取消订单====================================================
/// <summary> /// <summary>
/// 取消订单 /// 取消订单
/// </summary> /// </summary>
...@@ -157,7 +77,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers ...@@ -157,7 +77,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
return jm; return jm;
} }
var ids = entity.id.Split(","); var ids = entity.id.Split(",");
jm = await _orderServices.CancelOrder(ids, _user.ID); //jm = await _orderServices.CancelOrder(ids, _user.ID);
return jm; return jm;
} }
......
...@@ -4,57 +4,27 @@ ...@@ -4,57 +4,27 @@
<name>ShopERP.WebApi</name> <name>ShopERP.WebApi</name>
</assembly> </assembly>
<members> <members>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.CartController"> <member name="T:ShopERP.WebApi.Controllers.HealthController">
<summary> <summary>
购物车操作 健康检查
</summary> </summary>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CartController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsCartServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CartController.AddCart(CoreCms.Net.Model.FromBody.FMCartAdd)">
<summary>
添加单个货品到购物车
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CartController.GetList(CoreCms.Net.Model.FromBody.FMCartGetList)">
<summary>
获取购物车列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CartController.DoDelete(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取购物车列表
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.OrderController"> <member name="T:CoreCms.Net.Web.WebApi.Controllers.OrderController">
<summary> <summary>
订单调用接口数据 订单调用接口数据
</summary> </summary>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsBillAftersalesServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.ICoreCmsBillReshipServices,CoreCms.Net.IServices.ICoreCmsShipServices,CoreCms.Net.IServices.ICoreCmsBillDeliveryServices,CoreCms.Net.IServices.ICoreCmsLogisticsServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsStoreServices)"> <member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.#ctor(CoreCms.Net.IServices.Order.ICoreOrderServices)">
<summary> <summary>
构造函数 构造函数
</summary> </summary>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.CreateOrder(CoreCms.Net.Model.ViewModels.DTO.CreateOrder)"> <member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.CreateOrder(CoreCms.Net.Model.ViewModels.DTO.CreateOrder,System.Threading.CancellationToken)">
<summary> <summary>
创建订单 创建订单
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetOrderList(CoreCms.Net.Model.ViewModels.DTO.GetOrderListPost)">
<summary>
获取个人订单列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.CancelOrder(CoreCms.Net.Model.FromBody.FMStringId)"> <member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.CancelOrder(CoreCms.Net.Model.FromBody.FMStringId)">
<summary> <summary>
取消订单 取消订单
......
...@@ -54,42 +54,6 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure ...@@ -54,42 +54,6 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure
c.RoutePrefix = AppSettingsConstVars.SwaggerRoutePrefix; c.RoutePrefix = AppSettingsConstVars.SwaggerRoutePrefix;
}); });
//Hangfire定时任务
//授权
var filter = new BasicAuthAuthorizationFilter(
new BasicAuthAuthorizationFilterOptions
{
SslRedirect = false,
// Require secure connection for dashboard
RequireSsl = false,
// Case sensitive login checking
LoginCaseSensitive = false,
// Users
Users = new[]
{
new BasicAuthAuthorizationUser
{
Login = AppSettingsConstVars.HangFireLogin,
PasswordClear = AppSettingsConstVars.HangFirePassWord
}
}
});
var hangfireOptions = new Hangfire.DashboardOptions
{
AppPath = "/",//返回时跳转的地址
DisplayStorageConnectionString = false,//是否显示数据库连接信息
Authorization = new[]
{
filter
},
IsReadOnlyFunc = _ => false
};
app.UseHangfireDashboard("/job", hangfireOptions); //可以改变Dashboard的url
HangfireDispose.HangfireService();
//使用 Session //使用 Session
app.UseSession(); app.UseSession();
...@@ -113,8 +77,7 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure ...@@ -113,8 +77,7 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure
// 使用静态文件 // 使用静态文件
app.UseStaticFiles(); app.UseStaticFiles();
// 先开启认证
app.UseAuthentication();
// 然后是授权中间件 // 然后是授权中间件
app.UseAuthorization(); app.UseAuthorization();
...@@ -122,14 +85,6 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure ...@@ -122,14 +85,6 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure
name: "default", name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}"); pattern: "{controller=Home}/{action=Index}/{id?}");
//设置默认起始页(如default.html)
//此处的路径是相对于wwwroot文件夹的相对路径
var defaultFilesOptions = new DefaultFilesOptions();
defaultFilesOptions.DefaultFileNames.Clear();
defaultFilesOptions.DefaultFileNames.Add("index.html");
app.UseDefaultFiles(defaultFilesOptions);
app.UseStaticFiles();
} }
#endregion #endregion
......
...@@ -46,7 +46,7 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure ...@@ -46,7 +46,7 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure
UserName = builder.Configuration["Smtp:Username"], UserName = builder.Configuration["Smtp:Username"],
Password = builder.Configuration["Smtp:Password"], Password = builder.Configuration["Smtp:Password"],
FromAddress = builder.Configuration["Smtp:FromAddress"], FromAddress = builder.Configuration["Smtp:FromAddress"],
DisplayName = builder.Configuration["Smtp:DisplayName"] ?? "My Application" DisplayName = builder.Configuration["Smtp:DisplayName"] ?? "ShopERP"
}; };
// 注册邮件服务 // 注册邮件服务
...@@ -72,9 +72,6 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure ...@@ -72,9 +72,6 @@ namespace CoreCms.Net.Web.WebApi.Infrastructure
//Swagger接口文档注入 //Swagger接口文档注入
builder.Services.AddClientSwaggerSetup(); builder.Services.AddClientSwaggerSetup();
//注册Hangfire定时任务
builder.Services.AddHangFireSetup();
//授权支持注入 //授权支持注入
builder.Services.AddAuthorizationSetupForClient(); builder.Services.AddAuthorizationSetupForClient();
//上下文注入 //上下文注入
......
...@@ -5,14 +5,9 @@ ...@@ -5,14 +5,9 @@
}, },
"Consul": { "Consul": {
"consulAddress": "http://127.0.0.1:8500", "consulAddress": "http://127.0.0.1:8500",
"serviceName": "api", "serviceName": "api_orderService",
"currentIp": "127.0.0.1", "currentIp": "127.0.0.1",
"currentPort": "5200" "currentPort": "2015"
},
//定时任务管理面板的账户密码
"HangFire": {
"Login": "admin",
"PassWord": "oq9wfbdeasygj647v"
}, },
//Swagger授权访问设置 //Swagger授权访问设置
"SwaggerConfig": { "SwaggerConfig": {
...@@ -27,10 +22,6 @@ ...@@ -27,10 +22,6 @@
"Password": "co69W7xEZ6qjBo01", "Password": "co69W7xEZ6qjBo01",
"FromAddress": "erpservice@geekbuy.com" "FromAddress": "erpservice@geekbuy.com"
}, },
"AppConfig": {
"AppUrl": "https://admin.demo.shoperp.cn/", //后端管理地址
"AppInterFaceUrl": "https://api.demo.shoperp.cn/" //接口请求地址
},
//redis为必须启动项,请保持redis为正常可用 //redis为必须启动项,请保持redis为正常可用
"RedisConfig": { "RedisConfig": {
"UseCache": true, //启用redis作为内存选择 "UseCache": true, //启用redis作为内存选择
......
F:\Git_Code\Shop.ERP\CoreCms.Net.Web.WebApi\wwwroot\favicon.ico
F:\Git_Code\Shop.ERP\CoreCms.Net.Web.WebApi\wwwroot\static\images\logo.png
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment