mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:03:27 +08:00
【优化】优化接口端新增加的几个controller的,增加httppost或者httpget的属性,防止swagger生成文档检测失败的情况。
This commit is contained in:
@@ -31,7 +31,7 @@ namespace CoreCms.Net.Web.Controllers.WeChat
|
||||
/// <summary>
|
||||
/// 微信公众号消息推送对接
|
||||
/// </summary>
|
||||
public class WeChatOffiaccountNotifyController : Controller
|
||||
public class WeChatOffiaccountNotifyController : ControllerBase
|
||||
{
|
||||
private readonly IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
private readonly WeChatOptions _weChatOptions;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CoreCms.Net.Web.Controllers.WeChat
|
||||
/// <summary>
|
||||
/// 微信公众号用户授权事件
|
||||
/// </summary>
|
||||
public class WeChatOffiaccountOAuth2Controller : Controller
|
||||
public class WeChatOffiaccountOAuth2Controller : ControllerBase
|
||||
{
|
||||
//private readonly string _weChatAppId = AppSettingsConstVars.WeiXinAppId;
|
||||
//private readonly string _weChatSecret = AppSettingsConstVars.WeiXinAppSecret;
|
||||
@@ -48,6 +48,7 @@ namespace CoreCms.Net.Web.Controllers.WeChat
|
||||
/// <param name="state"></param>
|
||||
/// <param name="bkUrl"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> UserInfoCallback(string code, string state, string bkUrl)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
/// </summary>
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class WeChatOffiaccountController : Controller
|
||||
public class WeChatOffiaccountController : ControllerBase
|
||||
{
|
||||
private readonly IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
private readonly WeChatOptions _weChatOptions;
|
||||
@@ -55,7 +55,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var signatureStr = "jsapi_ticket=" + jsApiTicket + "&noncestr=" + nonceStr + "×tamp=" + timestamp + "&url=" + url;
|
||||
var signature = CoreCms.Net.Utility.Helper.CommonHelper.Sha1Signature(signatureStr);
|
||||
|
||||
return Json(new
|
||||
return new JsonResult(new
|
||||
{
|
||||
jsApiTicket,
|
||||
appId = _weChatOptions.WeiXinAppId,
|
||||
@@ -71,6 +71,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> Send(TmpMsgModel model)
|
||||
{
|
||||
try
|
||||
@@ -144,12 +145,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
var response = await client.ExecuteCgibinMessageTemplateSendAsync(request, HttpContext.RequestAborted);
|
||||
return response.ErrorCode != (int)WeChatReturnCode.ReturnCode.请求成功
|
||||
? Json(new { ResultCode = "1", Msg = "错误:" + response.ErrorMessage })
|
||||
: Json(new { ResultCode = "0", Msg = "已发送成功", Data = response.MessageId });
|
||||
? new JsonResult(new { ResultCode = "1", Msg = "错误:" + response.ErrorMessage })
|
||||
: new JsonResult(new { ResultCode = "0", Msg = "已发送成功", Data = response.MessageId });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Json(new { ResultCode = "1", Msg = ex.ToString() });
|
||||
return new JsonResult(new { ResultCode = "1", Msg = ex.ToString() });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user