init commit

This commit is contained in:
路 范
2022-03-30 17:54:33 +08:00
parent df01841625
commit 904bdd16cd
500 changed files with 217251 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using Furion.DependencyInjection;
using RoadFlow.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RoadFlow.Data
{
public class FlowComment:RoadFlowRepository<RoadFlow.Model.rf_flowcomment>,IFlowComment, ITransient
{
/// <summary>
/// 得到一个用户可以使用的意见
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public List<Model.rf_flowcomment> GetListByUserId(string userId)
{
var all = GetAll();
return all.FindAll(p => p.UserId == string.Empty || p.UserId == userId).Distinct(new Model.rf_flowcomment()).OrderBy(p => p.AddType).ToList();
}
/// <summary>
/// 查询一页数据
/// </summary>
/// <param name="count"></param>
/// <param name="size"></param>
/// <param name="number"></param>
/// <param name="comment"></param>
/// <param name="userId"></param>
/// <param name="order"></param>
/// <returns></returns>
public List<Model.rf_flowcomment> GetPagerList(out int count, int size, int number, string comment, string userId, string order)
{
int total = 0;
var rtn =db.Queryable<Model.rf_flowcomment>()
.WhereIF(!comment.IsNullOrWhiteSpace(), x => x.Comments.Contains(comment))
.WhereIF(userId.IsGuid(), x => x.UserId == userId)
.OrderByIF(!order.IsNullOrWhiteSpace(), order)
.ToPageList(number, size, ref total);
count = total;
return rtn;
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RoadFlow.Data
{
public interface IFlowComment : IRoadFlowRepository<RoadFlow.Model.rf_flowcomment>
{
/// <summary>
/// 得到一个用户可以使用的意见
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public List<Model.rf_flowcomment> GetListByUserId(string userId);
/// <summary>
/// 查询一页数据
/// </summary>
/// <param name="count"></param>
/// <param name="size"></param>
/// <param name="number"></param>
/// <param name="comment"></param>
/// <param name="userId"></param>
/// <param name="order"></param>
/// <returns></returns>
public List<Model.rf_flowcomment> GetPagerList(out int count, int size, int number, string comment, string userId, string order);
}
}