diff --git a/ARW.Model/Dto/Business/Custom/CustomerLoginLogs/CustomerLoginLogDto.cs b/ARW.Model/Dto/Business/Custom/CustomerLoginLogs/CustomerLoginLogDto.cs
new file mode 100644
index 0000000..908caa0
--- /dev/null
+++ b/ARW.Model/Dto/Business/Custom/CustomerLoginLogs/CustomerLoginLogDto.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using ARW.Model.Models.Business.Custom.CustomerLoginLogs;
+
+namespace ARW.Model.Dto.Business.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志输入对象
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ public class CustomerLoginLogDto
+ {
+
+ public int CustomerLoginLogId { get; set; }
+
+ public long CustomerLoginLogGuid { get; set; }
+
+ [Required(ErrorMessage = "客户guid不能为空")]
+ public long CustomerGuid { get; set; }
+
+
+
+
+
+ }
+
+
+ ///
+ /// 客户登录日志查询对象
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ public class CustomerLoginLogQueryDto : PagerInfo
+ {
+ [Required(ErrorMessage = "客户guid不能为空")]
+ public long CustomerGuid { get; set; }
+ public string ids { get; set; }
+ }
+
+
+
+
+}
diff --git a/ARW.Model/Dto/Business/Custom/Customers/CustomerDto.cs b/ARW.Model/Dto/Business/Custom/Customers/CustomerDto.cs
index f67c373..cf9b343 100644
--- a/ARW.Model/Dto/Business/Custom/Customers/CustomerDto.cs
+++ b/ARW.Model/Dto/Business/Custom/Customers/CustomerDto.cs
@@ -26,8 +26,8 @@ namespace ARW.Model.Dto.Business.Custom.Customers
public long? CustomerMemberLevelGuid { get; set; }
- [Required(ErrorMessage = "小程序openid不能为空")]
public string CustomerXcxOpenid { get; set; }
+ public string CustomerPassword { get; set; }
public string CustomerType { get; set; }
@@ -46,19 +46,14 @@ namespace ARW.Model.Dto.Business.Custom.Customers
[Required(ErrorMessage = "性别不能为空")]
public int CustomerGender { get; set; }
- [Required(ErrorMessage = "可用余额不能为空")]
public decimal CustomerAvailableBalance { get; set; }
- [Required(ErrorMessage = "可用积分不能为空")]
public decimal CustomerAvailablePoints { get; set; }
- [Required(ErrorMessage = "总支付金额不能为空")]
public decimal CustomerTotalPaymentAmount { get; set; }
- [Required(ErrorMessage = "实际消费金额不能为空")]
public decimal CustomerActualConsumptionAmount { get; set; }
- [Required(ErrorMessage = "最后登录时间不能为空")]
public DateTime? CustomerLastLoginTime { get; set; }
@@ -109,6 +104,11 @@ namespace ARW.Model.Dto.Business.Custom.Customers
///
public string CustomerXcxOpenid { get; set; }
+ public string CustomerNickname { get; set; }
+
+ public string CustomerPassword { get; set; }
+
+
}
diff --git a/ARW.Model/Models/Business/Custom/CustomerLoginLogs/CustomerLoginLog.cs b/ARW.Model/Models/Business/Custom/CustomerLoginLogs/CustomerLoginLog.cs
new file mode 100644
index 0000000..990bb49
--- /dev/null
+++ b/ARW.Model/Models/Business/Custom/CustomerLoginLogs/CustomerLoginLog.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using SqlSugar;
+using OfficeOpenXml.Attributes;
+using Newtonsoft.Json;
+
+namespace ARW.Model.Models.Business.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志,数据实体对象
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ [SugarTable("tb_customer_login_log")]
+ public class CustomerLoginLog : BusinessBase
+ {
+
+ ///
+ /// 描述 :
+ /// 空值 : false
+ ///
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "customer_login_log_id")]
+ public int CustomerLoginLogId { get; set; }
+
+
+ ///
+ /// 描述 :
+ /// 空值 : false
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "customer_login_log_guid")]
+ public long CustomerLoginLogGuid { get; set; }
+
+
+ ///
+ /// 描述 :客户guid
+ /// 空值 : false
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName = "customer_guid")]
+ public long CustomerGuid { get; set; }
+
+
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/ARW.Model/Models/Business/Custom/Customers/Customer.cs b/ARW.Model/Models/Business/Custom/Customers/Customer.cs
index 84f3179..609db37 100644
--- a/ARW.Model/Models/Business/Custom/Customers/Customer.cs
+++ b/ARW.Model/Models/Business/Custom/Customers/Customer.cs
@@ -117,6 +117,15 @@ namespace ARW.Model.Models.Business.Custom.Customers
[SugarColumn(ColumnName = "customer_mobile_phone_number")]
public string CustomerMobilePhoneNumber { get; set; }
+
+ ///
+ /// 描述 :密码
+ /// 空值 : false
+ ///
+ [EpplusTableColumn(Header = "密码")]
+ [SugarColumn(ColumnName = "customer_password")]
+ public string CustomerPassword { get; set; }
+
///
/// 描述 :电子邮箱
/// 空值 : false
diff --git a/ARW.Model/Vo/Business/Custom/CustomerLoginLogs/CustomerLoginLogVo.cs b/ARW.Model/Vo/Business/Custom/CustomerLoginLogs/CustomerLoginLogVo.cs
new file mode 100644
index 0000000..2f86c7f
--- /dev/null
+++ b/ARW.Model/Vo/Business/Custom/CustomerLoginLogs/CustomerLoginLogVo.cs
@@ -0,0 +1,48 @@
+using Newtonsoft.Json;
+using OfficeOpenXml.Attributes;
+using SqlSugar;
+using System;
+
+namespace ARW.Model.Vo.Business.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志展示对象
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ public class CustomerLoginLogVo
+ {
+
+
+ ///
+ /// 描述 :
+ ///
+ public int CustomerLoginLogId { get; set; }
+
+
+ ///
+ /// 描述 :
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long CustomerLoginLogGuid { get; set; }
+
+
+ ///
+ /// 描述 :客户guid
+ ///
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long CustomerGuid { get; set; }
+
+
+ ///
+ /// 用户名称
+ ///
+ public string CustomerNickName { get; set; }
+
+ ///
+ /// 登录时间
+ ///
+ public DateTime CreateTime { get; set; }
+ }
+}
diff --git a/ARW.Model/Vo/Business/Custom/Customers/CustomerVo.cs b/ARW.Model/Vo/Business/Custom/Customers/CustomerVo.cs
index c5389ef..334783a 100644
--- a/ARW.Model/Vo/Business/Custom/Customers/CustomerVo.cs
+++ b/ARW.Model/Vo/Business/Custom/Customers/CustomerVo.cs
@@ -80,32 +80,39 @@ namespace ARW.Model.Vo.Business.Custom.Customers
[EpplusTableColumn(Header = "性别")]
public int CustomerGender { get; set; }
+ ///
+ /// 描述 :密码
+ ///
+ [EpplusIgnore]
+ public string CustomerPassword { get; set; }
+
+
///
/// 描述 :可用余额
///
- [EpplusTableColumn(Header = "可用余额")]
+ [EpplusIgnore]
public decimal CustomerAvailableBalance { get; set; }
///
/// 描述 :可用积分
///
- [EpplusTableColumn(Header = "可用积分")]
+ [EpplusIgnore]
public decimal CustomerAvailablePoints { get; set; }
///
/// 描述 :总支付金额
///
- [EpplusTableColumn(Header = "总支付金额")]
+ [EpplusIgnore]
public decimal CustomerTotalPaymentAmount { get; set; }
///
/// 描述 :实际消费金额
///
- [EpplusTableColumn(Header = "实际消费金额")]
+ [EpplusIgnore]
public decimal CustomerActualConsumptionAmount { get; set; }
diff --git a/ARW.Repository/Business/Custom/CustomerLoginLogs/CustomerLoginLogRepository.cs b/ARW.Repository/Business/Custom/CustomerLoginLogs/CustomerLoginLogRepository.cs
new file mode 100644
index 0000000..eb0940b
--- /dev/null
+++ b/ARW.Repository/Business/Custom/CustomerLoginLogs/CustomerLoginLogRepository.cs
@@ -0,0 +1,20 @@
+using System;
+using Infrastructure.Attribute;
+using ARW.Repository.System;
+using ARW.Model.Models.Business.Custom.CustomerLoginLogs;
+
+namespace ARW.Repository.Business.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志仓储
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ [AppService(ServiceLifetime = LifeTime.Transient)]
+ public class CustomerLoginLogRepository : BaseRepository
+ {
+ #region 业务逻辑代码
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ARW.Service/Business/BusinessService/Custom/CustomerLoginLogs/CustomerLoginLogService.cs b/ARW.Service/Business/BusinessService/Custom/CustomerLoginLogs/CustomerLoginLogService.cs
new file mode 100644
index 0000000..6519616
--- /dev/null
+++ b/ARW.Service/Business/BusinessService/Custom/CustomerLoginLogs/CustomerLoginLogService.cs
@@ -0,0 +1,95 @@
+using Infrastructure.Attribute;
+using Microsoft.AspNetCore.Http;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Infrastructure;
+using ARW.Model;
+using ARW.Repository;
+using ARW.Repository.Business.Custom.CustomerLoginLogs;
+using ARW.Service.Business.IBusinessService.Custom.CustomerLoginLogs;
+using ARW.Model.Dto.Business.Custom.CustomerLoginLogs;
+using ARW.Model.Models.Business.Custom.CustomerLoginLogs;
+using ARW.Model.Vo.Business.Custom.CustomerLoginLogs;
+using ARW.Model.Models.Business.Custom.Customers;
+
+namespace ARW.Service.Business.BusinessService.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志接口实现类
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ [AppService(ServiceType = typeof(ICustomerLoginLogService), ServiceLifetime = LifeTime.Transient)]
+ public class CustomerLoginLogServiceImpl : BaseService, ICustomerLoginLogService
+ {
+ private readonly CustomerLoginLogRepository _CustomerLoginLogRepository;
+
+ public CustomerLoginLogServiceImpl(CustomerLoginLogRepository CustomerLoginLogRepository)
+ {
+ this._CustomerLoginLogRepository = CustomerLoginLogRepository;
+ }
+
+ #region 业务逻辑代码
+
+
+ ///
+ /// 查询客户登录日志分页列表
+ ///
+ public async Task> GetCustomerLoginLogList(CustomerLoginLogQueryDto parm)
+ {
+ //开始拼装查询条件d
+ var predicate = Expressionable.Create();
+ predicate = predicate.AndIF(parm.CustomerGuid != 0, s => s.CustomerGuid == parm.CustomerGuid);
+
+ var query = _CustomerLoginLogRepository
+ .Queryable()
+ .LeftJoin((s, c) => s.CustomerGuid == c.CustomerGuid)
+ .Where(predicate.ToExpression())
+ .OrderBy(s => s.Create_time, OrderByType.Desc)
+ .Select((s, c) => new CustomerLoginLogVo
+ {
+ CustomerLoginLogId = s.CustomerLoginLogId,
+ CustomerLoginLogGuid = s.CustomerLoginLogGuid,
+ CustomerGuid = s.CustomerGuid,
+ CreateTime = s.Create_time,
+ CustomerNickName = c.CustomerNickname
+ });
+
+
+ return await query.ToPageAsync(parm);
+ }
+
+ ///
+ /// 添加或修改客户登录日志
+ ///
+ public async Task AddOrUpdateCustomerLoginLog(CustomerLoginLog model)
+ {
+ if (model.CustomerLoginLogId != 0)
+ {
+ var response = await _CustomerLoginLogRepository.UpdateAsync(model);
+ return "修改成功!";
+ }
+ else
+ {
+
+ var response = await _CustomerLoginLogRepository.InsertReturnSnowflakeIdAsync(model);
+ return "添加成功!";
+ }
+ }
+
+ #region Excel处理
+
+
+ #endregion
+
+
+
+ #endregion
+
+ }
+}
diff --git a/ARW.Service/Business/BusinessService/Custom/Customers/CustomerService.cs b/ARW.Service/Business/BusinessService/Custom/Customers/CustomerService.cs
index e504fc4..76038d0 100644
--- a/ARW.Service/Business/BusinessService/Custom/Customers/CustomerService.cs
+++ b/ARW.Service/Business/BusinessService/Custom/Customers/CustomerService.cs
@@ -14,6 +14,9 @@ using ARW.Model.Models.Business.Custom.Customers;
using ARW.Model.Vo.Business.Custom.Customers;
using ARW.Repository.Business.Custom.Customers;
using ARW.Service.Business.IBusinessService.Custom.Customers;
+using ARW.Common;
+using System.Security.Cryptography;
+using ARW.Model.System;
namespace ARW.Service.Business.BusinessService.Custom.Customers
{
@@ -67,6 +70,7 @@ namespace ARW.Service.Business.BusinessService.Custom.Customers
CustomerTotalPaymentAmount = s.CustomerTotalPaymentAmount,
CustomerActualConsumptionAmount = s.CustomerActualConsumptionAmount,
CustomerLastLoginTime = s.CustomerLastLoginTime,
+ CustomerPassword = s.CustomerPassword
});
@@ -78,6 +82,8 @@ namespace ARW.Service.Business.BusinessService.Custom.Customers
///
public async Task AddOrUpdateCustomer(Customer model)
{
+ //密码md5
+ model.CustomerPassword = NETCore.Encrypt.EncryptProvider.Md5(model.CustomerPassword);
if (model.CustomerId != 0)
{
var response = await _CustomerRepository.UpdateAsync(model);
@@ -85,7 +91,6 @@ namespace ARW.Service.Business.BusinessService.Custom.Customers
}
else
{
-
var response = await _CustomerRepository.InsertReturnSnowflakeIdAsync(model);
return "添加成功!";
}
diff --git a/ARW.Service/Business/IBusinessService/Custom/CustomerLoginLogs/ICustomerLoginLogService.cs b/ARW.Service/Business/IBusinessService/Custom/CustomerLoginLogs/ICustomerLoginLogService.cs
new file mode 100644
index 0000000..209c618
--- /dev/null
+++ b/ARW.Service/Business/IBusinessService/Custom/CustomerLoginLogs/ICustomerLoginLogService.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ARW.Model;
+using ARW.Model.Dto.Business.Custom.CustomerLoginLogs;
+using ARW.Model.Models.Business.Custom.CustomerLoginLogs;
+using ARW.Model.Vo.Business.Custom.CustomerLoginLogs;
+
+namespace ARW.Service.Business.IBusinessService.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志接口类
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ public interface ICustomerLoginLogService : IBaseService
+ {
+ ///
+ /// 获取客户登录日志分页列表
+ ///
+ ///
+ ///
+ Task> GetCustomerLoginLogList(CustomerLoginLogQueryDto parm);
+
+
+ ///
+ /// 添加或修改客户登录日志
+ ///
+ ///
+ ///
+ Task AddOrUpdateCustomerLoginLog(CustomerLoginLog parm);
+
+
+
+
+
+ }
+}
diff --git a/ARW.WebApi/Controllers/Api/Wechat/WeChatLoginController.cs b/ARW.WebApi/Controllers/Api/Wechat/WeChatLoginController.cs
index 33b8e52..73f077e 100644
--- a/ARW.WebApi/Controllers/Api/Wechat/WeChatLoginController.cs
+++ b/ARW.WebApi/Controllers/Api/Wechat/WeChatLoginController.cs
@@ -18,6 +18,8 @@ using Infrastructure.Attribute;
using ARW.Service.Business.IBusinessService.Custom.Customers;
using Newtonsoft.Json.Linq;
using Aliyun.OSS;
+using ARW.Service.Business.IBusinessService.Custom.CustomerLoginLogs;
+using ARW.Model.Models.Business.Custom.CustomerLoginLogs;
namespace ARW.WebApi.Controllers.Api.Wechat
{
@@ -31,14 +33,16 @@ namespace ARW.WebApi.Controllers.Api.Wechat
private readonly WeChatLogin _weChat;
private readonly ICustomerService _customerService;
+ private readonly ICustomerLoginLogService _CustomerLoginLogService;
private readonly OptionsSetting _jwtSettings;
- public WeChatLoginController(WeChatLogin weChat, ICustomerService customerService, IOptions jwtSettings)
+ public WeChatLoginController(WeChatLogin weChat, ICustomerService customerService, IOptions jwtSettings, ICustomerLoginLogService customerLoginLogService)
{
_weChat = weChat;
_customerService = customerService;
_jwtSettings = jwtSettings.Value;
+ _CustomerLoginLogService = customerLoginLogService;
}
///
@@ -55,35 +59,64 @@ namespace ARW.WebApi.Controllers.Api.Wechat
}
var addModal = parm.Adapt().ToCreate(HttpContext);
- addModal.CustomerMobilePhoneNumber = await GetUserPhoneNumber(parm.Code);
- var user = await _customerService.GetFirstAsync(s => s.CustomerMobilePhoneNumber == addModal.CustomerMobilePhoneNumber);
+ addModal.CustomerPassword = NETCore.Encrypt.EncryptProvider.Md5(addModal.CustomerPassword);
+ var user = new Customer();
- if (user == null)
+ /* 用户名密码登录 */
+ if (!string.IsNullOrEmpty(addModal.CustomerNickname) && !string.IsNullOrEmpty(addModal.CustomerPassword))
{
- string appId = AppSettings.GetConfig("SenparcWeixinSetting:TenPayV3_AppId");
- string appSecret = AppSettings.GetConfig("SenparcWeixinSetting:TenPayV3_AppSecret");
- //string openid = await GetOpenIDAsync(parm.CustomerXcxOpenidCode, appId, appSecret);
-
- // 客户默认头像
- addModal.CustomerAvatar = "https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png";
- addModal.CustomerNickname = "用户" + addModal.CustomerMobilePhoneNumber.Substring(addModal.CustomerMobilePhoneNumber.Length - 4); ;
- addModal.CustomerGender = 1;
- addModal.CustomerType = 1;
- addModal.CustomerLastLoginTime = DateTime.Now;
- addModal.CustomerXcxOpenid = parm.CustomerXcxOpenid;
- var response = await _customerService.InsertReturnSnowflakeIdAsync(addModal);
- if (response == 0)
- {
- throw new CustomException("添加失败!");
- }
-
- user = await _customerService.GetFirstAsync(s => s.CustomerGuid == response);
+ user = await _customerService.GetFirstAsync(s => s.CustomerNickname == addModal.CustomerNickname && s.CustomerPassword == addModal.CustomerPassword);
+ if (user == null) throw new CustomException("用户名或者密码错误");
}
- else
+ /* 手机号登录(微信一键登录) */
+ if (!string.IsNullOrEmpty(parm.Code))
{
- user.CustomerLastLoginTime = DateTime.Now;
+ addModal.CustomerMobilePhoneNumber = await GetUserPhoneNumber(parm.Code);
+ user = await _customerService.GetFirstAsync(s => s.CustomerMobilePhoneNumber == addModal.CustomerMobilePhoneNumber);
}
+ #region 注册
+ /* 注册 */
+ //if (user == null)
+ //{
+ // string appId = AppSettings.GetConfig("SenparcWeixinSetting:TenPayV3_AppId");
+ // string appSecret = AppSettings.GetConfig("SenparcWeixinSetting:TenPayV3_AppSecret");
+ // //string openid = await GetOpenIDAsync(parm.CustomerXcxOpenidCode, appId, appSecret);
+
+ // // 客户默认头像
+ // addModal.CustomerAvatar = "https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png";
+ // addModal.CustomerNickname = "用户" + addModal.CustomerMobilePhoneNumber.Substring(addModal.CustomerMobilePhoneNumber.Length - 4); ;
+ // addModal.CustomerGender = 1;
+ // addModal.CustomerType = 1;
+ // addModal.CustomerLastLoginTime = DateTime.Now;
+ // addModal.CustomerXcxOpenid = parm.CustomerXcxOpenid;
+ // var response = await _customerService.InsertReturnSnowflakeIdAsync(addModal);
+ // if (response == 0)
+ // {
+ // throw new CustomException("添加失败!");
+ // }
+
+ // user = await _customerService.GetFirstAsync(s => s.CustomerGuid == response);
+ //}
+ //else
+ //{
+ // user.CustomerLastLoginTime = DateTime.Now;
+ //}
+ #endregion
+ var time = DateTime.Now;
+ // 记录最后登录时间
+ user.CustomerLastLoginTime = time;
+ await _customerService.UpdateAsync(user);
+ // 添加访问记录
+ var model = new CustomerLoginLog
+ {
+ CustomerGuid = user.CustomerGuid,
+ Create_time = time,
+ Create_by = user.CustomerNickname,
+ };
+ await _CustomerLoginLogService.AddOrUpdateCustomerLoginLog(model);
+
+
LoginUser loginUser = new LoginUser
{
UserId = user.CustomerGuid,
diff --git a/ARW.WebApi/Controllers/Business/Custom/CustomerLoginLogs/CustomerLoginLogController.cs b/ARW.WebApi/Controllers/Business/Custom/CustomerLoginLogs/CustomerLoginLogController.cs
new file mode 100644
index 0000000..cd2c425
--- /dev/null
+++ b/ARW.WebApi/Controllers/Business/Custom/CustomerLoginLogs/CustomerLoginLogController.cs
@@ -0,0 +1,98 @@
+using Infrastructure;
+using Infrastructure.Attribute;
+using Infrastructure.Enums;
+using Infrastructure.Model;
+using Mapster;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using ARW.Admin.WebApi.Extensions;
+using ARW.Admin.WebApi.Filters;
+using ARW.Common;
+using ARW.Model.Dto.Business.Custom.CustomerLoginLogs;
+using ARW.Service.Business.IBusinessService.Custom.CustomerLoginLogs;
+using ARW.Admin.WebApi.Controllers;
+using ARW.Model.Models.Business.Custom.CustomerLoginLogs;
+using ARW.Model.Vo.Business.Custom.CustomerLoginLogs;
+using Microsoft.AspNetCore.Authorization;
+using ARW.Admin.WebApi.Framework;
+
+
+namespace ARW.WebApi.Controllers.Business.Custom.CustomerLoginLogs
+{
+ ///
+ /// 客户登录日志控制器
+ ///
+ /// @author lwh
+ /// @date 2023-11-21
+ ///
+ [Verify]
+ [Route("business/[controller]")]
+ public class CustomerLoginLogController : BaseController
+ {
+ private readonly ICustomerLoginLogService _CustomerLoginLogService;
+
+ ///
+ /// 依赖注入
+ ///
+ /// 客户登录日志服务
+ public CustomerLoginLogController(ICustomerLoginLogService CustomerLoginLogService)
+ {
+ _CustomerLoginLogService = CustomerLoginLogService;
+ }
+
+
+ ///
+ /// 获取客户登录日志列表
+ ///
+ /// 查询参数
+ ///
+ [HttpGet("getCustomerLoginLogList")]
+ [ActionPermissionFilter(Permission = "business:customerloginlog:list")]
+ public async Task GetCustomerLoginLogList([FromQuery] CustomerLoginLogQueryDto parm)
+ {
+ var res = await _CustomerLoginLogService.GetCustomerLoginLogList(parm);
+ return SUCCESS(res);
+ }
+
+ ///
+ /// 添加或修改客户登录日志
+ ///
+ ///
+ ///
+ [HttpPost("addOrUpdateCustomerLoginLog")]
+ [ActionPermissionFilter(Permission = "business:customerloginlog:addOrUpdate")]
+ [Log(Title = "添加或修改客户登录日志", BusinessType = BusinessType.ADDORUPDATE)]
+ public async Task AddOrUpdateCustomerLoginLog([FromBody] CustomerLoginLogDto parm)
+ {
+ if (parm == null) { throw new CustomException("请求参数错误"); }
+
+ var modal = new CustomerLoginLog();
+ if (parm.CustomerLoginLogId != 0) modal = parm.Adapt().ToUpdate(HttpContext);
+ else modal = parm.Adapt().ToCreate(HttpContext);
+
+ var res = await _CustomerLoginLogService.AddOrUpdateCustomerLoginLog(modal);
+ return SUCCESS(res);
+ }
+
+ ///
+ /// 删除客户登录日志
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "business:customerloginlog:delete")]
+ [Log(Title = "客户登录日志删除", BusinessType = BusinessType.DELETE)]
+ public IActionResult Delete(string ids)
+ {
+ long[] idsArr = Tools.SpitLongArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+ var response = _CustomerLoginLogService.Delete(idsArr);
+ return SUCCESS("删除成功!");
+ }
+
+
+
+
+
+
+ }
+}
diff --git a/ARW.WebApi/appsettings.json b/ARW.WebApi/appsettings.json
index 642b9ca..48397aa 100644
--- a/ARW.WebApi/appsettings.json
+++ b/ARW.WebApi/appsettings.json
@@ -46,7 +46,7 @@
"autoPre": true, //自动去除表前缀
"author": "admin",
"tablePrefix": "tb_", //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)",
- "vuePath": "D:\\.Net\\Aerwen\\key1_beacon\\key1_beacon_back" //前端代码存储路径eg:D:\Work\ARWAdmin-Vue3
+ "vuePath": "D:\\.Net\\Projects\\key1_beacon\\key1_beacon_back" //前端代码存储路径eg:D:\Work\ARWAdmin-Vue3
},
//邮箱配置信息
"MailOptions": {