李昊 преди 4 години
родител
ревизия
401e49fff3

+ 22 - 1
gx_api/GxPress/Api/GxPress.Api/WebControllers/UserController.cs

@@ -17,6 +17,7 @@ using GxPress.Request.AddressBookGroup;
 using GxPress.Request.AddressBookGroupUser;
 using GxPress.Request.App.User;
 using GxPress.Request.Department;
+using GxPress.Request.Feedback;
 using GxPress.Request.User;
 using GxPress.Result.AddressBook;
 using GxPress.Result.AddressBookGroupUser;
@@ -52,9 +53,11 @@ namespace GxPress.Api.WebControllers
         private readonly IUserLoginRepository userLoginRepository;
         private readonly IAddressBookGroupRepository addressBookGroupRepository;
         private readonly IAddressBookGroupUserRepository _addressBookGroupUserRepository;
+
+        private readonly IFeedbackRepository _feedbackRepository;
         public UserController(IUserRepository userRepository, IOptions<JwtOptions> jwtOptions,
             ILogger<UserController> logger, IDepartmentRepository departmentRepository, ILoginContext loginContext,
-            IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository)
+            IUserService userService, IFileLibraryRepository fileLibraryRepository, IDistributedCache cache, IUserLoginRepository userLoginRepository, IAddressBookGroupRepository addressBookGroupRepository, IAddressBookGroupUserRepository _addressBookGroupUserRepository,IFeedbackRepository _feedbackRepository)
         {
             _userRepository = userRepository;
             _departmentRepository = departmentRepository;
@@ -67,6 +70,7 @@ namespace GxPress.Api.WebControllers
             this.userLoginRepository = userLoginRepository;
             this.addressBookGroupRepository = addressBookGroupRepository;
             this._addressBookGroupUserRepository = _addressBookGroupUserRepository;
+            this._feedbackRepository=_feedbackRepository;
         }
         /// <summary>
         /// 登录
@@ -439,5 +443,22 @@ namespace GxPress.Api.WebControllers
         {
             return await _departmentRepository.GetDepartmentUserResultAsync(request);
         }
+        /// <summary>
+        /// 添加意见反馈
+        /// </summary>
+        /// <param name="request"></param>
+        /// /// <returns></returns>
+        [HttpPut("add-feedback")]
+        public async Task<bool> Add([FromBody] FeedbackInRequest request)
+        {
+            request.UserId = _loginContext.AccountId;
+            var feedback = new Feedback
+            {
+                UserId = request.UserId,
+                Content = request.Content,
+                FeedbackType = request.FeedbackType
+            };
+            return await _feedbackRepository.InsertAsync(feedback) > 0;
+        }
     }
 }

+ 38 - 0
gx_api/GxPress/Api/GxPress.Api/WebControllers/WebOrderController.cs

@@ -0,0 +1,38 @@
+using System.Threading.Tasks;
+using GxPress.Auth;
+using GxPress.Common.Page;
+using GxPress.Repository.Interface.Order;
+using GxPress.Request.Order;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace GxPress.Api.WebControllers
+{
+    /// <summary>
+    /// 导航
+    /// </summary>
+    [Route("api/web/order")]
+    [ApiController]
+    [Authorize]
+    public class WebOrderController : Controller
+    {
+        private readonly IOrderRepository orderRepository;
+        public readonly ILoginContext _loginContext;
+        public WebOrderController(IOrderRepository orderRepository, ILoginContext _loginContext)
+        {
+            this.orderRepository = orderRepository;
+            this._loginContext = _loginContext;
+        }
+        /// <summary>
+        /// 查询订单
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [HttpPost("page")]
+        public async Task<PagedList<Entity.Order.Order>> GetAllOrderAsync(OrderSearchRequest request)
+        {
+            request.UserId = _loginContext.AccountId;
+            return await orderRepository.GetAllOrderAsync(request);
+        }
+    }
+}