<develop>:(ShopERP 端)<无> ShopERP 项目优化

parent 87a76dc1
...@@ -41,7 +41,7 @@ namespace CoreCms.Net.Web.Admin.Infrastructure ...@@ -41,7 +41,7 @@ namespace CoreCms.Net.Web.Admin.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"
}; };
// 注册邮件服务 // 注册邮件服务
...@@ -73,6 +73,7 @@ namespace CoreCms.Net.Web.Admin.Infrastructure ...@@ -73,6 +73,7 @@ namespace CoreCms.Net.Web.Admin.Infrastructure
//jwt授权支持注入 //jwt授权支持注入
builder.Services.AddAuthorizationSetupForAdmin(); builder.Services.AddAuthorizationSetupForAdmin();
//上下文注入 //上下文注入
builder.Services.AddHttpContextSetup(); builder.Services.AddHttpContextSetup();
......

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 广告api控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class AdvertController : ControllerBase
{
private IHttpContextUser _user;
private readonly ICoreCmsArticleServices _articleServices;
private readonly ICoreCmsAdvertPositionServices _advertPositionServices;
private readonly ICoreCmsAdvertisementServices _advertisementServices;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="user"></param>
/// <param name="articleServices"></param>
/// <param name="advertPositionServices"></param>
/// <param name="advertisementServices"></param>
public AdvertController(IHttpContextUser user
, ICoreCmsArticleServices articleServices
, ICoreCmsAdvertPositionServices advertPositionServices
, ICoreCmsAdvertisementServices advertisementServices
)
{
_user = user;
_articleServices = articleServices;
_advertPositionServices = advertPositionServices;
_advertisementServices = advertisementServices;
}
#region 获取广告列表=============================================================================
/// <summary>
/// 获取广告列表
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetAdvertList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var list = await _advertisementServices.QueryPageAsync(p => p.code == entity.where, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
jm.status = true;
jm.data = list;
return jm;
}
#endregion
#region 获取广告位置信息=============================================================================
/// <summary>
/// 获取广告位置信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetPositionList([FromBody] WxAdvert entity)
{
var jm = new WebApiCallBack();
var position = await _advertPositionServices.QueryListByClauseAsync(p => p.isEnable && p.code == entity.codes);
if (!position.Any())
{
return jm;
}
var ids = position.Select(p => p.id).ToList();
var isement = await _advertisementServices.QueryListByClauseAsync(p => ids.Contains(p.positionId));
Dictionary<string, List<CoreCmsAdvertisement>> list = new Dictionary<string, List<CoreCmsAdvertisement>>();
list.Add(entity.codes, isement);
jm.status = true;
jm.data = list;
return jm;
}
#endregion
}
}

using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 文章api控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class ArticleController : ControllerBase
{
private IHttpContextUser _user;
private readonly ICoreCmsArticleServices _articleServices;
private readonly ICoreCmsArticleTypeServices _articleTypeServices;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="user"></param>
/// <param name="articleServices"></param>
/// <param name="articleTypeServices"></param>
public ArticleController(IHttpContextUser user, ICoreCmsArticleServices articleServices, ICoreCmsArticleTypeServices articleTypeServices)
{
_user = user;
_articleServices = articleServices;
_articleTypeServices = articleTypeServices;
}
#region 获取通知列表
/// <summary>
/// 获取通知列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> NoticeList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var list = await _articleServices.QueryPageAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
jm.status = true;
jm.data = list;
return jm;
}
#endregion
#region 获取文章列表
/// <summary>
/// 获取文章列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetArticleList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var list = await _articleServices.QueryPageAsync(p => p.isDel == false && p.typeId == entity.id, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
var articleType = await _articleTypeServices.QueryAsync();
var typeName = string.Empty;
if (articleType.Any())
{
var type = articleType.Find(p => p.id == entity.id);
typeName = type != null ? type.name : "";
}
jm.status = true;
jm.data = new
{
list,
articleType,
type_name = typeName,
count = list.TotalCount
};
return jm;
}
#endregion
/// <summary>
/// 获取单个文章内容
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetArticleDetail([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var model = await _articleServices.ArticleDetail(entity.id);
if (model == null)
{
jm.msg = "数据获取失败";
return jm;
}
jm.status = true;
jm.data = model;
return jm;
}
}
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Aliyun.OSS;
using Aliyun.OSS.Util;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.Options;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using COSXML;
using COSXML.Auth;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 通用调用接口数据
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class CommonController : ControllerBase
{
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsAreaServices _areaServices;
private readonly ICoreCmsServiceDescriptionServices _serviceDescriptionServices;
private readonly ICoreCmsSettingServices _coreCmsSettingServices;
private readonly IToolsServices _toolsServices;
/// <summary>
/// 构造函数
/// </summary>
public CommonController(ICoreCmsSettingServices settingServices
, ICoreCmsAreaServices areaServices
, IWebHostEnvironment webHostEnvironment, ICoreCmsServiceDescriptionServices serviceDescriptionServices, ICoreCmsSettingServices coreCmsSettingServices, IToolsServices toolsServices)
{
_webHostEnvironment = webHostEnvironment;
_serviceDescriptionServices = serviceDescriptionServices;
_coreCmsSettingServices = coreCmsSettingServices;
_toolsServices = toolsServices;
_settingServices = settingServices;
_areaServices = areaServices;
}
//公共接口====================================================================================================
#region 接口测试反馈=============================================================
/// <summary>
/// 接口测试反馈
/// </summary>
/// <returns></returns>
[HttpPost]
public WebApiCallBack InterFaceTest()
{
var jm = new WebApiCallBack { status = true, msg = "接口访问正常", data = DateTime.Now };
return jm;
}
#endregion
#region 返回配置数据文件V2.0===============================================================
/// <summary>
/// 返回配置数据文件V2.0
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetConfigV2()
{
var jm = new WebApiCallBack { status = true, msg = "接口访问正常", data = DateTime.Now };
var allConfigs = await _settingServices.GetConfigDictionaries();
var shopLogo = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopLogo); //店铺logo
var shopName = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopName); //店铺名称
var shopBeiAn = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopBeiAn); //店铺备案
var shopDesc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopDesc); //店铺描述
var showStoresSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowStoresSwitch).ObjectToInt(2); //显示门店列表
var showStoreBalanceRechargeSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowStoreBalanceRechargeSwitch).ObjectToInt(2); //显示充值功能
var imageMax = 5; //前端上传图片最多几张
var storeSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StoreSwitch).ObjectToInt(); //开启门店自提状态
var cateStyle = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.CateStyle).ObjectToInt(); //分类样式
var cateType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.CateType).ObjectToInt(); //H5分类类型
var toCashMoneyLow = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.TocashMoneyLow); //最低提现
var toCashMoneyRate = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.TocashMoneyRate); //服务费
var pointSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointSwitch).ObjectToInt(); //是否开启积分功能
var statistics = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StatisticsCode); //获取统计代码
var recommendKeysStr = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.RecommendKeys);
var recommendKeys = !string.IsNullOrEmpty(recommendKeysStr) ? recommendKeysStr.Split("|") : new string[] { }; //搜索推荐关键字
var invoiceSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.InvoiceSwitch).ObjectToInt(); //发票功能开关
var goodsStocksWarn = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.GoodsStocksWarn).ObjectToInt(); //库存报警数量
var shopDefaultImage = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopDefaultImage); //获取默认图片
var shopMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopMobile); //店铺联系电话
var openDistribution = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OpenDistribution).ObjectToInt(); //是否开启分销
var distributionNotes = string.Empty;
var distributionAgreement = string.Empty;
var distributionStore = 2;
if (openDistribution == 1)
{
distributionNotes = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionNotes); //用户须知
distributionAgreement = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionAgreement); //分销协议
distributionStore = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionStore).ObjectToInt(2); //是否开启店铺
}
var showInviter = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShowInviterInfo).ObjectToInt(); //是否显示邀请人信息
var shareTitle = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShareTitle); //分享标题
var shareDesc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShareDesc); //分享描述
var shareImage = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShareImage); //分享图片
var aboutArticleId = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.AboutArticleId).ObjectToInt(2); //关于我们文章
var entId = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.EntId); //客服ID
var userAgreementId = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.UserAgreementId).ObjectToInt(3); //用户协议
var privacyPolicyId = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PrivacyPolicyId).ObjectToInt(4); //隐私政策
var reshipName = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipName); //退货联系人
var reshipMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipMobile); //退货联系方式
var reshipAreaId = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipAreaId); //退货区域
var reshipAddress = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipAddress); //退货联系方式
var reshipCoordinate = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipCoordinate); //退货坐标
var orderCancelTime = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OrderCancelTime).ObjectToInt(60); //订单取消时间
//代理
var isOpenAgent = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IsOpenAgent).ObjectToInt(); //是否开启代理模块
var isShowAgentPortal = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IsShowAgentPortal).ObjectToInt(); //是否显示代理模块入口
var agentNotes = string.Empty;
var agentAgreement = string.Empty;
if (isOpenAgent == 1 && isShowAgentPortal == 1)
{
agentNotes = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.AgentNotes); //用户须知
agentAgreement = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.AgentAgreement); //分销协议
}
var model = new
{
shopLogo,
shopName,
shopBeiAn = shopBeiAn,
shopDesc,
imageMax,
storeSwitch,
showStoresSwitch,
showStoreBalanceRechargeSwitch,
cateStyle,
cateType,
toCashMoneyLow,
toCashMoneyRate,
pointSwitch,
statistics,
recommendKeys,
invoiceSwitch,
goodsStocksWarn,
shopDefaultImage,
shopMobile,
openDistribution,
distributionNotes,
distributionAgreement,
distributionStore,
showInviter,
shareTitle,
shareDesc,
shareImage,
aboutArticleId,
entId,
userAgreementId,
privacyPolicyId,
reshipName,
reshipMobile,
reshipAreaId,
reshipAddress,
reshipCoordinate,
orderCancelTime,
isOpenAgent,
isShowAgentPortal,
agentNotes,
agentAgreement
};
jm.data = model;
return jm;
}
#endregion
#region 获取区域配置=============================================================================
/// <summary>
/// 获取层级分配后的区域信息
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetAreas()
{
var jm = new WebApiCallBack();
var areas = await _areaServices.GetCaChe();
jm.status = true;
jm.data = AreaHelper.GetList(areas);
return jm;
}
#endregion
#region 获取商城关键词说明列表
/// <summary>
/// 获取商城关键词说明列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetServiceDescription()
{
var jm = new WebApiCallBack();
var caCheList = await _serviceDescriptionServices.GetCaChe();
jm.status = true;
jm.data = new
{
commonQuestion = caCheList.Where(p => p.type == (int)GlobalEnumVars.ShopServiceNoteType.CommonQuestion && p.isShow == true).OrderBy(p => p.sortId).ToList(),
service = caCheList.Where(p => p.type == (int)GlobalEnumVars.ShopServiceNoteType.Service && p.isShow == true).OrderBy(p => p.sortId).ToList(),
delivery = caCheList.Where(p => p.type == (int)GlobalEnumVars.ShopServiceNoteType.Delivery && p.isShow == true).OrderBy(p => p.sortId).ToList()
};
return jm;
}
#endregion
//验证接口====================================================================================================
#region 上传附件通用接口====================================================
/// <summary>
/// 上传附件通用接口
/// </summary>
/// <returns></returns>
[Authorize]
[HttpPost]
public async Task<WebApiCallBack> UploadImages()
{
var jm = new WebApiCallBack();
var filesStorageOptions = await _coreCmsSettingServices.GetFilesStorageOptions();
//初始化上传参数
var maxSize = 1024 * 1024 * filesStorageOptions.MaxSize; //上传大小5M
var file = Request.Form.Files["file"];
if (file == null)
{
jm.msg = "请选择文件";
return jm;
}
string fileName = file.FileName;
string fileExt = Path.GetExtension(fileName).ToLowerInvariant();
//检查大小
if (file.Length > maxSize)
{
jm.msg = "上传文件大小超过限制,最大允许上传" + filesStorageOptions.MaxSize + "M";
return jm;
}
//检查文件扩展名
if (string.IsNullOrEmpty(fileExt) ||
Array.IndexOf(filesStorageOptions.FileTypes.Split(','), fileExt.Substring(1).ToLower()) == -1)
{
jm.msg = "上传文件扩展名是不允许的扩展名,请上传后缀名为:" + filesStorageOptions.FileTypes;
return jm;
}
string url = string.Empty;
if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString())
{
url = await _toolsServices.UpLoadFileForLocalStorage(filesStorageOptions, fileExt, file, (int)GlobalEnumVars.FilesStorageLocation.API);
}
else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.AliYunOSS.ToString())
{
url = await _toolsServices.UpLoadFileForAliYunOSS(filesStorageOptions, fileExt, file);
}
else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QCloudOSS.ToString())
{
url = await _toolsServices.UpLoadFileForQCloudOSS(filesStorageOptions, fileExt, file);
}
else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QiNiuKoDo.ToString())
{
url = await _toolsServices.UpLoadFileForQiNiuKoDo(filesStorageOptions, fileExt, file);
}
var bl = !string.IsNullOrEmpty(url);
jm.status = bl;
jm.code = bl ? 0 : 1;
jm.msg = bl ? "上传成功!" : "上传失败";
jm.data = new
{
fileUrl = url,
src = url,
imageId = url
};
return jm;
}
#endregion
}
}
\ No newline at end of file

