初始提交

This commit is contained in:
wanyongkang
2020-10-07 20:25:03 +08:00
commit d318014316
3809 changed files with 263103 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
using Hncore.Pass.Vpn.Service;
using Home.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Hncore.Infrastructure.Extension;
namespace Home.Controllers
{
public class HomeController : MvcBaseController
{
ProductService m_ProductService;
ArticleService m_ArticleService;
ProductOrderService m_ProductOrderService;
public HomeController(ProductService _ProductService, ArticleService _ArticleService, ProductOrderService _ProductOrderService)
{
m_ProductService = _ProductService;
m_ArticleService = _ArticleService;
m_ProductOrderService = _ProductOrderService;
}
[Route("/")]
public async Task<IActionResult> Index()
{
var prodectList=await m_ProductService.Query(m=>m.OnLine==1).ToListAsync();
var model = prodectList.MapsTo<ProductModel>();
return View(model);
}
[Route("/h")]
public IActionResult Test()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
[Route("/Test1")]
public async Task Test1()
{
await m_ProductOrderService.TestProcessOrderAccount();
}
}
}