Files
QYZH.InteractiveMagazine/QYZH.InteractiveMagazine.WebApi/Controllers/WeChatController.cs

36 lines
1005 B
C#
Raw Normal View History

2026-06-01 13:42:40 +08:00
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using QYZH.InteractiveMagazine.IService;
using QYZH.InteractiveMagazine.IService.Dto;
using QYZH.InteractiveMagazine.Models.Dto;
namespace QYZH.InteractiveMagazine.WebApi.Controllers;
/// <summary>
/// 微信小程序控制器
/// </summary>
[Route("api/[controller]")]
[ApiController]
[AllowAnonymous]
public class WeChatController : BaseController
{
private readonly IWeChatMiniProgramService _weChatService;
public WeChatController(IWeChatMiniProgramService weChatService)
{
_weChatService = weChatService;
}
/// <summary>
/// 微信登录
/// </summary>
/// <param name="code">微信登录凭证</param>
/// <returns>微信登录结果</returns>
[HttpPost("login")]
public async Task<BaseResponse<WeChatLoginOutput>> WeChatLoginAsync([FromQuery] string code)
{
var result = await _weChatService.WeChatLoginAsync(code);
return Success(result);
}
}