添加项目文件。
This commit is contained in:
@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user