Merge branch 'master' of http://8.137.159.94:3000/glz/QYZH.InteractiveMagazine
This commit is contained in:
@ -238,8 +238,7 @@ public class UserAnswerTaskController : WeChatBaseController
|
||||
public async Task<BaseResponse<BatchClaimPointsOutput>> BatchClaimPointsAsync([FromBody] BatchClaimPointsInput input)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
{
|
||||
var userId = GetCurrentUserId();
|
||||
if (userId == 0)
|
||||
{
|
||||
@ -265,4 +264,35 @@ public class UserAnswerTaskController : WeChatBaseController
|
||||
return BaseResponse<BatchClaimPointsOutput>.Fail("批量领取积分失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取目录树形结构(一级目录和二级目录的完整树形结构,包含任务详情)
|
||||
/// </summary>
|
||||
/// <param name="journalId">期刊Id</param>
|
||||
/// <returns>目录树形结构数据</returns>
|
||||
[HttpGet("catalog-tree/{journalId:long}")]
|
||||
public async Task<BaseResponse<CatalogTreeOutput>> GetCatalogTreeAsync([Required(ErrorMessage = "参数错误")] long journalId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var userId = ConstUserId;//GetCurrentUserId();
|
||||
if (userId == 0)
|
||||
{
|
||||
return BaseResponse<CatalogTreeOutput>.Fail(ResultCode.DENY, "未获取到用户信息");
|
||||
}
|
||||
|
||||
if (journalId <= 0)
|
||||
{
|
||||
return BaseResponse<CatalogTreeOutput>.Fail(ResultCode.PARAM_ERROR, "期刊Id不能为空");
|
||||
}
|
||||
|
||||
var result = await _userAnswerTaskService.GetCatalogTreeAsync(journalId, userId);
|
||||
return Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "获取目录树形结构失败,JournalId: {JournalId}, UserId: {UserId}", journalId, GetCurrentUserId());
|
||||
return BaseResponse<CatalogTreeOutput>.Fail("获取目录树形结构失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Auth;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Context;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Enum;
|
||||
using System.Security.Claims;
|
||||
|
||||
Reference in New Issue
Block a user