Skip to content

Commit

Permalink
投稿工具添加合并词条功能,修改积分规则,修复标签编辑页面未显示编辑规范的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFish-233 committed Mar 25, 2022
1 parent 765645e commit 473c77d
Show file tree
Hide file tree
Showing 8 changed files with 560 additions and 123 deletions.
Expand Up @@ -1596,8 +1596,8 @@ public async Task UpdateUserIntegral(ApplicationUser user)
var signInDaysIntegral = 5;
var entryIntegral = 50;

var tagIntegral = entryIntegral;
var disambigIntegral = entryIntegral;
var tagIntegral = signInDaysIntegral * 6;
var disambigIntegral = signInDaysIntegral * 6;
var peripheryIntegral = entryIntegral;
var commentIntegral = signInDaysIntegral;
var commentLimited = 5;
Expand Down
Expand Up @@ -136,41 +136,24 @@ public async Task<ActionResult<Entry>> GetEntryDataAsync(int id)
/// <summary>
/// 通过Id获取为页面显示优化后的词条信息
/// </summary>
/// <param name="_id"></param>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{_id}")]
[HttpGet("{id}")]
[AllowAnonymous]
// [Authorize]
public async Task<ActionResult<EntryIndexViewModel>> GetEntryViewAsync(string _id)
public async Task<ActionResult<EntryIndexViewModel>> GetEntryViewAsync(int id)
{
//获取当前用户ID
var user = await _appHelper.GetAPICurrentUserAsync(HttpContext);
//通过Id获取词条
Entry entry = null;
try
{
var id = -1;
id = int.Parse(_id);
entry = await _entryRepository.GetAll().Include(s => s.Disambig)
Entry entry= await _entryRepository.GetAll().Include(s => s.Disambig)
.Include(s => s.Outlinks)
.Include(s => s.EntryRelationFromEntryNavigation).ThenInclude(s => s.ToEntryNavigation).ThenInclude(s => s.Information).ThenInclude(s => s.Additional)
.Include(s => s.EntryRelationFromEntryNavigation).ThenInclude(s => s.ToEntryNavigation).ThenInclude(s => s.EntryRelationFromEntryNavigation).ThenInclude(s => s.ToEntryNavigation)
.Include(s => s.Articles).ThenInclude(s => s.CreateUser)
.Include(s => s.Articles).ThenInclude(s => s.Entries)
.Include(s => s.Information).ThenInclude(s => s.Additional).Include(s => s.Tags).Include(s => s.Pictures)
.AsSplitQuery().FirstOrDefaultAsync(x => x.Id == id);
}
catch (Exception)
{
entry = await _entryRepository.GetAll().Include(s => s.Disambig)
.Include(s => s.Outlinks)
.Include(s => s.EntryRelationFromEntryNavigation).ThenInclude(s => s.ToEntryNavigation).ThenInclude(s => s.Information).ThenInclude(s => s.Additional)
.Include(s => s.EntryRelationFromEntryNavigation).ThenInclude(s => s.ToEntryNavigation).ThenInclude(s => s.EntryRelationFromEntryNavigation).ThenInclude(s => s.ToEntryNavigation)
.Include(s => s.Articles).ThenInclude(s => s.CreateUser)
.Include(s => s.Articles).ThenInclude(s => s.Entries)
.Include(s => s.Information).ThenInclude(s => s.Additional).Include(s => s.Tags).Include(s => s.Pictures)
.AsSplitQuery().FirstOrDefaultAsync(x => x.Name == ToolHelper.Base64DecodeName(_id));
}


if (entry == null)
{
Expand Down Expand Up @@ -1363,5 +1346,13 @@ public async Task<ActionResult<List<GameRoleModel>>> GetGameRolesAsync()

return model;
}

[AllowAnonymous]
[HttpGet("{name}")]
public async Task<ActionResult<int>> GetId(string name)
{
var name_=ToolHelper.Base64DecodeName(name);
return await _entryRepository.GetAll().AsNoTracking().Where(s => s.Name == name_).Select(s => s.Id).FirstOrDefaultAsync();
}
}
}
Expand Up @@ -205,7 +205,7 @@ public class StaffNameModel
/// </summary>
public string DisplayName { get; set; }

public long Id { get; set; }
public int Id { get; set; }
}

public class InformationsModel
Expand Down
14 changes: 7 additions & 7 deletions CnGalWebSite/CnGalWebSite.Helper/Helper/ToolHelper.cs
Expand Up @@ -798,13 +798,13 @@ public static int GetLevelIntegral(int level)
0 => 5,
1 => 50,
2 => 200,
3 => 600,
4 => 1500,
5 => 2800,
6 => 4500,
7 => 7800,
8 => 15000,
9 => 30000,
3 => 500,
4 => 1000,
5 => 2000,
6 => 3500,
7 => 6000,
8 => 10000,
9 => 99999999,
10 => 99999999,
_ => -1,
};
Expand Down

0 comments on commit 473c77d

Please sign in to comment.