|
@@ -792,17 +792,17 @@ namespace GxPress.Service.Implement.Middle
|
|
|
/// <returns></returns>
|
|
|
public async Task<MiddleDefaultResult> GetEnjoyDefaultAsync(int userId, int folderType)
|
|
|
{
|
|
|
- // var middle = await _middleRepository.GetMiddleAsync(Q.Where(nameof(Entity.Middle.Middle.UserId), userId).WhereIn(nameof(Entity.Middle.Middle.RoleId), new List<int> { 1, 3 }).Where(nameof(Entity.Middle.Middle.IsDefault), true));
|
|
|
- // var result = new MiddleDefaultResult();
|
|
|
- // result.IsDefault = middle != null;
|
|
|
- // result.FolderName = middle == null ? "" : middle.FolderName;
|
|
|
- // result.MiddleId = middle == null ? 0 : middle.Id;
|
|
|
var recordFolder = await recordFolderRepository.GetAsync(folderType, userId);
|
|
|
var result = new MiddleDefaultResult();
|
|
|
//获取笔记默认
|
|
|
if (recordFolder.Id == 0 && folderType == AllTypeConst.TopicNote.GetHashCode())
|
|
|
{
|
|
|
- var middle = await _middleRepository.GetMiddleAsync(Q.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Note.GetHashCode()).Where(nameof(Entity.Middle.Middle.AttributeValue), 2).Where(nameof(Entity.Middle.Middle.IsSystemDefault), true).Where(nameof(Entity.Middle.Middle.UserId), userId));
|
|
|
+ var query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.FolderType), folderType);
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.AttributeValue), 2);
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.IsSystemDefault), true);
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.UserId), userId);
|
|
|
+ var middle = await _middleRepository.GetMiddleAsync(query);
|
|
|
result.IsDefault = middle != null ? middle.IsSystemDefault : false;
|
|
|
result.FolderName = middle != null ? middle.FolderName : "";
|
|
|
result.FolderType = middle != null ? middle.FolderType : 0;
|