using System;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 优惠券接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class CouponController : ControllerBase
{
private readonly IHttpContextUser _user;
private readonly ICoreCmsCouponServices _couponServices;
private readonly ICoreCmsPromotionServices _promotionServices;
private readonly IUnitOfWork _unionOfWork;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="user"></param>
/// <param name="couponServices"></param>
/// <param name="promotionServices"></param>
/// <param name="unionOfWork"></param>
public CouponController(IHttpContextUser user
, ICoreCmsCouponServices couponServices, ICoreCmsPromotionServices promotionServices, IUnitOfWork unionOfWork)
{
_user = user;
_couponServices = couponServices;
_promotionServices = promotionServices;
_unionOfWork = unionOfWork;
}
//公共接口====================================================================================================
#region 获取 可领取的优惠券==================================================
/// <summary>
/// 获取 可领取的优惠券
/// </summary>
/// <returns></returns>
[HttpPost]
//[Authorize]
public async Task<WebApiCallBack> CouponList([FromBody] FMCouponForUserCouponPost entity)
{
var jm = new WebApiCallBack() { msg = "获取失败" };
var list = await _promotionServices.GetReceiveCouponList(entity.page, entity.limit);
jm.status = true;
jm.data = list;
jm.msg = "获取成功";
jm.otherData = new
{
totalCount = 0,
totalPages = 0,
};
if (list != null && list.Any())
{
jm.data = list;
jm.otherData = new
{
list.TotalCount,
list.TotalPages
};
}
return jm;
}
#endregion
//验证接口====================================================================================================
#region 获取优惠券 详情==================================================
/// <summary>
/// 获取优惠券 详情
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> CouponDetail([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack() { msg = "获取失败" };
if (entity.id == 0)
{
jm.status = false;
jm.msg = GlobalErrorCodeVars.Code15006;
return jm;
}
var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == entity.id);
if (promotionModel != null)
{
jm.status = true;
jm.data = promotionModel;
jm.msg = "获取成功";
}
return jm;
}
#endregion
#region 获取用户已领取的优惠券==================================================
/// <summary>
/// 获取用户已领取的优惠券
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> UserCoupon([FromBody] FMCouponForUserCouponPost entity)
{
var jm = await _couponServices.GetMyCoupon(_user.ID, 0, entity.display, entity.page, entity.limit);
return jm;
}
#endregion
#region 用户领取优惠券==================================================
/// <summary>
/// 用户领取优惠券
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetCoupon([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
if (entity.id == 0)
{
jm.msg = GlobalErrorCodeVars.Code15006;
return jm;
}
try
{
_unionOfWork.BeginTran();
//判断优惠券是否可以领取?
var promotionModel = await _promotionServices.ReceiveCoupon(entity.id);
if (promotionModel.status == false)
{
_unionOfWork.RollbackTran();
return promotionModel;
}
var promotion = (CoreCmsPromotion)promotionModel.data;
if (promotion == null)
{
_unionOfWork.RollbackTran();
jm.msg = GlobalErrorCodeVars.Code15019;
return jm;
}
if (promotion.maxNums > 0)
{
//判断用户是否已领取?领取次数
var couponResult = await _couponServices.GetMyCoupon(_user.ID, entity.id, "all", 1, 9999);
if (couponResult.status && couponResult.code >= promotion.maxNums)
{
_unionOfWork.RollbackTran();
jm.msg = GlobalErrorCodeVars.Code15018;
return jm;
}
}
jm = await _couponServices.AddData(_user.ID, entity.id, promotion);
_unionOfWork.CommitTran();
jm.otherData = promotionModel;
}
catch (Exception e)
{
_unionOfWork.RollbackTran();
jm.msg = GlobalErrorCodeVars.Code10000;
}
return jm;
}
#endregion
#region 用户输入code领取优惠券==================================================
/// <summary>
/// 用户输入code领取优惠券
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetCouponKey([FromBody] FMCouponForGetCouponKeyPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.key))
{
jm.msg = GlobalErrorCodeVars.Code15006;
return jm;
}
var coupon = await _couponServices.QueryByClauseAsync(p => p.couponCode == entity.key);
if (coupon == null || coupon.promotionId <= 0)
{
jm.msg = GlobalErrorCodeVars.Code15009;
return jm;
}
//判断优惠券是否可以领取?
var promotionModel = await _promotionServices.ReceiveCoupon(coupon.promotionId);
if (promotionModel.status == false)
{
return promotionModel;
}
//判断用户是否已领取?
if (promotionModel.data is CoreCmsPromotion { maxNums: > 0 } info)
{
//判断用户是否已领取?领取次数
var couponResult = await _couponServices.GetMyCoupon(_user.ID, coupon.promotionId, "all", 1, 9999);
if (couponResult.status && couponResult.code > info.maxNums)
{
jm.msg = GlobalErrorCodeVars.Code15018;
return jm;
}
}
//
jm = await _couponServices.ReceiveCoupon(_user.ID, entity.key);
return jm;
}
#endregion
}
}
\ No newline at end of file

using CoreCms.Net.Model.ViewModels.Email;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 默认接口示例
/// </summary>
public class DemoController : ControllerBase
{
/// <summary>
///默认首页
/// </summary>
/// <returns></returns>
public IActionResult Index()
{
return Content("已结束");
}
}
}
\ No newline at end of file

