using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CommonHelper;
using GasolineBlend.BLL;
namespace GasolineBlend.Controllers
{
public class SearchInfoController:BaseController
{
private QccSearchInfoBLL _acc = new QccSearchInfoBLL();
///
/// 获取用户搜索记录
///
///
[HttpPost]
public ActionResult GetSearchInfoList()
{
try
{
int UserId = OperatorProvider.Instance.Current==null? 0: OperatorProvider.Instance.Current.UserId;
var list = _acc.GetQccSearchInfoDistinctList(UserId);
return SuccessNoShow(data: list);
}
catch (Exception e)
{
LogHelper.Write(Level.Error, "获取用户搜索记录 GetSearchInfoList", e, OperatorProvider.Instance.Current==null?"GuestEx":OperatorProvider.Instance.Current.LoginName);
return Error();
}
}
///
/// 获取用户搜索记录
///
///
[HttpPost]
public ActionResult GetSearchPolicyList()
{
try
{
var list = _acc.GetSearchPolicyList();
return SuccessNoShow(data: list);
}
catch (Exception e)
{
LogHelper.Write(Level.Error, "获取用户搜索记录 GetSearchPolicyList", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName);
return Error();
}
}
///
/// 获取全局搜索记录
///
///
[HttpPost]
public ActionResult GetSearchInfoListAll()
{
try
{
int UserId = OperatorProvider.Instance.Current == null ? 0 : OperatorProvider.Instance.Current.UserId;
var list = _acc.GetQccSearchInfoDistinctList(UserId);
return SuccessNoShow(data: list);
}
catch (Exception e)
{
LogHelper.Write(Level.Error, "获取全局搜索记录 GetSearchInfoListAll", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName);
return Error();
}
}
}
}