2025-06-06 14:57:20 +08:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using YD_WeChatApplet.Commons;
|
|
|
|
using YD_WeChatApplet.Services;
|
|
|
|
using YD_WeChatApplet.WeChat.Lib;
|
|
|
|
using YD_WeChatApplet.WeChat;
|
|
|
|
using TGJ.NetworkFreight.SeckillAggregateServices.Pos.UserService;
|
|
|
|
using YD_WeChatApplet.Api.Utilities;
|
|
|
|
using System.Net.Http;
|
|
|
|
using YD_WeChatApplet.Api.Entitys;
|
|
|
|
using YD_WeChatApplet.Commons.Users;
|
|
|
|
using YD_WeChatApplet.Commons.Dto.Teacher;
|
|
|
|
using YD_WeChatApplet.Commons.Dto;
|
|
|
|
using YD_WeChatApplet.Api.Services.Impl;
|
|
|
|
using YD_WeChatApplet.Commons.Dto.User;
|
|
|
|
using YD_WeChatApplet.Commons.Dto.Server;
|
|
|
|
using System.Security.AccessControl;
|
|
|
|
|
|
|
|
namespace YD_WeChatApplet.Controllers
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// 服务
|
|
|
|
/// </summary>
|
|
|
|
[ApiController]
|
|
|
|
[ApiExplorerSettings(GroupName = "v1")]
|
|
|
|
[Route("[controller]")]
|
|
|
|
public class ServerController : ControllerBase
|
|
|
|
{
|
|
|
|
private readonly IServerService _serverService;
|
|
|
|
public ServerController(IServerService serverService)
|
|
|
|
{
|
|
|
|
_serverService = serverService;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取打卡详情
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpGet("GetPersonalGoalInfo")]
|
2025-07-17 13:10:49 +08:00
|
|
|
public async Task<PageDataDto<PersonalGoalInfoDto>> GetPersonalGoalInfo([FromQuery]PersonalGoalInfoReqDto req)
|
2025-06-06 14:57:20 +08:00
|
|
|
{
|
|
|
|
return await _serverService.GetPersonalGoalInfo(req);
|
|
|
|
}
|
|
|
|
|
2025-07-17 13:10:49 +08:00
|
|
|
/// <summary>
|
|
|
|
/// 获取用户训练记录
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpGet("GetUserTrainingRecords")]
|
|
|
|
public async Task<PageDataDto<UserTrainingRecordsDto>> GetUserTrainingRecords([FromQuery]UserTrainingRecordsReqDto req)
|
|
|
|
{
|
|
|
|
return await _serverService.GetUserTrainingRecords(req);
|
|
|
|
}
|
|
|
|
|
2025-06-06 14:57:20 +08:00
|
|
|
/// <summary>
|
|
|
|
/// 获取资源类型树
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>资源类型树形结构</returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpGet("GetResourceTypeTree")]
|
|
|
|
public async Task<List<B_ResourceTypeTreeDto>> GetResourceTypeTree()
|
|
|
|
{
|
|
|
|
return await _serverService.GetResourceTypeTree();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取资源列表
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req">请求参数</param>
|
|
|
|
/// <returns>资源列表</returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpGet("GetResourceList")]
|
|
|
|
public async Task<PageDataDto<B_ResourceDetailsDto>> GetResourceList([FromQuery]ResourceListReqDto req)
|
|
|
|
{
|
|
|
|
return await _serverService.GetResourceList(req);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 添加或更新资源类型
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req">资源类型信息</param>
|
|
|
|
/// <returns>操作结果</returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpPost("AddOrUpdateResourceType")]
|
|
|
|
public async Task<bool> AddOrUpdateResourceType([FromBody]ResourceTypeReqDto req)
|
|
|
|
{
|
|
|
|
return await _serverService.AddOrUpdateResourceType(req);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 删除资源类型
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">资源类型ID</param>
|
|
|
|
/// <returns>操作结果</returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpPost("DeleteResourceType/{id}")]
|
|
|
|
public async Task<bool> DeleteResourceType(int id)
|
|
|
|
{
|
|
|
|
return await _serverService.DeleteResourceType(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 添加或更新资源
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req">资源信息</param>
|
|
|
|
/// <returns>操作结果</returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpPost("AddOrUpdateResource")]
|
|
|
|
public async Task<bool> AddOrUpdateResource([FromBody]ResourceReqDto req)
|
|
|
|
{
|
|
|
|
return await _serverService.AddOrUpdateResource(req);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 删除资源
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">资源ID</param>
|
|
|
|
/// <returns>操作结果</returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpPost("DeleteResource/{id}")]
|
|
|
|
public async Task<bool> DeleteResource(int id)
|
|
|
|
{
|
|
|
|
return await _serverService.DeleteResource(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 上传头像
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="file"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpPost("UploadResourceFile")]
|
|
|
|
public async Task<string> UploadResourceFile([FromForm] ResourceFileDto resourceFileDto)
|
|
|
|
{
|
|
|
|
var url = await _serverService.UploadResourceFile(resourceFileDto);
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取微信用户
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="paramDto"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("GetUserPageList")]
|
|
|
|
public async Task<PageDataDto<UserPageListDto>> GetUserPageList([FromQuery] UserPageListParam paramDto)
|
|
|
|
{
|
|
|
|
return await _serverService.GetUserPageList(paramDto);
|
|
|
|
}
|
2025-07-17 13:10:49 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取智慧体育用户管理页面数据(员工数据)
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="paramDto"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpGet("GetSmartSportsUserPageList")]
|
|
|
|
public async Task<PageDataDto<SmartSportsUserDto>> GetSmartSportsUserPageList([FromQuery] SmartSportsUserParam paramDto)
|
|
|
|
{
|
|
|
|
return await _serverService.GetSmartSportsUserPageList(paramDto);
|
|
|
|
}
|
2025-06-06 14:57:20 +08:00
|
|
|
}
|
|
|
|
}
|