using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 分销请求接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class DistributionController : ControllerBase
{
private readonly ICoreCmsDistributionOrderServices _distributionOrderServices;
private readonly ICoreCmsDistributionServices _distributionServices;
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsUserServices _userServices;
private readonly IHttpContextUser _user;
/// <summary>
/// 构造函数
/// </summary>
public DistributionController(IHttpContextUser user, ICoreCmsDistributionServices distributionServices,
ICoreCmsSettingServices settingServices, ICoreCmsUserServices userServices,
ICoreCmsDistributionOrderServices distributionOrderServices)
{
_user = user;
_distributionServices = distributionServices;
_settingServices = settingServices;
_userServices = userServices;
_distributionOrderServices = distributionOrderServices;
}
//公共接口====================================================================================================
#region 获取店铺信息
/// <summary>
/// 获取店铺信息
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetStoreInfo([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
if (entity.id == 0)
{
jm.msg = "店铺信息丢失";
return jm;
}
var store = UserHelper.GetUserIdByShareCode(entity.id);
if (store <= 0)
{
jm.msg = "店铺信息丢失";
return jm;
}
jm = await _distributionServices.GetStore(store);
return jm;
}
#endregion
//验证接口====================================================================================================
#region 查询用户是否可以成为分销商
/// <summary>
/// 查询用户是否可以成为分销商
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Info()
{
var jm = await _distributionServices.GetInfo(_user.ID, true);
return jm;
}
#endregion
#region 申请成为分销商接口
/// <summary>
/// 申请成为分销商接口
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> ApplyDistribution([FromBody] FMDistributionApply entity)
{
var jm = new WebApiCallBack();
if (entity.agreement != "on")
{
jm.msg = "请勾选分销协议";
return jm;
}
var iData = new CoreCmsDistribution();
iData.mobile = entity.mobile;
iData.name = entity.name;
iData.weixin = entity.weixin;
iData.qq = entity.qq;
jm = await _distributionServices.AddData(iData, _user.ID);
return jm;
}
#endregion
#region 我推广的订单
/// <summary>
/// 我推广的订单
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> MyOrder([FromBody] FMPageByIntId entity)
{
var jm = await _distributionServices.GetMyOrderList(_user.ID, entity.page, entity.limit, entity.id);
return jm;
}
#endregion
#region 店铺设置
/// <summary>
/// 店铺设置
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> SetStore([FromBody] FMSetDistributionStorePost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.storeName))
{
jm.msg = "请填写店铺名称";
return jm;
}
if (string.IsNullOrEmpty(entity.storeLogo))
{
jm.msg = "请上传店铺logo";
return jm;
}
if (string.IsNullOrEmpty(entity.storeBanner))
{
jm.msg = "请上传店铺banner";
return jm;
}
var info = await _distributionServices.QueryByClauseAsync(p => p.userId == _user.ID);
if (info != null)
{
info.storeLogo = entity.storeLogo;
info.storeBanner = entity.storeBanner;
info.storeDesc = entity.storeDesc;
info.storeName = entity.storeName;
await _distributionServices.UpdateAsync(info);
}
jm.status = true;
jm.msg = "保存成功";
return jm;
}
#endregion
#region 获取我的订单统计
/// <summary>
/// 获取我的订单统计
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetOrderSum()
{
var jm = new WebApiCallBack();
//全部订单
var allOrder = await _distributionOrderServices.QueryChildOrderCountAsync(_user.ID, 0);
//一级订单
var firstOrder = await _distributionOrderServices.QueryChildOrderCountAsync(_user.ID);
//二级订单
var secondOrder = await _distributionOrderServices.QueryChildOrderCountAsync(_user.ID, 2);
//本月订单
var monthOrder = await _distributionOrderServices.QueryChildOrderCountAsync(_user.ID, 0, true);
//全部订单金额
var allOrderMoney = await _distributionOrderServices.QueryChildOrderMoneySumAsync(_user.ID, 0);
//代购订单金额
var firstOrderMoney = await _distributionOrderServices.QueryChildOrderMoneySumAsync(_user.ID);
//推广订单金额
var secondOrderMoney = await _distributionOrderServices.QueryChildOrderMoneySumAsync(_user.ID, 2);
//本月订单金额
var monthOrderMoney = await _distributionOrderServices.QueryChildOrderMoneySumAsync(_user.ID, 0, true);
jm.status = true;
jm.data = new
{
allOrder,
firstOrder,
secondOrder,
monthOrder,
allOrderMoney,
firstOrderMoney,
secondOrderMoney,
monthOrderMoney
};
return jm;
}
#endregion
#region 获取我的下级用户数量
/// <summary>
/// 获取我的下级用户数量
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetTeamSum()
{
var jm = new WebApiCallBack();
//一级统计人数
var first = await _userServices.QueryChildCountAsync(_user.ID);
//二级发展人数
var second = await _userServices.QueryChildCountAsync(_user.ID, 2);
//当月发展一级人数
var monthFirst = await _userServices.QueryChildCountAsync(_user.ID, 1, true);
//当月发展二级分数
var monthSecond = await _userServices.QueryChildCountAsync(_user.ID, 2, true);
jm.status = true;
jm.data = new
{
count = first + second,
first,
second,
monthCount = monthFirst + monthSecond,
monthFirst,
monthSecond
};
return jm;
}
#endregion
#region 获取分销商排行
/// <summary>
/// 获取分销商排行
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetDistributionRanking([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var list = await _distributionServices.QueryRankingPageAsync(entity.page, entity.limit);
jm.status = true;
jm.data = new
{
data = list,
list.HasNextPage,
list.HasPreviousPage,
list.PageIndex,
list.PageSize,
list.TotalPages,
list.TotalCount
};
return jm;
}
#endregion
}
}
\ No newline at end of file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 表单接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class FormController : ControllerBase
{
private readonly ICoreCmsFormServices _formServices;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="formServices"></param>
public FormController(ICoreCmsFormServices formServices)
{
_formServices = formServices;
}
#region 万能表单/获取活动商品详情=============================================================================
/// <summary>
/// 万能表单/获取活动商品详情
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetFormDetial([FromBody] FmGetForm entity)
{
var jm = await _formServices.GetFormInfo(entity.id, entity.token);
return jm;
}
#endregion
#region 万能表单/提交表单=============================================================================
/// <summary>
/// 万能表单/提交表单
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> AddSubmit([FromBody] FmAddSubmit entity)
{
var jm = await _formServices.AddSubmit(entity);
jm.otherData = entity;
return jm;
}
#endregion
}
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using AutoMapper;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
using CoreCms.Net.Utility.Helper;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 商品相关接口处理
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class GoodController : ControllerBase
{
private IMapper _mapper;
private readonly IHttpContextUser _user;
private ICoreCmsSettingServices _settingServices;
private ICoreCmsGoodsCategoryServices _goodsCategoryServices;
private ICoreCmsGoodsServices _goodsServices;
private ICoreCmsProductsServices _productsServices;
private ICoreCmsBrandServices _brandServices;
private ICoreCmsOrderItemServices _orderItemServices;
private ICoreCmsGoodsCommentServices _goodsCommentServices;
private ICoreCmsGoodsParamsServices _goodsParamsServices;
private ICoreCmsGoodsCollectionServices _goodsCollectionServices;
private ICoreCmsUserServices _userServices;
private ICoreCmsGoodsCategoryExtendServices _goodsCategoryExtendServices;
/// <summary>
/// 构造函数
/// </summary>
public GoodController(IMapper mapper
, IHttpContextUser user
, ICoreCmsSettingServices settingServices
, ICoreCmsGoodsCategoryServices goodsCategoryServices
, ICoreCmsGoodsServices goodsServices
, ICoreCmsProductsServices productsServices
, ICoreCmsBrandServices brandServices
, ICoreCmsOrderItemServices orderItemServices
, ICoreCmsGoodsCommentServices goodsCommentServices
, ICoreCmsGoodsParamsServices goodsParamsServices
, ICoreCmsGoodsCollectionServices goodsCollectionServices
, ICoreCmsUserServices userServices, ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices)
{
_mapper = mapper;
_user = user;
_settingServices = settingServices;
_goodsCategoryServices = goodsCategoryServices;
_goodsServices = goodsServices;
_productsServices = productsServices;
_brandServices = brandServices;
_orderItemServices = orderItemServices;
_goodsCommentServices = goodsCommentServices;
_goodsParamsServices = goodsParamsServices;
_goodsCollectionServices = goodsCollectionServices;
_userServices = userServices;
_goodsCategoryExtendServices = goodsCategoryExtendServices;
}
//公共接口====================================================================================================
#region 获取所有商品分类栏目数据
/// <summary>
/// 获取所有商品分类栏目数据
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetAllCategories()
{
var jm = new WebApiCallBack() { status = true };
var data = await _goodsCategoryServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort,
OrderByType.Asc);
var wxGoodCategoryDto = new List<WxGoodCategoryDto>();
var parents = data.Where(p => p.parentId == 0).ToList();
if (parents.Any())
{
parents.ForEach(p =>
{
var model = new WxGoodCategoryDto();
model.id = p.id;
model.name = p.name;
model.imageUrl = !string.IsNullOrEmpty(p.imageUrl) ? p.imageUrl : "/static/images/common/empty.png";
model.sort = p.sort;
var childs = data.Where(p => p.parentId == model.id).ToList();
if (childs.Any())
{
var childsList = new List<WxGoodCategoryChild>();
childs.ForEach(o =>
{
childsList.Add(new WxGoodCategoryChild()
{
id = o.id,
imageUrl = !string.IsNullOrEmpty(o.imageUrl) ? o.imageUrl : "/static/images/common/empty.png",
name = o.name,
sort = o.sort
});
});
model.child = childsList;
}
wxGoodCategoryDto.Add(model);
});
}
jm.status = true;
jm.data = wxGoodCategoryDto;
return jm;
}
#endregion
#region 根据查询条件获取分页数据============================================================
/// <summary>
/// 根据查询条件获取分页数据
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetGoodsPageList([FromBody] FMPageByWhereOrder entity)
{
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsGoods>();
where = where.And(p => p.isDel == false);
where = where.And(p => p.isMarketable == true);
var className = string.Empty;
if (!string.IsNullOrWhiteSpace(entity.where))
{
var obj = JsonConvert.DeserializeAnonymousType(entity.where, new
{
priceFrom = "",
priceTo = "",
catId = "",
brandId = "",
labelId = "",
searchName = "",
});
if (!string.IsNullOrWhiteSpace(obj.priceFrom))
{
var priceF = obj.priceFrom.ObjectToDouble(0);
if (priceF >= 0)
{
var f = Convert.ToDecimal(priceF);
where = where.And(p => p.price >= f);
}
}
if (!string.IsNullOrWhiteSpace(obj.priceTo))
{
var priceT = obj.priceTo.ObjectToDouble(0);
if (priceT > 0)
{
var f = Convert.ToDecimal(priceT);
where = where.And(p => p.price <= f);
}
}
if (!string.IsNullOrWhiteSpace(obj.catId))
{
var catId = obj.catId.ObjectToInt(0);
if (catId > 0)
{
var category = await _goodsCategoryServices.QueryByIdAsync(catId, true);
if (category != null)
{
className = category.name;
}
var categories = await _goodsCategoryServices.QueryAsync(true);
var ids = GoodsHelper.GetChildIds(categories, catId);
//扩展分类
var extends = await _goodsCategoryExtendServices.QueryListByClauseAsync(p => p.goodsCategroyId == catId);
if (extends.Any())
{
var extGoodIds = extends.Select(p => p.goodsId).ToList();
where = where.And(p => ids.Contains(p.goodsCategoryId) || extGoodIds.Contains(p.id));
}
else
{
where = where.And(p => ids.Contains(p.goodsCategoryId));
}
}
}
if (!string.IsNullOrWhiteSpace(obj.brandId))
{
var brandId = obj.brandId.ObjectToInt(0);
if (brandId > 0)
{
where = where.And(p => p.brandId == brandId);
}
}
if (!string.IsNullOrWhiteSpace(obj.labelId))
{
where = where.And(p => (',' + p.labelIds.Trim(',') + ',').Contains(',' + obj.labelId.Trim(',') + ','));
}
if (!string.IsNullOrWhiteSpace(obj.searchName))
{
where = where.And(p => p.name.Contains(obj.searchName));
}
}
//获取数据
var list = await _goodsServices.QueryPageForLinqAsync(where, entity.order, entity.page, entity.limit, false);
if (list.Any())
{
foreach (var goods in list)
{
goods.images = !string.IsNullOrEmpty(goods.images) ? goods.images.Split(",")[0] : "/static/images/common/empty.png";
}
}
//获取品牌
var brands = await _brandServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort, OrderByType.Desc);
//返回数据
jm.status = true;
jm.data = new
{
list,
className,
entity.page,
list.TotalCount,
list.TotalPages,
entity.limit,
entity.where,
entity.order,
brands
};
jm.msg = "数据调用成功!";
return jm;
}
#endregion
#region 获取商品详情======================================================================
/// <summary>
/// 获取商品详情
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetDetial([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var userId = 0;
if (_user != null)
{
userId = _user.ID;
}
var model = await _goodsServices.GetGoodsDetial(entity.id, userId, false);
if (model == null)
{
jm.msg = "商品获取失败";
return jm;
}
jm.status = true;
jm.msg = "获取商品详情成功";
jm.data = model;
jm.methodDescription = JsonConvert.SerializeObject(_user);
return jm;
}
#endregion
#region 获取单个货品信息======================================================================
/// <summary>
/// 获取单个货品信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetProductInfo([FromBody] FMGetProductInfo entity)
{
var jm = new WebApiCallBack();
var userId = 0;
if (_user != null)
{
userId = _user.ID;
}
bool bl = entity.type == "pinTuan" || entity.type == "group";
var getProductInfo = await _productsServices.GetProductInfo(entity.id, bl, userId, entity.type, entity.groupId);
if (getProductInfo == null)
{
jm.msg = "获取单个货品失败";
return jm;
}
jm.status = true;
jm.msg = "获取单个货品成功";
jm.data = getProductInfo;
return jm;
}
#endregion
#region 获取商品评价列表分页数据======================================================================
/// <summary>
/// 获取商品评价列表分页数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetGoodsComment([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
//获取数据
var list = await _goodsCommentServices.QueryPageAsync(p => p.goodsId == entity.id && p.isDisplay == true, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
if (list.Any())
{
foreach (var item in list)
{
item.imagesArr = !string.IsNullOrEmpty(item.images) ? item.images.Split(",") : null;
}
}
jm.status = true;
jm.msg = "获取评论成功";
jm.data = new
{
list,
commentsCount = list.TotalCount,
totalPages = list.TotalPages
};
return jm;
}
#endregion
#region 获取商品参数======================================================================
/// <summary>
/// 获取单个商品参数
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetGoodsParams([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
//获取数据
var goods = await _goodsServices.QueryByIdAsync(entity.id);
if (goods == null)
{
jm.msg = GlobalConstVars.DataisNo;
return jm;
}
var list = new List<WxNameValueDto>();
var goodsParams = await _goodsParamsServices.QueryAsync();
if (!string.IsNullOrEmpty(goods.parameters))
{
var arrItem = goods.parameters.Split("|");
foreach (var item in arrItem)
{
if (!item.Contains(":")) continue;
var childArr = item.Split(":");
if (childArr.Length == 2)
{
var paramsId = Convert.ToInt32(childArr[0]);
var paramsModel = goodsParams.First(p => p.id == paramsId);
if (paramsModel != null)
{
list.Add(new WxNameValueDto()
{
name = paramsModel.name,
value = childArr[1]
});
}
}
}
}
jm.status = true;
jm.msg = "获取商品参数成功";
jm.data = list;
return jm;
}
#endregion
#region 获取随机推荐商品==================================================
/// <summary>
/// 获取随机推荐商品
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetGoodsRecommendList([FromBody] FMIntId entity)
{
if (entity.id <= 0)
{
entity.id = 10;
}
var bl = entity.data.ObjectToBool();
var jm = new WebApiCallBack()
{
status = true,
code = 0,
msg = "获取成功",
data = await _goodsServices.GetGoodsRecommendList(entity.id, bl)
};
return jm;
}
#endregion
//验证接口====================================================================================================
#region 根据Token获取商品详情======================================================================
/// <summary>
/// 根据Token获取商品详情
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetDetialByToken([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var userId = 0;
if (_user != null)
{
userId = _user.ID;
}
var model = await _goodsServices.GetGoodsDetial(entity.id, userId, false);
if (model == null)
{
jm.msg = "商品获取失败";
return jm;
}
await _goodsServices.UpdateAsync(p => new CoreCmsGoods() { viewCount = p.viewCount + 1 },
p => p.id == entity.id);
jm.status = true;
jm.msg = "获取商品详情成功";
jm.data = model;
jm.methodDescription = JsonConvert.SerializeObject(_user);
return jm;
}
#endregion
}
}
\ No newline at end of file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 团购调用接口数据
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class GroupController : ControllerBase
{
private readonly IHttpContextUser _user;
private readonly ICoreCmsPromotionServices _coreCmsPromotionServices;
private ICoreCmsGoodsServices _goodsServices;
/// <summary>
/// 构造函数
/// </summary>
public GroupController(IHttpContextUser user, ICoreCmsPromotionServices coreCmsPromotionServices, ICoreCmsGoodsServices goodsServices)
{
_user = user;
_coreCmsPromotionServices = coreCmsPromotionServices;
_goodsServices = goodsServices;
}
//公共接口====================================================================================================
#region 获取秒杀团购列表===========================================================
/// <summary>
/// 获取秒杀团购列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetList([FromBody] FMGroupGetListPost entity)
{
var jm = await _coreCmsPromotionServices.GetGroupList(entity.type, _user.ID, entity.status, entity.page, entity.limit);
return jm;
}
#endregion
#region 获取秒杀团购详情===========================================================
/// <summary>
/// 获取秒杀团购详情
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetGoodsDetial([FromBody] FMGetGoodsDetial entity)
{
var jm = await _coreCmsPromotionServices.GetGroupDetail(entity.id, 0, "group", entity.groupId);
return jm;
}
#endregion
//验证接口====================================================================================================
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 公告控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class NoticeController : ControllerBase
{
private IHttpContextUser _user;
private ICoreCmsNoticeServices _noticeServices;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="user"></param>
/// <param name="noticeServices"></param>
public NoticeController(IHttpContextUser user, ICoreCmsNoticeServices noticeServices)
{
_user = user;
_noticeServices = noticeServices;
}
#region 列表
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> NoticeList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var list = await _noticeServices.QueryPageAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
jm.status = true;
jm.data = list;
return jm;
}
#endregion
/// <summary>
/// 获取单个公告内容
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> NoticeInfo([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var model = await _noticeServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = "数据获取失败";
return jm;
}
jm.status = true;
jm.data = model;
return jm;
}
}
}
...@@ -62,26 +62,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers ...@@ -62,26 +62,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
_storeServices = storeServices; _storeServices = storeServices;
} }
//公共接口====================================================================================================
//验证接口====================================================================================================
#region 发票模糊查询==================================================
/// <summary>
/// 发票模糊查询
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetTaxCode([FromBody] GetTaxCodePost entity)
{
var jm = await _orderServices.GetTaxCode(entity.name);
return jm;
}
#endregion
#region 创建订单================================================== #region 创建订单==================================================
/// <summary> /// <summary>
/// 创建订单 /// 创建订单
...@@ -144,59 +124,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers ...@@ -144,59 +124,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
} }
#endregion #endregion
#region 订单预览==================================================
/// <summary>
/// 订单预览
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> OrderDetails([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
var userId = _user.ID;
if ((string)entity.data == "merchant")
{
var store = await _storeServices.GetStoreByUserId(_user.ID);
if (store == null)
{
jm.status = false;
jm.msg = "你不是店员";
return jm;
}
else
{
userId = 0;
}
}
jm = await _orderServices.GetOrderInfoByOrderId(entity.id, userId);
return jm;
}
#endregion
#region 获取订单不同状态的数量==================================================
/// <summary>
/// 获取订单不同状态的数量
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetOrderStatusNum([FromBody] GetOrderStatusNumPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.ids))
{
jm.msg = "请提交要查询的订单统计类型";
}
var ids = CommonHelper.StringToIntArray(entity.ids);
jm = await _orderServices.GetOrderStatusNum(_user.ID, ids, entity.isAfterSale);
return jm;
}
#endregion
#region 获取个人订单列表======================================================= #region 获取个人订单列表=======================================================
/// <summary> /// <summary>
...@@ -284,203 +211,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers ...@@ -284,203 +211,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
} }
#endregion #endregion
#region 添加售后单=======================================================
/// <summary>
/// 添加售后单
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> AddAftersales([FromBody] ToAddBillAfterSalesPost entity)
{
var jm = new WebApiCallBack();
jm.otherData = entity;
if (string.IsNullOrEmpty(entity.orderId))
{
jm.msg = GlobalErrorCodeVars.Code13100;
jm.code = 13100;
return jm;
}
if (entity.type == 0)
{
jm.msg = GlobalErrorCodeVars.Code10051;
jm.code = 10051;
return jm;
}
jm = await _aftersalesServices.ToAdd(_user.ID, entity.orderId, entity.type, entity.items, entity.images,
entity.reason, entity.refund);
return jm;
}
#endregion
#region 获取售后单列表=======================================================
/// <summary>
/// 获取售后单列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> AftersalesList([FromBody] FMPageByStringId entity)
{
var jm = new WebApiCallBack();
jm.status = true;
jm.msg = "数据获取成功";
var where = PredicateBuilder.True<CoreCmsBillAftersales>();
where = where.And(p => p.userId == _user.ID);
if (!string.IsNullOrEmpty(entity.order))
{
where = where.And(p => p.orderId == entity.id);
}
var data = await _aftersalesServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
jm.data = new
{
list = data,
page = data.PageIndex,
totalPage = data.TotalPages,
hasNextPage = data.HasNextPage
};
return jm;
}
#endregion
#region 获取单个售后单详情
/// <summary>
/// 获取售后单列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Aftersalesinfo([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack { status = true, msg = "数据获取成功" };
var info = await _aftersalesServices.GetInfo(entity.id, _user.ID);
var allConfigs = await _settingServices.GetConfigDictionaries();
var reshipAddress = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipAddress);
var reshipArea = string.Empty;
var reshipId = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipAreaId).ObjectToInt(0);
if (reshipId > 0)
{
var result = await _areaServices.GetAreaFullName(reshipId);
if (result.status)
{
reshipArea = result.data.ToString();
}
}
var reshipMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipMobile);
var reshipName = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ReshipName);
var reship = new
{
reshipAddress,
reshipArea,
reshipMobile,
reshipName
};
jm.data = new
{
info,
reship
};
return jm;
}
#endregion
#region 提交售后发货快递信息
/// <summary>
/// 提交售后发货快递信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> SendReship([FromBody] FMBillReshipForSendReshipPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.reshipId))
{
jm.data = jm.msg = GlobalErrorCodeVars.Code13212;
return jm;
}
else if (string.IsNullOrEmpty(entity.logiCode))
{
jm.data = jm.msg = GlobalErrorCodeVars.Code13213;
return jm;
}
else if (string.IsNullOrEmpty(entity.logiNo))
{
jm.data = jm.msg = GlobalErrorCodeVars.Code13214;
return jm;
}
var model = await _reshipServices.QueryByIdAsync(entity.reshipId);
if (model == null)
{
jm.data = jm.msg = GlobalErrorCodeVars.Code13211;
return jm;
}
var up = await _reshipServices.UpdateAsync(
p => new CoreCmsBillReship()
{
logiCode = entity.logiCode,
logiNo = entity.logiNo,
status = (int)GlobalEnumVars.BillReshipStatus.运输中
}, p => p.reshipId == entity.reshipId);
jm.status = true;
jm.msg = "数据保存成功";
return jm;
}
#endregion
#region 获取配送方式列表=======================================================
/// <summary>
/// 获取配送方式列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public WebApiCallBack GetShip([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
jm.msg = "暂未设置配送方式";
var ship = _shipServices.GetShip(entity.id);
if (ship != null)
{
jm.status = true;
jm.data = ship;
jm.msg = "获取成功";
}
return jm;
}
#endregion
#region 前台物流查询接口======================================================= #region 前台物流查询接口=======================================================
/// <summary> /// <summary>
......

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
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.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 页面接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class PageController : ControllerBase
{
private IMapper _mapper;
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsPagesServices _pagesServices;
private readonly ICoreCmsOrderServices _orderServices;
private readonly ICoreCmsUserServices _userServices;
/// <summary>
/// 构造函数
/// </summary>
public PageController(IMapper mapper
, ICoreCmsSettingServices settingServices
, ICoreCmsPagesServices pagesServices
, ICoreCmsOrderServices orderServices
, ICoreCmsUserServices userServices)
{
_mapper = mapper;
_settingServices = settingServices;
_pagesServices = pagesServices;
_orderServices = orderServices;
_userServices = userServices;
}
//公共接口====================================================================================================
#region 获取页面布局数据=============================================================
/// <summary>
/// 获取页面布局数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("获取页面布局数据")]
public async Task<WebApiCallBack> GetPageConfig([FromBody] FMWxPost entity)
{
var jm = await _pagesServices.GetPageConfig(entity.code);
return jm;
}
#endregion
#region 获取用户购买记录=============================================================
/// <summary>
/// 获取用户购买记录
/// </summary>
[HttpPost]
[Description("获取用户购买记录")]
public async Task<WebApiCallBack> GetRecod([FromBody] FMGetRecodPost entity)
{
var jm = new WebApiCallBack() { status = true, msg = "获取成功", otherData = entity };
/***
* 随机数
* 其它随机数据,需要自己补充
*/
//logo作为头像
Random rand = new Random();
var allConfigs = await _settingServices.GetConfigDictionaries();
var avatar = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopLogo);
var names = new string[] { "无人像你", "啭裑①羣豞", "朕射妳无罪", "骑着蜗牛狂奔", "残孤星", "上网可以,别开QVOD", "请把QQ留下!", "蹭网可以,一小时两块钱", "I~在。哭泣", "不倾国倾城只倾他一人", "你再发光我就拔你插头", "家,世间最温暖的地方", "挥着鸡翅膀的女孩", "难不难过都是一个人过", "原谅我盛装出席只为错过你", "残孤星", "只适合被遗忘", "爱情,算个屁丶", "执子辶掱", "朕今晚翻你牌子", "①苆兜媞命", "中华一样的高傲", "始于心动止于枯骨", "我们幸福呢", "表白失败,勿扰", "髮型吥能亂", "陽咣丅啲憂喐", "你棺材是翻盖的还是滑盖的", "孤枕", "泪颜葬相思", "喵星人", "超拽霸气的微博名字", "晚安晚安晚晚难安", "却输给了秒", "为什么我吃德芙没有黑丝飘", "请输入我大" };
var listUsers = new List<RandUser>();
foreach (var itemName in names)
{
var min = rand.Next(100, 1000);
var createTime = DateTime.Now.AddMinutes(-min);
listUsers.Add(new RandUser()
{
avatar = avatar,
createTime = CommonHelper.TimeAgo(createTime),
nickname = itemName,
desc = "下单成功",
dt = createTime
});
}
if (entity.type == "home")
{
//数据库里面随机取出来几条数据
var orders = await _orderServices.QueryListByClauseAsync(p => p.isdel == false, 20, p => p.createTime,
OrderByType.Desc);
if (orders != null && orders.Any())
{
Random rd = new Random();
var index = rd.Next(orders.Count);
var orderItem = orders[index];
if (orderItem != null)
{
var user = await _userServices.QueryByIdAsync(orderItem.userId);
if (user != null && !string.IsNullOrEmpty(user.nickName))
{
jm.data = new RandUser()
{
avatar = !string.IsNullOrEmpty(user.avatarImage) ? user.avatarImage : avatar,
createTime = CommonHelper.TimeAgo(orderItem.createTime),
nickname = user.nickName,
desc = "下单成功",
dt = orderItem.createTime
};
}
}
}
else
{
Random rd = new Random();
var listI = rd.Next(listUsers.Count);
jm.data = listUsers[listI];
}
}
return jm;
}
#endregion
//验证接口====================================================================================================
}
}
\ No newline at end of file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
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.Extensions;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 支付调用接口数据
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class PaymentsController : ControllerBase
{
private IHttpContextUser _user;
private ICoreCmsBillPaymentsServices _billPaymentsServices;
private ICoreCmsPaymentsServices _paymentsServices;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="user"></param>
/// <param name="billPaymentsServices"></param>
/// <param name="paymentsServices"></param>
public PaymentsController(IHttpContextUser user
, ICoreCmsBillPaymentsServices billPaymentsServices
, ICoreCmsPaymentsServices paymentsServices
)
{
_user = user;
_billPaymentsServices = billPaymentsServices;
_paymentsServices = paymentsServices;
}
//公共接口====================================================================================================
#region 获取支付方式列表==================================================
/// <summary>
/// 获取支付方式列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetList()
{
var jm = new WebApiCallBack();
var list = await _paymentsServices.QueryListByClauseAsync(p => p.isEnable == true, p => p.sort, OrderByType.Asc);
jm.status = true;
jm.data = list;
return jm;
}
#endregion
//验证接口====================================================================================================
#region 支付确认页面取信息==================================================
/// <summary>
/// 支付确认页面取信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> CheckPay([FromBody] CheckPayPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.ids))
{
jm.msg = GlobalErrorCodeVars.Code13100;
return jm;
}
jm = await _billPaymentsServices.FormatPaymentRel(entity.ids, entity.paymentType, entity.@params);
return jm;
}
#endregion
#region 获取支付单详情==================================================
/// <summary>
/// 获取支付单详情
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetInfo([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.id))
{
jm.msg = GlobalErrorCodeVars.Code13100;
return jm;
}
var userId = entity.data.ObjectToInt(0);
jm = await _billPaymentsServices.GetInfo(entity.id, userId);
return jm;
}
#endregion
}
}
\ No newline at end of file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 拼团接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class PinTuanController : ControllerBase
{
private readonly IHttpContextUser _user;
private readonly ICoreCmsPinTuanGoodsServices _pinTuanGoodsServices;
private readonly ICoreCmsPinTuanRuleServices _pinTuanRuleServices;
private readonly ICoreCmsProductsServices _productsServices;
private readonly ICoreCmsPinTuanRecordServices _pinTuanRecordServices;
private readonly ICoreCmsGoodsServices _goodsServices;
/// <summary>
/// 构造函数
/// </summary>
public PinTuanController(IHttpContextUser user
, ICoreCmsPinTuanGoodsServices pinTuanGoodsServices
, ICoreCmsPinTuanRuleServices pinTuanRuleServices
, ICoreCmsProductsServices productsServices
, ICoreCmsPinTuanRecordServices pinTuanRecordServices, ICoreCmsGoodsServices goodsServices)
{
_user = user;
_pinTuanGoodsServices = pinTuanGoodsServices;
_pinTuanRuleServices = pinTuanRuleServices;
_productsServices = productsServices;
_pinTuanRecordServices = pinTuanRecordServices;
_goodsServices = goodsServices;
}
#region 拼团列表
/// <summary>
/// 拼团列表
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetList([FromBody] FMIntId entity)
{
WebApiCallBack jm;
var userId = 0;
if (_user != null)
{
userId = _user.ID;
}
var id = 0;
if (entity.id > 0)
{
id = entity.id;
}
jm = await _pinTuanRuleServices.GetPinTuanList(id, userId);
return jm;
}
#endregion
#region 获取拼团商品信息
/// <summary>
/// 获取拼团商品信息
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetGoodsInfo([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var userId = 0;
if (_user != null)
{
userId = _user.ID;
}
var pinTuanStatus = entity.data.ObjectToInt(1);
jm.status = true;
jm.msg = "获取详情成功";
jm.data = await _pinTuanGoodsServices.GetGoodsInfo(entity.id, userId, pinTuanStatus);
return jm;
}
#endregion
#region 获取货品信息
/// <summary>
/// 获取货品信息
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetProductInfo([FromBody] FMGetProductInfo entity)
{
var jm = new WebApiCallBack();
var products = await _productsServices.GetProductInfo(entity.id, false, 0, entity.type);
if (products == null)
{
jm.msg = GlobalErrorCodeVars.Code10000;
return jm;
}
//把拼团的一些属性等加上
var info = await _pinTuanRuleServices.QueryMuchFirstAsync<CoreCmsPinTuanRule, CoreCmsPinTuanGoods, CoreCmsPinTuanRule>(
(join1, join2) => new object[] { JoinType.Left, join1.id == join2.ruleId },
(join1, join2) => join1, (join1, join2) => join2.goodsId == products.goodsId);
if (info == null)
{
jm.msg = GlobalErrorCodeVars.Code10000;
return jm;
}
products.pinTuanRule = info;
jm.status = true;
jm.data = products;
return jm;
}
#endregion
#region 根据订单id取拼团信息,用在订单详情页
/// <summary>
/// 根据订单id取拼团信息,用在订单详情页
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetPinTuanTeam([FromBody] FMGetPinTuanTeamPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.orderId) && entity.teamId == 0)
{
jm.msg = GlobalErrorCodeVars.Code15606;
return jm;
}
jm = await _pinTuanRecordServices.GetTeamList(entity.teamId, entity.orderId);
return jm;
}
#endregion
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 服务卡控制器
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class ServiceController : ControllerBase
{
private readonly ICoreCmsServicesServices _servicesServices;
private readonly ICoreCmsUserServicesOrderServices _userServicesOrderServices;
private readonly ICoreCmsUserServicesTicketServices _userServicesTicketServices;
private readonly ICoreCmsUserServices _userServices;
private readonly ICoreCmsUserServicesTicketVerificationLogServices _ticketVerificationLogServices;
private readonly ICoreCmsClerkServices _clerkServices;
private readonly ICoreCmsStoreServices _storeServices;
private readonly ICoreCmsUserGradeServices _userGradeServices;
private readonly IHttpContextUser _user;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="servicesServices"></param>
/// <param name="user"></param>
/// <param name="userServicesOrderServices"></param>
/// <param name="userServicesTicketServices"></param>
/// <param name="userServices"></param>
/// <param name="clerkServices"></param>
/// <param name="ticketVerificationLogServices"></param>
/// <param name="storeServices"></param>
/// <param name="userGradeServices"></param>
public ServiceController(ICoreCmsServicesServices servicesServices, IHttpContextUser user, ICoreCmsUserServicesOrderServices userServicesOrderServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices, ICoreCmsUserServicesTicketVerificationLogServices ticketVerificationLogServices, ICoreCmsStoreServices storeServices, ICoreCmsUserGradeServices userGradeServices)
{
_servicesServices = servicesServices;
_user = user;
_userServicesOrderServices = userServicesOrderServices;
_userServicesTicketServices = userServicesTicketServices;
_userServices = userServices;
_clerkServices = clerkServices;
_ticketVerificationLogServices = ticketVerificationLogServices;
_storeServices = storeServices;
_userGradeServices = userGradeServices;
}
#region 取得服务卡列表信息
/// <summary>
/// 取得服务卡列表信息
/// </summary>
/// <returns></returns>
[HttpPost]
//[Authorize]
public async Task<WebApiCallBack> GetPageList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var dt = DateTime.Now;
var where = PredicateBuilder.True<CoreCmsServices>();
where = where.And(p => p.status == (int)GlobalEnumVars.ServicesStatus.Shelve);
where = where.And(p => p.amount > 0);
where = where.And(p => p.startTime < dt && p.endTime > dt);
var list = await _servicesServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
if (list.Any())
{
var storesAll = await _storeServices.QueryAsync();
var userGradesAll = await _userGradeServices.QueryAsync();
foreach (var data in list)
{
TimeSpan ts = data.endTime.Subtract(dt);
data.timestamp = (int)ts.TotalSeconds;
if (!string.IsNullOrEmpty(data.consumableStore))
{
var consumableStoreStr = CommonHelper.GetCaptureInterceptedText(data.consumableStore, ",");
var consumableStoreIds = CommonHelper.StringToIntArray(consumableStoreStr);
if (consumableStoreIds.Any())
{
var stores = storesAll.Where(p => consumableStoreIds.Contains(p.id)).ToList();
data.consumableStores = stores.Select(p => p.storeName).ToList();
}
}
if (!string.IsNullOrEmpty(data.allowedMembership))
{
var allowedMembershipStr = CommonHelper.GetCaptureInterceptedText(data.allowedMembership, ",");
var allowedMembershipIds = CommonHelper.StringToIntArray(allowedMembershipStr);
if (allowedMembershipIds.Any())
{
var userGrades = userGradesAll.Where(p => allowedMembershipIds.Contains(p.id)).ToList();
data.allowedMemberships = userGrades.Select(p => p.title).ToList();
}
}
}
}
jm.status = true;
jm.data = new
{
list = list,
count = list.TotalCount,
};
return jm;
}
#endregion
#region 获取服务卡详情
/// <summary>
/// 获取服务卡详情
/// </summary>
/// <returns></returns>
[HttpPost]
//[Authorize]
public async Task<WebApiCallBack> GetDetails([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var data = await _servicesServices.QueryByClauseAsync(p => p.id == entity.id);
if (data != null)
{
var dt = DateTime.Now;
TimeSpan ts = data.endTime.Subtract(dt);
data.timestamp = (int)ts.TotalSeconds;
if (!string.IsNullOrEmpty(data.consumableStore))
{
var consumableStoreStr = CommonHelper.GetCaptureInterceptedText(data.consumableStore, ",");
var consumableStoreIds = CommonHelper.StringToIntArray(consumableStoreStr);
if (consumableStoreIds.Any())
{
var stores = await _storeServices.QueryListByClauseAsync(p => consumableStoreIds.Contains(p.id));
data.consumableStores = stores.Select(p => p.storeName).ToList();
}
}
if (!string.IsNullOrEmpty(data.allowedMembership))
{
var allowedMembershipStr = CommonHelper.GetCaptureInterceptedText(data.allowedMembership, ",");
var allowedMembershipIds = CommonHelper.StringToIntArray(allowedMembershipStr);
if (allowedMembershipIds.Any())
{
var userGrades = await _userGradeServices.QueryListByClauseAsync(p => allowedMembershipIds.Contains(p.id));
data.allowedMemberships = userGrades.Select(p => p.title).ToList();
}
}
}
jm.status = true;
jm.data = data;
return jm;
}
#endregion
//验证接口====================================================================================================
#region 添加服务订单
/// <summary>
/// 取得服务卡列表信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> AddServiceOrder([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var data = await _servicesServices.QueryByClauseAsync(p => p.id == entity.id);
if (data == null)
{
jm.msg = "服务数据获取失败";
return jm;
}
var user = await _userServices.QueryByIdAsync(_user.ID);
if (user == null)
{
jm.msg = "用户数据获取失败";
return jm;
}
if (!data.allowedMembership.Contains("," + user.grade + ","))
{
jm.msg = "您所在的用户级别不支持购买";
return jm;
}
var order = new CoreCmsUserServicesOrder();
order.serviceOrderId = CommonHelper.GetSerialNumberType((int)GlobalEnumVars.SerialNumberType.服务订单编号);
order.userId = _user.ID;
order.servicesId = entity.id;
order.isPay = false;
order.status = (int)GlobalEnumVars.ServicesOrderStatus.正常;
order.createTime = DateTime.Now;
var bl = await _userServicesOrderServices.InsertAsync(order) > 0;
jm.status = bl;
jm.data = order.serviceOrderId;
return jm;
}
#endregion
#region 店铺核销的服务券列表
/// <summary>
/// 店铺核销的服务券列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> VerificationPageList([FromBody] FMPageByIntId entity)
{
var jm = await _ticketVerificationLogServices.GetVerificationLogs(_user.ID, entity.page, entity.limit);
return jm;
}
#endregion
#region 软删除服务券核销单数据
/// <summary>
/// 软删除服务券核销单数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> LogDelete([FromBody] FMIntId entity)
{
var jm = await _ticketVerificationLogServices.LogDelete(entity.id, _user.ID);
return jm;
}
#endregion
#region 获取单个提货单详情
/// <summary>
/// 获取单个提货单详情
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetTicketInfo([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.id))
{
jm.msg = "请提交查询数据关键词";
return jm;
}
var ticket = await _userServicesTicketServices.QueryByClauseAsync(p => p.redeemCode == entity.id);
if (ticket == null)
{
jm.msg = "未查询到服务券";
return jm;
}
ticket.statusStr = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.ServicesTicketStatus>(ticket.status);
var service = await _servicesServices.QueryByClauseAsync(p => p.id == ticket.serviceId);
var serviceOrder =
await _userServicesOrderServices.QueryByClauseAsync(p => p.serviceOrderId == ticket.serviceOrderId);
jm.status = true;
jm.data = new
{
ticket,
service,
serviceOrder
};
return jm;
}
#endregion
#region 核销服务券
/// <summary>
/// 核销服务券
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> VerificationTicket([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.id))
{
jm.msg = "请提交查询数据关键词";
return jm;
}
var ticket = await _userServicesTicketServices.QueryByClauseAsync(p => p.redeemCode == entity.id);
if (ticket == null)
{
jm.msg = "未查询到服务券";
return jm;
}
if (ticket.status != (int)GlobalEnumVars.ServicesTicketStatus.Normal)
{
jm.msg = "服务券状态不支持核销";
return jm;
}
var service = await _servicesServices.QueryByIdAsync(ticket.serviceId);
if (service == null)
{
jm.msg = "服务项目获取失败";
return jm;
}
var user = await _userServices.QueryByIdAsync(_user.ID);
if (user == null)
{
jm.msg = "未获取到审核权限";
return jm;
}
var clerk = await _clerkServices.QueryByClauseAsync(p => p.userId == user.id);
if (clerk == null)
{
jm.msg = "非门店店员无权限核验";
return jm;
}
if (!service.consumableStore.Contains("," + clerk.storeId + ","))
{
jm.msg = "您所在的门店无权核销此券";
return jm;
}
//开始更新数据
var log = new CoreCmsUserServicesTicketVerificationLog
{
storeId = clerk.storeId,
verificationUserId = _user.ID,
ticketId = ticket.id,
ticketRedeemCode = ticket.redeemCode,
verificationTime = DateTime.Now,
serviceId = ticket.serviceId,
isDel = false
};
ticket.status = (int)GlobalEnumVars.ServicesTicketStatus.Verification;
ticket.verificationTime = DateTime.Now;
ticket.isVerification = true;
var up = await _userServicesTicketServices.UpdateAsync(ticket);
var bl = false;
if (up)
{
bl = await _ticketVerificationLogServices.InsertAsync(log) > 0;
}
jm.status = up && bl;
jm.msg = jm.status ? "核销成功" : "核销失败";
return jm;
}
#endregion
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 门店调用接口数据
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class StoreController : ControllerBase
{
private readonly IHttpContextUser _user;
private readonly ICoreCmsStoreServices _storeServices;
private readonly ICoreCmsClerkServices _clerkServices;
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsBillLadingServices _billLadingServices;
private readonly ICoreCmsOrderServices _orderServices;
/// <summary>
/// 构造函数
/// </summary>
public StoreController(IHttpContextUser user
, ICoreCmsStoreServices storeServices
, ICoreCmsClerkServices clerkServices
, ICoreCmsSettingServices settingServices
, ICoreCmsBillLadingServices billLadingServices, ICoreCmsOrderServices orderServices)
{
_user = user;
_storeServices = storeServices;
_clerkServices = clerkServices;
_settingServices = settingServices;
_billLadingServices = billLadingServices;
_orderServices = orderServices;
}
//公共接口======================================================================================================
#region 获取默认的门店
/// <summary>
/// 获取默认的门店
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetDefaultStore()
{
var jm = new WebApiCallBack();
var ship = await _storeServices.QueryByClauseAsync(p => p.isDefault == true);
jm.status = true;
jm.data = ship;
return jm;
}
#endregion
#region 获取门店列表数据
/// <summary>
/// 获取门店列表数据
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetStoreList([FromBody] FMGetStoreQueryPageByCoordinate entity)
{
var jm = new WebApiCallBack();
try
{
var where = PredicateBuilder.True<CoreCmsStore>();
if (!string.IsNullOrEmpty(entity.key))
{
where = where.And(p => p.storeName.Contains(entity.key));
}
jm.status = true;
var data = await _storeServices.QueryPageAsyncByCoordinate(where, p => p.distance, OrderByType.Asc, entity.page, entity.limit, entity.latitude, entity.longitude);
foreach (var item in data)
{
if (item.distance > 0)
{
if (item.distance > 1000)
{
item.distanceStr = Math.Round(item.distance / 1000, 2) + "km";
}
else
{
item.distanceStr = Math.Round(item.distance, 2) + "m";
}
}
else
{
item.distanceStr = "未知";
}
}
jm.data = data;
jm.otherData = new
{
totalCount = data.TotalCount,
totalPages = data.TotalPages,
};
}
catch (Exception e)
{
jm.msg = GlobalConstVars.DataHandleEx;
jm.data = e.ToString();
}
return jm;
}
#endregion
#region 获取推荐关键词
/// <summary>
/// 获取推荐关键词
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetRecommendKeys()
{
var jm = new WebApiCallBack();
var allConfigs = await _settingServices.GetConfigDictionaries();
var recommendKeysStr = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.RecommendKeys);
jm.status = true;
jm.msg = "获取成功";
jm.data = !string.IsNullOrEmpty(recommendKeysStr) ? recommendKeysStr.Split("|") : new string[] { };
return jm;
}
#endregion
#region 判断是否开启门店自提
/// <summary>
/// 判断是否开启门店自提
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetStoreSwitch()
{
var jm = new WebApiCallBack { status = true, msg = "获取成功" };
var allConfigs = await _settingServices.GetConfigDictionaries();
jm.data = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StoreSwitch).ObjectToInt(2); ;
return jm;
}
#endregion
#region 根据序列获取门店数据
/// <summary>
/// 根据序列获取门店数据
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetStoreById([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack
{
status = true,
msg = "获取成功",
data = await _storeServices.QueryByClauseAsync(p => p.id == entity.id)
};
return jm;
}
#endregion
//验证接口======================================================================================================
#region 判断访问用户是否是店员
/// <summary>
/// 判断访问用户是否是店员
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> IsClerk()
{
var jm = await _clerkServices.IsClerk(_user.ID);
return jm;
}
#endregion
#region 根据用户序列获取门店数据
/// <summary>
/// 根据用户序列获取门店数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetStoreByUserId()
{
var jm = new WebApiCallBack
{
status = true,
msg = "获取成功",
data = await _storeServices.GetStoreByUserId(_user.ID)
};
return jm;
}
#endregion
#region 获取个人订单列表
/// <summary>
/// 获取个人订单列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetOrderPageByMerchant([FromBody] GetOrderPageByMerchantPost entity)
{
var jm = new WebApiCallBack();
var store = await _storeServices.GetStoreByUserId(_user.ID);
if (store != null)
{
jm = await _orderServices.GetOrderPageByMerchant(entity.dateType, entity.date, entity.status, entity.storeId, entity.page, entity.limit);
}
else
{
jm.status = false;
jm.msg = "你不是店员";
}
return jm;
}
#endregion
#region 搜索订单
/// <summary>
/// 搜索订单
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetOrderPageByMerchantSearch([FromBody] GetOrderPageByMerchantSearcgPost entity)
{
var jm = new WebApiCallBack();
var store = await _storeServices.GetStoreByUserId(_user.ID);
if (store != null)
{
jm = await _orderServices.GetOrderPageByMerchantSearch(entity.keyword, entity.status, entity.receiptType, entity.storeId, entity.page, entity.limit);
}
else
{
jm.status = false;
jm.msg = "你不是店员";
}
return jm;
}
#endregion
#region 店铺提货单列表
/// <summary>
/// 店铺提货单列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> StoreLadingList([FromBody] FMPageByIntId entity)
{
var jm = await _billLadingServices.GetStoreLadingList(_user.ID, entity.page, entity.limit);
return jm;
}
#endregion
#region 删除提货单数据
/// <summary>
/// 删除提货单数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> LadingDelete([FromBody] FMStringId entity)
{
var jm = await _billLadingServices.LadingDelete(entity.id, _user.ID);
return jm;
}
#endregion
#region 获取单个提货单详情
/// <summary>
/// 获取单个提货单详情
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> LadingInfo([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.id))
{
jm.msg = "请提交查询数据关键词";
return jm;
}
jm = await _billLadingServices.GetInfo(entity.id, _user.ID);
return jm;
}
#endregion
#region 核销订单
/// <summary>
/// 核销订单
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Lading([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.id))
{
jm.msg = "请提交查询数据关键词";
return jm;
}
var array = entity.id.Split(",");
var result = await _billLadingServices.LadingOperating(array, _user.ID);
jm.status = result.code == 0;
jm.msg = result.msg;
return jm;
}
#endregion
}
}
\ No newline at end of file
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.Email;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 用户测试事件
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class TestController : ControllerBase
{
private readonly EmailSenderHelper _emailSender;//发邮件的服务
/// <summary>
/// 构造函数注入
/// </summary>
/// <param name="emailSender"></param>
public TestController(EmailSenderHelper emailSender)
{
_emailSender = emailSender;
}
#region 用户邮箱发送===================================================================
/// <summary>
/// 用户邮箱发送
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> SendEmail([FromBody] FMSendEmail entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.email))
{
jm.msg = "请输入合法的邮箱地址";
return jm;
}
//发送验证码, 发送邮件
Random rd = new Random();
int codeNumber = rd.Next(100000, 999999);
var message = new MailMessageModel()
{
ToAddresses = new List<string> { entity.email },
Subject = "邮箱验证码",
Body = $"""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>邮箱验证</title>
</head>
<body>
<div style="max-width: 600px; margin: 0 auto; font-family: Arial, sans-serif;">
<h2 style="color: #1e9fff;">邮箱验证请求</h2>
<p>您的验证码是:<strong style="font-size: 24px; letter-spacing: 2px;">
{codeNumber}
</strong></p>
<p>验证码将在30分钟后失效,请尽快使用。</p>
<hr style="border: 0; border-top: 1px solid #eee;">
<p style="color: #999; font-size: 12px;">此为系统邮件,请勿直接回复</p>
</div>
</body>
</html>
""",
IsBodyHtml = true
};
// 在应用启动代码前添加
System.Net.ServicePointManager.SecurityProtocol =
SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
await _emailSender.SendWithMailKitAsync(message);
return jm;
}
#endregion
}
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Auth.Policys;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Nito.AsyncEx;
using NLog;
using SKIT.FlurlHttpClient.Wechat.Api;
using SKIT.FlurlHttpClient.Wechat.Api.Models;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
{
/// <summary>
/// 用户操作事件
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class UserController : ControllerBase
{
private readonly ICoreCmsUserServices _userServices;
private readonly PermissionRequirement _permissionRequirement;
private readonly ICoreCmsSmsServices _smsServices;
private readonly ICoreCmsUserGradeServices _userGradeServices;
private readonly IHttpContextUser _user;
private readonly ICoreCmsUserLogServices _userLogServices;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ICoreCmsGoodsServices _goodsServices;
private readonly ICoreCmsGoodsBrowsingServices _goodsBrowsingServices;
private readonly ICoreCmsCartServices _cartServices;
private readonly ICoreCmsGoodsCollectionServices _goodsCollectionServices;
private readonly ICoreCmsUserShipServices _userShipServices;
private readonly ICoreCmsAreaServices _areaServices;
private readonly ICoreCmsBillPaymentsServices _billPaymentsServices;
private readonly ICoreCmsGoodsCommentServices _goodsCommentServices;
private readonly ICoreCmsUserBankCardServices _userBankCardServices;
private readonly ICoreCmsUserTocashServices _userTocashServices;
private readonly ICoreCmsUserBalanceServices _userBalanceServices;
private readonly ICoreCmsInvoiceServices _invoiceServices;
private readonly ICoreCmsUserPointLogServices _userPointLogServices;
private readonly ICoreCmsShareServices _shareServices;
private readonly ICoreCmsSettingServices _settingServices;
private readonly ICoreCmsServicesServices _servicesServices;
private readonly ICoreCmsUserServicesOrderServices _userServicesOrderServices;
private readonly ICoreCmsUserServicesTicketServices _userServicesTicketServices;
private readonly ICoreCmsStoreServices _storeServices;
private readonly ICoreCmsCouponServices _couponServices;
private readonly ICoreCmsOrderServices _orderServices;
private readonly AsyncLock _mutex = new AsyncLock();
/// <summary>
/// 构造函数
/// </summary>
public UserController(
IHttpContextUser user
, ICoreCmsUserServices userServices
, PermissionRequirement permissionRequirement
, ICoreCmsSmsServices smsServices
, ICoreCmsUserGradeServices userGradeServices
, ICoreCmsUserLogServices userLogServices
, IHttpContextAccessor httpContextAccessor
, ICoreCmsGoodsServices goodsServices
, ICoreCmsGoodsBrowsingServices goodsBrowsingServices
, ICoreCmsCartServices cartServices
, ICoreCmsGoodsCollectionServices goodsCollectionServices
, ICoreCmsUserShipServices userShipServices
, ICoreCmsAreaServices areaServices
, ICoreCmsBillPaymentsServices billPaymentsServices
, ICoreCmsGoodsCommentServices goodsCommentServices
, ICoreCmsUserBankCardServices userBankCardServices
, ICoreCmsUserTocashServices userTocashServices
, ICoreCmsUserBalanceServices userBalanceServices
, ICoreCmsInvoiceServices invoiceServices
, ICoreCmsUserPointLogServices userPointLogServices
, ICoreCmsShareServices shareServices
, ICoreCmsSettingServices settingServices
, ICoreCmsServicesServices servicesServices
, ICoreCmsUserServicesOrderServices userServicesOrderServices, ICoreCmsUserServicesTicketServices userServicesTicketServices, ICoreCmsStoreServices storeServices, ICoreCmsCouponServices couponServices, ICoreCmsOrderServices orderServices)
{
_user = user;
_userServices = userServices;
_permissionRequirement = permissionRequirement;
_smsServices = smsServices;
_userGradeServices = userGradeServices;
_userLogServices = userLogServices;
_httpContextAccessor = httpContextAccessor;
_goodsServices = goodsServices;
_goodsBrowsingServices = goodsBrowsingServices;
_cartServices = cartServices;
_goodsCollectionServices = goodsCollectionServices;
_userShipServices = userShipServices;
_areaServices = areaServices;
_billPaymentsServices = billPaymentsServices;
_goodsCommentServices = goodsCommentServices;
_userBankCardServices = userBankCardServices;
_userTocashServices = userTocashServices;
_userBalanceServices = userBalanceServices;
_invoiceServices = invoiceServices;
_userPointLogServices = userPointLogServices;
_shareServices = shareServices;
_settingServices = settingServices;
_servicesServices = servicesServices;
_userServicesOrderServices = userServicesOrderServices;
_userServicesTicketServices = userServicesTicketServices;
_storeServices = storeServices;
_couponServices = couponServices;
_orderServices = orderServices;
}
#region 用户短信发送===================================================================
/// <summary>
/// 用户短信发送
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> SendSms([FromBody] FMWxSendSMS entity)
{
var jm = new WebApiCallBack();
if (!CommonHelper.IsMobile(entity.mobile))
{
jm.msg = "请输入合法的手机号码";
return jm;
}
if (entity.code == "login")
{
var shave = await _userServices.ExistsAsync(p => p.mobile == entity.mobile && p.userWx > 0);
if (shave)
{
jm.msg = "手机号码已被绑定,请更换";
return jm;
}
}
jm = await _smsServices.DoSendSms(entity.code, entity.mobile);
return jm;
}
#endregion
#region 手机短信验证码登陆,同时兼有手机短信注册的功能,还有第三方账户绑定的功能======================================================
/// <summary>
/// 手机短信验证码登陆,同时兼有手机短信注册的功能,还有第三方账户绑定的功能
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> SmsLogin([FromBody] FMWxAccountCreate entity)
{
var jm = await _userServices.SmsLogin(entity, 2, entity.platform);
return jm;
}
#endregion
#region 获取区域ID
/// <summary>
/// 获取区域ID
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetAreaId([FromBody] GetAreaIdPost entity)
{
var jm = await _areaServices.GetAreaId(entity.provinceName, entity.cityName, entity.countyName, entity.postalCode);
return jm;
}
#endregion
#region 注销登录
/// <summary>
/// 注销登录
/// </summary>
/// <returns></returns>
[HttpPost]
public WebApiCallBack LogOut()
{
var jm = new WebApiCallBack
{
status = true,
data = new
{
token = "", //直接前端删除token-无为而治
}
};
return jm;
}
#endregion
#region 判断是否开启积分
/// <summary>
/// 判断是否开启积分
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> IsPoint()
{
var jm = new WebApiCallBack { status = true, msg = "获取成功" };
var allConfigs = await _settingServices.GetConfigDictionaries();
jm.data = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointSwitch).ObjectToInt(2);
return jm;
}
#endregion
#region 统一分享url处理
/// <summary>
/// 统一分享url处理
/// 新的分享,不管是二维码,还是地址,都走这个
/// page 场景值 1店铺首页,2商品详情页,3拼团详情页,4邀请好友(店铺页面,params里需要传store),5文章页面,6参团页面,7自定义页面,8智能表单,9团购,10秒杀,11代理
/// url:前端地址
/// params:参数,根据场景值不一样而内容不一样
/// 1
/// 2 goodsId:商品ID
/// 3 goodsId:商品ID,teamId:拼团ID
/// 4 store:店铺code
/// 5 articleId:文章ID,articleType:文章类型
/// 6 goodsId:商品ID,groupId:参团ID,teamId:拼团ID
/// 7 pageCode:自定义页面code
/// 8 id:智能表单ID
/// 9 goodsId:商品ID,groupId:团购秒杀ID
/// type 类型,1url,2二维码,3海报
/// token 可以保存推荐人的信息
/// client 终端,1普通h5,2微信小程序,3微信公众号(h5),4头条系小程序,5pc,6阿里小程序
/// 10 store:店铺code
/// </summary>
/// <param name="entity"></param>
/// <returns>array</returns>
[HttpPost]
public async Task<WebApiCallBack> Share([FromBody] FMShare entity)
{
var jm = new WebApiCallBack();
var userShareCode = 0;
if (_user != null && _user.ID > 0)
{
userShareCode = UserHelper.GetShareCodeByUserId(_user.ID);
}
if (entity.type == (int)GlobalEnumVars.ShareType.Url) //链接分享
{
jm = _shareServices.UrlShare(entity.client, entity.page, userShareCode, entity.url, entity.@params);
}
else if (entity.type == (int)GlobalEnumVars.ShareType.QrCode) //二维码
{
jm = await _shareServices.QrShare(entity.client, entity.page, userShareCode, entity.url, entity.@params);
}
else if (entity.type == (int)GlobalEnumVars.ShareType.Poster) //海报
{
jm = await _shareServices.PosterShare(entity.client, entity.page, userShareCode, entity.url, entity.@params);
}
return jm;
}
#endregion
#region 统一分享解码
/// <summary>
/// 统一分享解码
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public WebApiCallBack DeShare([FromBody] FMDeShare entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.code))
{
jm.msg = GlobalErrorCodeVars.Code10000;
}
jm = _shareServices.de_url(entity.code);
return jm;
}
#endregion
#region 获取用户信息
/// <summary>
/// 获取用户信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetUserInfo()
{
var jm = new WebApiCallBack() { status = true };
var user = await _userServices.QueryByIdAsync(_user.ID);
if (user == null)
{
jm.status = false;
jm.msg = "用户信息获取失败";
jm.code = 14007;
return jm;
}
//获取用户等级
var userGrade = await _userGradeServices.QueryByClauseAsync(p => p.id == user.grade);
//获取优惠券
var userCouponCount = await _couponServices.GetMyCouponCount(user.id);
//订单数量
var orderCount = await _orderServices.OrderCount(0, user.id);
//足迹
var footPrintCount = await _goodsBrowsingServices.GetCountAsync(p => p.userId == user.id);
//收藏
var collectionCount = await _goodsCollectionServices.GetCountAsync(p => p.userId == user.id);
jm.data = new
{
user.id,
user.userName,
user.mobile,
user.sex,
user.birthday,
user.avatarImage,
user.nickName,
user.balance,
user.point,
user.grade,
user.createTime,
user.updataTime,
user.status,
user.parentId,
user.passWord,
gradeName = userGrade != null ? userGrade.title : "",
userCouponCount,
orderCount,
footPrintCount,
collectionCount
};
return jm;
}
#endregion
#region 获取购物车商品数量
/// <summary>
/// 获取购物车商品数量
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetCartNumber()
{
var jm = new WebApiCallBack();
var count = await _cartServices.GetCountAsync(_user.ID);
jm.status = true;
jm.msg = jm.status ? GlobalConstVars.GetDataSuccess : GlobalConstVars.GetDataFailure;
jm.data = count;
return jm;
}
#endregion
#region 商品取消/添加收藏
/// <summary>
/// 商品取消/添加收藏
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GoodsCollectionCreateOrDelete([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var collection = await _goodsCollectionServices.QueryByClauseAsync(p => p.goodsId == entity.id && p.userId == _user.ID);
if (collection == null)
{
var goods = await _goodsServices.QueryByIdAsync(entity.id);
if (goods == null)
{
jm.msg = GlobalErrorCodeVars.Code17001;
return jm;
}
collection = new CoreCmsGoodsCollection()
{
goodsId = goods.id,
userId = _user.ID,
goodsName = goods.name,
createTime = DateTime.Now,
};
await _goodsCollectionServices.InsertAsync(collection);
jm.msg = GlobalErrorCodeVars.Code17002;
}
else
{
await _goodsCollectionServices.DeleteAsync(collection);
jm.msg = GlobalErrorCodeVars.Code17003;
}
jm.status = true;
return jm;
}
#endregion
#region 获取用户获取用户默认收货地址
/// <summary>
/// 获取用户获取用户默认收货地址
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetUserDefaultShip()
{
var jm = new WebApiCallBack();
var ship = await _userShipServices.QueryByClauseAsync(p => p.isDefault && p.userId == _user.ID) ?? await _userShipServices.QueryByClauseAsync(p => p.userId == _user.ID, p => p.id, OrderByType.Desc);
if (ship != null)
{
var fullName = await _areaServices.GetAreaFullName(ship.areaId);
if (fullName.status)
{
ship.areaName = fullName.data.ToString();
}
}
jm.status = true;
jm.data = ship;
return jm;
}
#endregion
#region 设置默认地址
/// <summary>
/// 设置默认地址
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> SetDefShip([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var ship = await _userShipServices.QueryByClauseAsync(p => p.id == entity.id && p.userId == _user.ID);
if (ship != null)
{
//没有默认的直接设置为默认
ship.isDefault = true;
var result = await _userShipServices.UpdateAsync(ship);
jm.status = result.code == 0;
jm.msg = jm.status ? "保存成功" : "保存失败";
}
else
{
jm.msg = "该地址不存在";
}
return jm;
}
#endregion
#region 判断用户下单可以使用多少积分
/// <summary>
/// 判断用户下单可以使用多少积分
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetUserPoint([FromBody] GetUserPointPost entity)
{
var jm = new WebApiCallBack();
var ship = await _userServices.GetUserPoint(_user.ID, entity.orderMoney);
jm.status = true;
jm.data = ship;
return jm;
}
#endregion
#region 获取用户的收货地址列表
/// <summary>
/// 获取用户的收货地址列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetUserShip()
{
var jm = new WebApiCallBack();
var ship = await _userShipServices.QueryListByClauseAsync(p => p.userId == _user.ID, p => p.isDefault, OrderByType.Desc);
if (ship.Any())
{
ship.ForEach(Action);
}
jm.status = true;
jm.data = ship;
return jm;
}
private async void Action(CoreCmsUserShip p)
{
var fullName = await _areaServices.GetAreaFullName(p.areaId);
if (fullName.status)
{
p.areaName = fullName.data.ToString();
}
}
#endregion
#region 保存用户地址
/// <summary>
/// 保存用户地址
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> SaveUserShip([FromBody] SaveUserShipPost entity)
{
var jm = new WebApiCallBack();
if (entity.id > 0)
{
//判断是否存在默认数据
if (entity.isDefault != 1)
{
if (await _userShipServices.ExistsAsync(p => p.userId == _user.ID && p.isDefault == true && p.id != entity.id) == false) entity.isDefault = 1;
}
var userShip = new CoreCmsUserShip();
userShip.id = entity.id;
userShip.userId = _user.ID;
userShip.areaId = entity.areaId;
userShip.isDefault = entity.isDefault == 1;
userShip.name = entity.name;
userShip.address = entity.address;
userShip.mobile = entity.mobile;
userShip.updateTime = DateTime.Now;
var ship = await _userShipServices.UpdateAsync(userShip);
jm.status = true;
jm.data = ship;
jm.msg = "地址保存成功";
}
else
{
//判断是否存在默认数据
if (entity.isDefault != 1)
{
if (await _userShipServices.ExistsAsync(p => p.userId == _user.ID && p.isDefault == true) == false) entity.isDefault = 1;
}
var userShip = new CoreCmsUserShip();
userShip.userId = _user.ID;
userShip.areaId = entity.areaId;
userShip.isDefault = entity.isDefault == 1;
userShip.name = entity.name;
userShip.address = entity.address;
userShip.mobile = entity.mobile;
userShip.createTime = DateTime.Now;
var ship = await _userShipServices.InsertAsync(userShip);
jm.status = true;
jm.data = ship;
jm.msg = "地址保存成功";
}
return jm;
}
#endregion
#region 获取用户单个地址详情
/// <summary>
/// 获取用户单个地址详情
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetShipDetail([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
var ship = await _userShipServices.QueryByClauseAsync(p => p.userId == _user.ID && p.id == entity.id);
if (ship != null)
{
//var areas = _areaServices.FindListAsync();
var fullName = await _areaServices.GetAreaFullName(ship.areaId);
if (fullName.status)
{
ship.areaName = fullName.data.ToString();
}
}
jm.status = true;
jm.data = ship;
return jm;
}
#endregion
#region 收货地址删除
/// <summary>
/// 收货地址删除
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> RemoveShip([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
jm.status = await _userShipServices.DeleteAsync(p => p.userId == _user.ID && p.id == entity.id);
jm.msg = jm.status ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
if (jm.status)
{
//如果只有一个地址了,默认将最后一个剩余的地址设置为默认。
var anySum = await _userShipServices.GetCountAsync(p => p.userId == _user.ID);
if (anySum == 1)
{
await _userShipServices.UpdateAsync(p => new CoreCmsUserShip() { isDefault = true }, p => p.userId == _user.ID);
}
}
return jm;
}
#endregion
#region 支付
/// <summary>
/// 支付
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Pay([FromBody] PayPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.ids))
{
jm.code = 13100;
jm.msg = GlobalErrorCodeVars.Code13100;
}
else if (string.IsNullOrEmpty(entity.payment_code))
{
jm.code = 10055;
jm.msg = GlobalErrorCodeVars.Code10055;
}
else if (entity.payment_type == 0)
{
jm.code = 10051;
jm.msg = GlobalErrorCodeVars.Code10051;
}
//生成支付单,并发起支付
jm = await _billPaymentsServices.Pay(entity.ids, entity.payment_code, _user.ID, entity.payment_type,
entity.@params);
return jm;
}
#endregion
#region 订单评价
/// <summary>
/// 订单评价
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> OrderEvaluate([FromBody] OrderEvaluatePost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.orderId))
{
jm.code = 13100;
jm.msg = GlobalErrorCodeVars.Code13100;
}
else if (entity.items == null || entity.items.Count == 0)
{
jm.code = 10051;
jm.msg = GlobalErrorCodeVars.Code10051;
}
jm = await _goodsCommentServices.AddComment(entity.orderId, entity.items, _user.ID);
jm.otherData = entity;
return jm;
}
#endregion
#region 我的银行卡列表
/// <summary>
/// 我的银行卡列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetMyBankcardsList()
{
var jm = await _userBankCardServices.GetMyBankcardsList(_user.ID);
return jm;
}
#endregion
#region 添加银行卡
/// <summary>
/// 添加银行卡
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> AddBankCards([FromBody] CoreCmsUserBankCard entity)
{
entity.userId = _user.ID;
var jm = await _userBankCardServices.AddBankCards(entity);
return jm;
}
#endregion
#region 设置默认银行卡
/// <summary>
/// 设置默认银行卡
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> SetDefaultBankCard([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
if (entity.id == 0)
{
jm.msg = GlobalErrorCodeVars.Code10051;
return jm;
}
jm = await _userBankCardServices.SetDefault(_user.ID, entity.id);
return jm;
}
#endregion
#region 获取银行卡信息
/// <summary>
/// 获取银行卡信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetBankCardInfo([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
if (entity.id == 0)
{
jm.msg = GlobalErrorCodeVars.Code10051;
return jm;
}
jm = await _userBankCardServices.GetBankcardInfo(_user.ID, entity.id);
return jm;
}
#endregion
#region 获取用户默认银行卡信息
/// <summary>
/// 获取用户默认银行卡信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetDefaultBankCard()
{
var jm = await _userBankCardServices.GetDefaultBankCard(_user.ID);
return jm;
}
#endregion
#region 删除银行卡信息
/// <summary>
/// 删除银行卡信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Removebankcard([FromBody] FMIntId entity)
{
var jm = await _userBankCardServices.Removebankcard(entity.id, _user.ID);
return jm;
}
#endregion
#region 获取银行卡组织信息
/// <summary>
/// 获取银行卡组织信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public WebApiCallBack GetBankCardsOrganization([FromBody] FMStringId entity)
{
var jm = _userBankCardServices.BankCardsOrganization(entity.id);
return jm;
}
#endregion
#region 提现申请
/// <summary>
/// 提现申请
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Cash([FromBody] FMIntId entity)
{
var money = entity.data.ObjectToDecimal(0);
var jm = await _userTocashServices.Tocash(_user.ID, money, entity.id);
return jm;
}
#endregion
#region 提现记录列表
/// <summary>
/// 提现记录列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> CashList([FromBody] FMPageByIntId entity)
{
var jm = await _userTocashServices.UserToCashList(_user.ID, entity.page, entity.limit, entity.id);
return jm;
}
#endregion
#region 获取我的余额明细列表
/// <summary>
/// 获取我的余额明细列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> UserBalance([FromBody] FMGetBalancePost entity)
{
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsUserBalance>();
where = where.And(p => p.userId == _user.ID);
if (entity.id > 0)
{
where = where.And(p => p.type == entity.id);
}
if (!string.IsNullOrEmpty(entity.propsDate))
{
if (entity.propsDate.Contains("-"))
{
var dts = entity.propsDate.Split("-");
if (dts.Length == 2)
{
var dt = dts[0].ObjectToDate(DateTime.Now);
var startTime = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0);
var dt2 = dts[1].ObjectToDate(DateTime.Now);
var endTime = new DateTime(dt2.Year, dt2.Month, dt2.Day, 23, 59, 59);
where = where.And(p => p.createTime > startTime && p.createTime < endTime);
}
}
else
{
var dt = entity.propsDate.ObjectToDate(DateTime.Now);
var startTime = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0);
var endTime = new DateTime(dt.Year, dt.Month, dt.Day, 23, 59, 59);
where = where.And(p => p.createTime > startTime && p.createTime < endTime);
}
}
var data = await _userBalanceServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
if (data.Any())
{
foreach (var item in data)
{
item.typeName = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.UserBalanceSourceTypes>(item.type);
}
}
var sunMoney = await _userBalanceServices.GetSumAsync(where, p => p.money);
jm.status = true;
jm.data = data;
jm.otherData = new
{
data.TotalPages,
sunMoney
};
return jm;
}
#endregion
#region 我的发票列表
/// <summary>
/// 我的发票列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> UserInvoiceList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsInvoice>();
where = where.And(p => p.userId == _user.ID);
if (entity.id > 0)
{
where = where.And(p => p.id == entity.id);
}
var status = entity.otherData.ObjectToInt(0);
if (status > 0)
{
where = where.And(p => p.status == status);
}
var data = await _invoiceServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
if (data.Any())
{
foreach (var item in data)
{
item.categoryName = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.OrderTaxCategory>(item.category);
item.typeName = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.OrderTaxType>(item.type);
item.statusName = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.OrderTaxStatus>(item.status);
}
}
jm.status = true;
jm.data = data;
jm.otherData = new
{
data.TotalCount,
data.TotalPages
};
return jm;
}
#endregion
#region 我的积分列表
/// <summary>
/// 我的积分列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> UserPointLog([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsUserPointLog>();
where = where.And(p => p.userId == _user.ID);
var data = await _userPointLogServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
if (data.Any())
{
foreach (var item in data)
{
item.typeName = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.UserPointSourceTypes>(item.type);
}
}
jm.status = true;
jm.data = data;
jm.otherData = new
{
data.TotalCount,
data.TotalPages
};
return jm;
}
#endregion
#region 取得商品收藏记录(关注)
/// <summary>
/// 取得商品收藏记录(关注)
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GoodsCollectionList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var data = await _goodsCollectionServices.QueryPageAsync(p => p.userId == _user.ID, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
jm.status = true;
jm.data = new
{
list = data,
count = data.TotalCount,
};
return jm;
}
#endregion
#region 添加商品收藏(关注)
/// <summary>
/// 添加商品收藏(关注)
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GoodsCollection([FromBody] FMIntId entity)
{
var jm = await _goodsCollectionServices.ToAdd(_user.ID, entity.id);
return jm;
}
#endregion
#region 取得商品浏览足迹
/// <summary>
/// 取得商品浏览足迹
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Goodsbrowsing([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var data = await _goodsBrowsingServices.QueryPageAsync(p => p.userId == _user.ID, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
jm.status = true;
jm.data = new
{
list = data,
count = data.TotalCount,
};
return jm;
}
#endregion
#region 添加商品浏览足迹
/// <summary>
/// 添加商品浏览足迹
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> AddGoodsBrowsing([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
//获取数据
var goods = await _goodsServices.QueryByIdAsync(entity.id);
if (goods == null)
{
jm.msg = GlobalConstVars.DataisNo;
return jm;
}
var goodsBrowsing = new CoreCmsGoodsBrowsing
{
goodsId = goods.id,
userId = _user.ID,
goodsName = goods.name,
createTime = DateTime.Now,
isdel = false
};
jm.status = await _goodsBrowsingServices.InsertAsync(goodsBrowsing) > 0;
jm.msg = jm.status ? GlobalConstVars.InsertSuccess : GlobalConstVars.InsertFailure;
return jm;
}
#endregion
#region 删除商品浏览足迹
/// <summary>
/// 删除商品浏览足迹
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> DelGoodsBrowsing([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
jm.status = await _goodsBrowsingServices.DeleteAsync(p => p.userId == _user.ID && p.goodsId == entity.id);
jm.msg = jm.status ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
#endregion
#region 更换头像
/// <summary>
/// 更换头像
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> ChangeAvatar([FromBody] FMStringId entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.id))
{
jm.data = GlobalErrorCodeVars.Code11003;
return jm;
}
var up = await _userServices.UpdateAsync(p => new CoreCmsUser() { avatarImage = entity.id },
p => p.id == _user.ID);
jm.status = up;
jm.msg = jm.status ? "设置头像成功" : "设置头像失败";
jm.data = entity.id;
return jm;
}
#endregion
#region 编辑用户信息
/// <summary>
/// 编辑用户信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> EditInfo([FromBody] EditInfoPost entity)
{
var jm = new WebApiCallBack();
if (entity.birthday == null)
{
jm.msg = GlobalErrorCodeVars.Code11027;
return jm;
}
if (string.IsNullOrEmpty(entity.nickname))
{
jm.msg = GlobalErrorCodeVars.Code11028;
return jm;
}
if (entity.sex <= 0)
{
jm.msg = GlobalErrorCodeVars.Code11029;
return jm;
}
var up = await _userServices.UpdateAsync(p => new CoreCmsUser() { birthday = entity.birthday, nickName = entity.nickname, sex = entity.sex },
p => p.id == _user.ID);
jm.status = up;
jm.msg = jm.status ? "资料保存成功" : "资料保存失败";
return jm;
}
#endregion
#region 修改用户密码
/// <summary>
/// 修改用户密码
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> EditPwd([FromBody] EditPwdPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.repwd))
{
jm.msg = GlobalErrorCodeVars.Code11014;
return jm;
}
if (string.IsNullOrEmpty(entity.newpwd))
{
jm.msg = GlobalErrorCodeVars.Code11013;
return jm;
}
if (entity.repwd != entity.newpwd)
{
jm.msg = GlobalErrorCodeVars.Code11025;
return jm;
}
jm = await _userServices.ChangePassword(_user.ID, entity.newpwd, entity.pwd);
return jm;
}
#endregion
#region 邀请好友(获取我的要求相关信息)
/// <summary>
/// 邀请好友(获取我的要求相关信息)
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> MyInvite()
{
var jm = new WebApiCallBack();
jm.status = true;
//我的邀请码
var code = UserHelper.GetShareCodeByUserId(_user.ID);
//我邀请的人数
var number = await _userServices.GetCountAsync(p => p.parentId == _user.ID);
//邀请赚的佣金
var money = await _userBalanceServices.GetInviteCommission(_user.ID);
//是否有上级
var userInfo = await _userServices.QueryByIdAsync(_user.ID);
bool isSuperior = userInfo != null && userInfo.parentId > 0;
jm.data = new
{
code,
number,
money,
isSuperior
};
return jm;
}
#endregion
#region 设置我的上级邀请人
/// <summary>
/// 设置我的上级邀请人
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> SetMyInvite([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack();
if (entity.id == 0)
{
jm.msg = "请输入推荐人邀请码!";
return jm;
}
var code = UserHelper.GetUserIdByShareCode(entity.id);
jm = await _userServices.SetMyInvite(code, _user.ID);
return jm;
}
#endregion
#region 获取我的上级邀请人
/// <summary>
/// 获取我的上级邀请人
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetMyInvite()
{
return await _userServices.GetMyInvite(_user.ID);
}
#endregion
#region 获取我的下级用户数量
/// <summary>
/// 获取我的下级用户数量
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetMyChildSum()
{
var jm = new WebApiCallBack();
var first = await _userServices.QueryChildCountAsync(_user.ID);
var second = await _userServices.QueryChildCountAsync(_user.ID, 2);
var monthFirst = await _userServices.QueryChildCountAsync(_user.ID, 1, true);
var monthSecond = await _userServices.QueryChildCountAsync(_user.ID, 2, true);
jm.status = true;
jm.data = new
{
count = first + second,
first,
second,
monthCount = monthFirst + monthSecond,
monthFirst,
monthSecond
};
return jm;
}
#endregion
#region 获取用户推荐列表
/// <summary>
/// 获取用户推荐列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Recommend([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsUser>();
where = where.And(p => p.parentId == _user.ID);
var data = await _userServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
jm.status = true;
jm.data = data.Select(p => new
{
p.nickName,
p.avatarImage,
mobile = UserHelper.FormatMobile(p.mobile),
p.createTime,
p.childNum
});
jm.otherData = new
{
data.TotalCount,
data.TotalPages
};
return jm;
}
#endregion
#region 获取用户邀请码
/// <summary>
/// 获取用户邀请码
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public WebApiCallBack ShareCode()
{
var jm = new WebApiCallBack();
jm.status = true;
jm.data = UserHelper.GetShareCodeByUserId(_user.ID);
return jm;
}
#endregion
#region 判断是否签到
/// <summary>
/// 判断是否签到
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> IsSign()
{
var jm = await _userPointLogServices.IsSign(_user.ID);
return jm;
}
#endregion
#region 用户签到
/// <summary>
/// 用户签到
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> Sign()
{
var jm = await _userPointLogServices.Sign(_user.ID);
return jm;
}
#endregion
#region 用户找回密码
/// <summary>
/// 用户找回密码
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> ForgetPwd([FromBody] FMForgetPwdPost entity)
{
var jm = new WebApiCallBack();
if (string.IsNullOrEmpty(entity.mobile))
{
jm.msg = GlobalErrorCodeVars.Code10051;
return jm;
}
if (string.IsNullOrEmpty(entity.code))
{
jm.msg = GlobalErrorCodeVars.Code10013;
return jm;
}
if (string.IsNullOrEmpty(entity.newpwd))
{
jm.msg = GlobalErrorCodeVars.Code11013;
return jm;
}
if (string.IsNullOrEmpty(entity.repwd))
{
jm.msg = GlobalErrorCodeVars.Code11014;
return jm;
}
if (entity.newpwd != entity.repwd)
{
jm.msg = GlobalErrorCodeVars.Code11025;
return jm;
}
jm = await _userServices.ForgetPassword(entity.mobile, entity.code, entity.newpwd);
return jm;
}
#endregion
#region 取得服务卡列表信息
/// <summary>
/// 取得服务卡列表信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetServicesPageList([FromBody] FMPageByIntId entity)
{
var jm = new WebApiCallBack();
var where = PredicateBuilder.True<CoreCmsUserServicesOrder>();
//where = where.And(p => p.status == (int)GlobalEnumVars.ServicesStatus.Shelve);
where = where.And(p => p.userId == _user.ID);
where = where.And(p => p.isPay == true);
var orders = await _userServicesOrderServices.QueryPageAsync(where, p => p.payTime, OrderByType.Desc, entity.page, entity.limit);
if (orders.Any())
{
var services = await _servicesServices.QueryAsync();
foreach (var item in orders)
{
item.service = services.Find(p => p.id == item.servicesId);
item.statusStr =
EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.ServicesOrderStatus>(item.status);
}
}
jm.status = true;
jm.data = new
{
list = orders,
count = orders.TotalCount,
};
return jm;
}
#endregion
#region 取得服务卡列表信息
/// <summary>
/// 取得服务卡列表信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> GetServicesTickets([FromBody] FMPageByStringId entity)
{
var jm = new WebApiCallBack();
var order = await _userServicesOrderServices.QueryByClauseAsync(p => p.serviceOrderId == entity.id);
if (order == null)
{
jm.msg = "订单信息获取失败";
return jm;
}
var model = await _servicesServices.QueryByClauseAsync(p => p.id == order.servicesId);
if (model != null)
{
var dt = DateTime.Now;
TimeSpan ts = model.endTime.Subtract(dt);
model.timestamp = (int)ts.TotalSeconds;
if (!string.IsNullOrEmpty(model.consumableStore))
{
var consumableStoreStr = CommonHelper.GetCaptureInterceptedText(model.consumableStore, ",");
var consumableStoreIds = CommonHelper.StringToIntArray(consumableStoreStr);
if (consumableStoreIds.Any())
{
var stores = await _storeServices.QueryListByClauseAsync(p => consumableStoreIds.Contains(p.id));
model.consumableStores = stores.Select(p => p.storeName).ToList();
}
}
if (!string.IsNullOrEmpty(model.allowedMembership))
{
var allowedMembershipStr = CommonHelper.GetCaptureInterceptedText(model.allowedMembership, ",");
var allowedMembershipIds = CommonHelper.StringToIntArray(allowedMembershipStr);
if (allowedMembershipIds.Any())
{
var userGrades = await _userGradeServices.QueryListByClauseAsync(p => allowedMembershipIds.Contains(p.id));
model.allowedMemberships = userGrades.Select(p => p.title).ToList();
}
}
}
var orders = await _userServicesTicketServices.QueryPageAsync(p => p.serviceOrderId == entity.id, p => p.createTime, OrderByType.Asc, entity.page, entity.limit);
if (orders.Any())
{
foreach (var item in orders)
{
item.statusStr =
EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.ServicesTicketStatus>(item.status);
}
}
jm.status = true;
jm.data = new
{
model,
list = orders,
count = orders.TotalCount,
};
return jm;
}
#endregion
}
}
\ No newline at end of file
...@@ -4,66 +4,6 @@ ...@@ -4,66 +4,6 @@
<name>ShopERP.WebApi</name> <name>ShopERP.WebApi</name>
</assembly> </assembly>
<members> <members>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.AdvertController">
<summary>
广告api控制器
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AdvertController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsArticleServices,CoreCms.Net.IServices.ICoreCmsAdvertPositionServices,CoreCms.Net.IServices.ICoreCmsAdvertisementServices)">
<summary>
构造函数
</summary>
<param name="user"></param>
<param name="articleServices"></param>
<param name="advertPositionServices"></param>
<param name="advertisementServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AdvertController.GetAdvertList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
获取广告列表
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AdvertController.GetPositionList(CoreCms.Net.Model.FromBody.WxAdvert)">
<summary>
获取广告位置信息
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.ArticleController">
<summary>
文章api控制器
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ArticleController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsArticleServices,CoreCms.Net.IServices.ICoreCmsArticleTypeServices)">
<summary>
构造函数
</summary>
<param name="user"></param>
<param name="articleServices"></param>
<param name="articleTypeServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ArticleController.NoticeList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
获取通知列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ArticleController.GetArticleList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
获取文章列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ArticleController.GetArticleDetail(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取单个文章内容
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.CartController"> <member name="T:CoreCms.Net.Web.WebApi.Controllers.CartController">
<summary> <summary>
购物车操作 购物车操作
...@@ -105,294 +45,6 @@ ...@@ -105,294 +45,6 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.CommonController">
<summary>
通用调用接口数据
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CommonController.#ctor(CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsAreaServices,Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsServiceDescriptionServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.IToolsServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CommonController.InterFaceTest">
<summary>
接口测试反馈
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CommonController.GetConfigV2">
<summary>
返回配置数据文件V2.0
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CommonController.GetAreas">
<summary>
获取层级分配后的区域信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CommonController.GetServiceDescription">
<summary>
获取商城关键词说明列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CommonController.UploadImages">
<summary>
上传附件通用接口
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.CouponController">
<summary>
优惠券接口
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsCouponServices,CoreCms.Net.IServices.ICoreCmsPromotionServices,CoreCms.Net.IRepository.UnitOfWork.IUnitOfWork)">
<summary>
构造函数
</summary>
<param name="user"></param>
<param name="couponServices"></param>
<param name="promotionServices"></param>
<param name="unionOfWork"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.CouponList(CoreCms.Net.Model.FromBody.FMCouponForUserCouponPost)">
<summary>
获取 可领取的优惠券
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.CouponDetail(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取优惠券 详情
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.UserCoupon(CoreCms.Net.Model.FromBody.FMCouponForUserCouponPost)">
<summary>
获取用户已领取的优惠券
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.GetCoupon(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
用户领取优惠券
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.GetCouponKey(CoreCms.Net.Model.FromBody.FMCouponForGetCouponKeyPost)">
<summary>
用户输入code领取优惠券
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.DemoController">
<summary>
默认接口示例
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DemoController.Index">
<summary>
默认首页
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.DistributionController">
<summary>
分销请求接口
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsDistributionServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsDistributionOrderServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.GetStoreInfo(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取店铺信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.Info">
<summary>
查询用户是否可以成为分销商
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.ApplyDistribution(CoreCms.Net.Model.FromBody.FMDistributionApply)">
<summary>
申请成为分销商接口
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.MyOrder(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
我推广的订单
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.SetStore(CoreCms.Net.Model.FromBody.FMSetDistributionStorePost)">
<summary>
店铺设置
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.GetOrderSum">
<summary>
获取我的订单统计
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.GetTeamSum">
<summary>
获取我的下级用户数量
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.DistributionController.GetDistributionRanking(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
获取分销商排行
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.FormController">
<summary>
表单接口
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.FormController.#ctor(CoreCms.Net.IServices.ICoreCmsFormServices)">
<summary>
构造函数
</summary>
<param name="formServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.FormController.GetFormDetial(CoreCms.Net.Model.FromBody.FmGetForm)">
<summary>
万能表单/获取活动商品详情
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.FormController.AddSubmit(CoreCms.Net.Model.FromBody.FmAddSubmit)">
<summary>
万能表单/提交表单
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.GoodController">
<summary>
商品相关接口处理
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.#ctor(AutoMapper.IMapper,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsBrandServices,CoreCms.Net.IServices.ICoreCmsOrderItemServices,CoreCms.Net.IServices.ICoreCmsGoodsCommentServices,CoreCms.Net.IServices.ICoreCmsGoodsParamsServices,CoreCms.Net.IServices.ICoreCmsGoodsCollectionServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryExtendServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetAllCategories">
<summary>
获取所有商品分类栏目数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetGoodsPageList(CoreCms.Net.Model.FromBody.FMPageByWhereOrder)">
<summary>
根据查询条件获取分页数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetDetial(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取商品详情
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetProductInfo(CoreCms.Net.Model.FromBody.FMGetProductInfo)">
<summary>
获取单个货品信息
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetGoodsComment(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
获取商品评价列表分页数据
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetGoodsParams(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取单个商品参数
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetGoodsRecommendList(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取随机推荐商品
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.GetDetialByToken(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
根据Token获取商品详情
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.GroupController">
<summary>
团购调用接口数据
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GroupController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsPromotionServices,CoreCms.Net.IServices.ICoreCmsGoodsServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GroupController.GetList(CoreCms.Net.Model.FromBody.FMGroupGetListPost)">
<summary>
获取秒杀团购列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.GroupController.GetGoodsDetial(CoreCms.Net.Model.FromBody.FMGetGoodsDetial)">
<summary>
获取秒杀团购详情
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.NoticeController">
<summary>
公告控制器
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.NoticeController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsNoticeServices)">
<summary>
构造函数
</summary>
<param name="user"></param>
<param name="noticeServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.NoticeController.NoticeList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.NoticeController.NoticeInfo(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取单个公告内容
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.OrderController"> <member name="T:CoreCms.Net.Web.WebApi.Controllers.OrderController">
<summary> <summary>
订单调用接口数据 订单调用接口数据
...@@ -403,30 +55,12 @@ ...@@ -403,30 +55,12 @@
构造函数 构造函数
</summary> </summary>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetTaxCode(CoreCms.Net.Model.ViewModels.DTO.GetTaxCodePost)">
<summary>
发票模糊查询
</summary>
<returns></returns>
</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)">
<summary> <summary>
创建订单 创建订单
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.OrderDetails(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
订单预览
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetOrderStatusNum(CoreCms.Net.Model.ViewModels.DTO.GetOrderStatusNumPost)">
<summary>
获取订单不同状态的数量
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetOrderList(CoreCms.Net.Model.ViewModels.DTO.GetOrderListPost)"> <member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetOrderList(CoreCms.Net.Model.ViewModels.DTO.GetOrderListPost)">
<summary> <summary>
获取个人订单列表 获取个人订单列表
...@@ -451,629 +85,12 @@ ...@@ -451,629 +85,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.AddAftersales(CoreCms.Net.Model.ViewModels.DTO.ToAddBillAfterSalesPost)"> <member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.LogisticsByApi(CoreCms.Net.Model.FromBody.FMApiLogisticsByApiPost)">
<summary>
添加售后单
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.AftersalesList(CoreCms.Net.Model.FromBody.FMPageByStringId)">
<summary>
获取售后单列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.Aftersalesinfo(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
获取售后单列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.SendReship(CoreCms.Net.Model.FromBody.FMBillReshipForSendReshipPost)">
<summary>
提交售后发货快递信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetShip(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取配送方式列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.LogisticsByApi(CoreCms.Net.Model.FromBody.FMApiLogisticsByApiPost)">
<summary> <summary>
前台物流查询接口 前台物流查询接口
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.PageController">
<summary>
页面接口
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.#ctor(AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsUserServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.GetPageConfig(CoreCms.Net.Model.FromBody.FMWxPost)">
<summary>
获取页面布局数据
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.GetRecod(CoreCms.Net.Model.FromBody.FMGetRecodPost)">
<summary>
获取用户购买记录
</summary>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.PaymentsController">
<summary>
支付调用接口数据
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PaymentsController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsBillPaymentsServices,CoreCms.Net.IServices.ICoreCmsPaymentsServices)">
<summary>
构造函数
</summary>
<param name="user"></param>
<param name="billPaymentsServices"></param>
<param name="paymentsServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PaymentsController.GetList">
<summary>
获取支付方式列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PaymentsController.CheckPay(CoreCms.Net.Model.ViewModels.DTO.CheckPayPost)">
<summary>
支付确认页面取信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PaymentsController.GetInfo(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
获取支付单详情
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.PinTuanController">
<summary>
拼团接口
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PinTuanController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsPinTuanGoodsServices,CoreCms.Net.IServices.ICoreCmsPinTuanRuleServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsPinTuanRecordServices,CoreCms.Net.IServices.ICoreCmsGoodsServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PinTuanController.GetList(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
拼团列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PinTuanController.GetGoodsInfo(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取拼团商品信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PinTuanController.GetProductInfo(CoreCms.Net.Model.FromBody.FMGetProductInfo)">
<summary>
获取货品信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.PinTuanController.GetPinTuanTeam(CoreCms.Net.Model.FromBody.FMGetPinTuanTeamPost)">
<summary>
根据订单id取拼团信息,用在订单详情页
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.ServiceController">
<summary>
服务卡控制器
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.#ctor(CoreCms.Net.IServices.ICoreCmsServicesServices,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsUserServicesOrderServices,CoreCms.Net.IServices.ICoreCmsUserServicesTicketServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsClerkServices,CoreCms.Net.IServices.ICoreCmsUserServicesTicketVerificationLogServices,CoreCms.Net.IServices.ICoreCmsStoreServices,CoreCms.Net.IServices.ICoreCmsUserGradeServices)">
<summary>
构造函数
</summary>
<param name="servicesServices"></param>
<param name="user"></param>
<param name="userServicesOrderServices"></param>
<param name="userServicesTicketServices"></param>
<param name="userServices"></param>
<param name="clerkServices"></param>
<param name="ticketVerificationLogServices"></param>
<param name="storeServices"></param>
<param name="userGradeServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.GetPageList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
取得服务卡列表信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.GetDetails(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取服务卡详情
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.AddServiceOrder(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
取得服务卡列表信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.VerificationPageList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
店铺核销的服务券列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.LogDelete(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
软删除服务券核销单数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.GetTicketInfo(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
获取单个提货单详情
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.ServiceController.VerificationTicket(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
核销服务券
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.StoreController">
<summary>
门店调用接口数据
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsStoreServices,CoreCms.Net.IServices.ICoreCmsClerkServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsBillLadingServices,CoreCms.Net.IServices.ICoreCmsOrderServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetDefaultStore">
<summary>
获取默认的门店
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetStoreList(CoreCms.Net.Model.FromBody.FMGetStoreQueryPageByCoordinate)">
<summary>
获取门店列表数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetRecommendKeys">
<summary>
获取推荐关键词
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetStoreSwitch">
<summary>
判断是否开启门店自提
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetStoreById(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
根据序列获取门店数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.IsClerk">
<summary>
判断访问用户是否是店员
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetStoreByUserId">
<summary>
根据用户序列获取门店数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetOrderPageByMerchant(CoreCms.Net.Model.ViewModels.DTO.GetOrderPageByMerchantPost)">
<summary>
获取个人订单列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.GetOrderPageByMerchantSearch(CoreCms.Net.Model.ViewModels.DTO.GetOrderPageByMerchantSearcgPost)">
<summary>
搜索订单
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.StoreLadingList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
店铺提货单列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.LadingDelete(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
删除提货单数据
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.LadingInfo(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
获取单个提货单详情
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.StoreController.Lading(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
核销订单
</summary>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.TestController">
<summary>
用户测试事件
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.TestController.#ctor(CoreCms.Net.Utility.Helper.EmailSenderHelper)">
<summary>
构造函数注入
</summary>
<param name="emailSender"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.TestController.SendEmail(CoreCms.Net.Model.FromBody.FMSendEmail)">
<summary>
用户邮箱发送
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.UserController">
<summary>
用户操作事件
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.Auth.Policys.PermissionRequirement,CoreCms.Net.IServices.ICoreCmsSmsServices,CoreCms.Net.IServices.ICoreCmsUserGradeServices,CoreCms.Net.IServices.ICoreCmsUserLogServices,Microsoft.AspNetCore.Http.IHttpContextAccessor,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsGoodsBrowsingServices,CoreCms.Net.IServices.ICoreCmsCartServices,CoreCms.Net.IServices.ICoreCmsGoodsCollectionServices,CoreCms.Net.IServices.ICoreCmsUserShipServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.ICoreCmsBillPaymentsServices,CoreCms.Net.IServices.ICoreCmsGoodsCommentServices,CoreCms.Net.IServices.ICoreCmsUserBankCardServices,CoreCms.Net.IServices.ICoreCmsUserTocashServices,CoreCms.Net.IServices.ICoreCmsUserBalanceServices,CoreCms.Net.IServices.ICoreCmsInvoiceServices,CoreCms.Net.IServices.ICoreCmsUserPointLogServices,CoreCms.Net.IServices.ICoreCmsShareServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsServicesServices,CoreCms.Net.IServices.ICoreCmsUserServicesOrderServices,CoreCms.Net.IServices.ICoreCmsUserServicesTicketServices,CoreCms.Net.IServices.ICoreCmsStoreServices,CoreCms.Net.IServices.ICoreCmsCouponServices,CoreCms.Net.IServices.ICoreCmsOrderServices)">
<summary>
构造函数
</summary>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SendSms(CoreCms.Net.Model.FromBody.FMWxSendSMS)">
<summary>
用户短信发送
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SmsLogin(CoreCms.Net.Model.FromBody.FMWxAccountCreate)">
<summary>
手机短信验证码登陆,同时兼有手机短信注册的功能,还有第三方账户绑定的功能
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetAreaId(CoreCms.Net.Model.ViewModels.DTO.GetAreaIdPost)">
<summary>
获取区域ID
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.LogOut">
<summary>
注销登录
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.IsPoint">
<summary>
判断是否开启积分
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Share(CoreCms.Net.Model.FromBody.FMShare)">
<summary>
统一分享url处理
新的分享,不管是二维码,还是地址,都走这个
page 场景值 1店铺首页,2商品详情页,3拼团详情页,4邀请好友(店铺页面,params里需要传store),5文章页面,6参团页面,7自定义页面,8智能表单,9团购,10秒杀,11代理
url:前端地址
params:参数,根据场景值不一样而内容不一样
1
2 goodsId:商品ID
3 goodsId:商品ID,teamId:拼团ID
4 store:店铺code
5 articleId:文章ID,articleType:文章类型
6 goodsId:商品ID,groupId:参团ID,teamId:拼团ID
7 pageCode:自定义页面code
8 id:智能表单ID
9 goodsId:商品ID,groupId:团购秒杀ID
type 类型,1url,2二维码,3海报
token 可以保存推荐人的信息
client 终端,1普通h5,2微信小程序,3微信公众号(h5),4头条系小程序,5pc,6阿里小程序
10 store:店铺code
</summary>
<param name="entity"></param>
<returns>array</returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.DeShare(CoreCms.Net.Model.FromBody.FMDeShare)">
<summary>
统一分享解码
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetUserInfo">
<summary>
获取用户信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetCartNumber">
<summary>
获取购物车商品数量
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GoodsCollectionCreateOrDelete(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
商品取消/添加收藏
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetUserDefaultShip">
<summary>
获取用户获取用户默认收货地址
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SetDefShip(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
设置默认地址
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetUserPoint(CoreCms.Net.Model.ViewModels.DTO.GetUserPointPost)">
<summary>
判断用户下单可以使用多少积分
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetUserShip">
<summary>
获取用户的收货地址列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SaveUserShip(CoreCms.Net.Model.ViewModels.DTO.SaveUserShipPost)">
<summary>
保存用户地址
</summary>
<param name="entity"></param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetShipDetail(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取用户单个地址详情
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.RemoveShip(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
收货地址删除
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Pay(CoreCms.Net.Model.ViewModels.DTO.PayPost)">
<summary>
支付
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.OrderEvaluate(CoreCms.Net.Model.ViewModels.DTO.OrderEvaluatePost)">
<summary>
订单评价
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetMyBankcardsList">
<summary>
我的银行卡列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.AddBankCards(CoreCms.Net.Model.Entities.CoreCmsUserBankCard)">
<summary>
添加银行卡
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SetDefaultBankCard(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
设置默认银行卡
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetBankCardInfo(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
获取银行卡信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetDefaultBankCard">
<summary>
获取用户默认银行卡信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Removebankcard(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
删除银行卡信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetBankCardsOrganization(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
获取银行卡组织信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Cash(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
提现申请
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.CashList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
提现记录列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.UserBalance(CoreCms.Net.Model.FromBody.FMGetBalancePost)">
<summary>
获取我的余额明细列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.UserInvoiceList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
我的发票列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.UserPointLog(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
我的积分列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GoodsCollectionList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
取得商品收藏记录(关注)
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GoodsCollection(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
添加商品收藏(关注)
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Goodsbrowsing(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
取得商品浏览足迹
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.AddGoodsBrowsing(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
添加商品浏览足迹
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.DelGoodsBrowsing(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
删除商品浏览足迹
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.ChangeAvatar(CoreCms.Net.Model.FromBody.FMStringId)">
<summary>
更换头像
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.EditInfo(CoreCms.Net.Model.FromBody.EditInfoPost)">
<summary>
编辑用户信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.EditPwd(CoreCms.Net.Model.FromBody.EditPwdPost)">
<summary>
修改用户密码
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.MyInvite">
<summary>
邀请好友(获取我的要求相关信息)
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.SetMyInvite(CoreCms.Net.Model.FromBody.FMIntId)">
<summary>
设置我的上级邀请人
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetMyInvite">
<summary>
获取我的上级邀请人
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetMyChildSum">
<summary>
获取我的下级用户数量
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Recommend(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
获取用户推荐列表
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.ShareCode">
<summary>
获取用户邀请码
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.IsSign">
<summary>
判断是否签到
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.Sign">
<summary>
用户签到
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.ForgetPwd(CoreCms.Net.Model.FromBody.FMForgetPwdPost)">
<summary>
用户找回密码
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetServicesPageList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<summary>
取得服务卡列表信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.GetServicesTickets(CoreCms.Net.Model.FromBody.FMPageByStringId)">
<summary>
取得服务卡列表信息
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Infrastructure.ApiExplorerIgnores.Apply(Microsoft.AspNetCore.Mvc.ApplicationModels.ActionModel)"> <member name="M:CoreCms.Net.Web.WebApi.Infrastructure.ApiExplorerIgnores.Apply(Microsoft.AspNetCore.Mvc.ApplicationModels.ActionModel)">
<summary> <summary>
自带的Controller与swagger3.0冲突,在此排除扫描 自带的Controller与swagger3.0冲突,在此排除扫描
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient"
connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456" connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456"
--> -->
<target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=192.168.8.109;Port=3306;Database=ShopERP;Uid=root;Pwd=123456;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;"> <target name="log_database" xsi:type="Database" dbProvider="MySql.Data.MySqlClient.MySqlConnection,Mysql.Data" connectionString="Server=192.168.8.109;Port=3306;Database=ShopERP;Uid=root;Pwd=123456;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;">
<commandText> <commandText>
INSERT INTO SysNLogRecords INSERT INTO SysNLogRecords
(LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod (LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod
......
License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.
Parameters
Licensor: HashiCorp, Inc.
Licensed Work: Consul Version 1.17.0 or later. The Licensed Work is (c) 2024
HashiCorp, Inc.
Additional Use Grant: You may make production use of the Licensed Work, provided
Your use does not include offering the Licensed Work to third
parties on a hosted or embedded basis in order to compete with
HashiCorp's paid version(s) of the Licensed Work. For purposes
of this license:
A "competitive offering" is a Product that is offered to third
parties on a paid basis, including through paid support
arrangements, that significantly overlaps with the capabilities
of HashiCorp's paid version(s) of the Licensed Work. If Your
Product is not a competitive offering when You first make it
generally available, it will not become a competitive offering
later due to HashiCorp releasing a new version of the Licensed
Work with additional capabilities. In addition, Products that
are not provided on a paid basis are not competitive.
"Product" means software that is offered to end users to manage
in their own environments or offered as a service on a hosted
basis.
"Embedded" means including the source code or executable code
from the Licensed Work in a competitive offering. "Embedded"
also means packaging the competitive offering in such a way
that the Licensed Work must be accessed or downloaded for the
competitive offering to operate.
Hosting or using the Licensed Work(s) for internal purposes
within an organization is not considered a competitive
offering. HashiCorp considers your organization to include all
of your affiliates under common control.
For binding interpretive guidance on using HashiCorp products
under the Business Source License, please visit our FAQ.
(https://www.hashicorp.com/license-faq)
Change Date: Four years from the date the Licensed Work is published.
Change License: MPL 2.0
For information about alternative licensing arrangements for the Licensed Work,
please contact licensing@hashicorp.com.
Notice
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
This source diff could not be displayed because it is too large. You can view the blob instead.
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