43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using Dapper;
|
|
using NetCore.Model.enums;
|
|
using NetCore.Model.qw;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
namespace NetCore.BLL
|
|
{
|
|
public class hg_keyword_bll
|
|
{
|
|
private string comcode;
|
|
public hg_keyword_bll(string _comcode)
|
|
{
|
|
comcode = _comcode;
|
|
}
|
|
/// <summary>
|
|
/// 获取数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<hg_keyword> GetList()
|
|
{
|
|
using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode))
|
|
{
|
|
return con.Query<hg_keyword>("select keyword from hg_keyword where status=1", null, buffered: false).ToList();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 从配置中获取
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<hg_keyword> GetWordListByParameter()
|
|
{
|
|
using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode, false))
|
|
{
|
|
string st = con.Query<string>("select paravalue from bas_parameter where parakey='WeiXin_IllegalKewords'", null, buffered: false).First();
|
|
List<hg_keyword> list = st.Split(';').Where(m => !string.IsNullOrEmpty(m)).Select(m => new hg_keyword() { keyword = m }).ToList();
|
|
return list;
|
|
}
|
|
}
|
|
}
|
|
}
|