You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Threading.Tasks;
|
|
using Znyc.Recruitment.Common.Output;
|
|
using Znyc.Recruitment.Controllers;
|
|
using Znyc.Recruitment.Service;
|
|
|
|
namespace Znyc.Recruitment.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 支付服务
|
|
/// </summary>
|
|
public class WxPayController : BaseController
|
|
{
|
|
private readonly IAuthService _authService;
|
|
|
|
public WxPayController(IAuthService authService)
|
|
{
|
|
_authService = authService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 微信小程序支付
|
|
/// </summary>
|
|
/// <param name="productId">商品Id</param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[AllowAnonymous]
|
|
[Route("api/v1/wxpay/{productId}")]
|
|
public Task<IResponseOutput> WxPay(long productId)
|
|
{
|
|
return _authService.WxPay(productId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 微信小程序支付回调
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[AllowAnonymous]
|
|
[Route("api/v1/wxpay/notify")]
|
|
|
|
public Task<string> NotifyUrl()
|
|
{
|
|
return _authService.NotifyUrl();
|
|
}
|
|
}
|
|
}
|