using JCSoft.WX.Framework.Api; using JCSoft.WX.Framework.Models; using JCSoft.WX.Framework.Models.ApiRequests; using JCSoft.WX.Framework.Models.ApiResponses; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Memory; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SupplierWeb.Controllers { [Route("api/menuCreate")] public class MenuCreateController : BaseApiController { public MenuCreateController(IMemoryCache cache, IApiClient client) : base(cache, client) { } protected override ApiRequest GetApiRequest() { return new MenuCreateRequest { Buttons = new List { //new ClickButton //{ // Type = ClickButtonType.click, // Name = "关注我", // Key = "Key_Follow_Me" //}, new ClickButton { Type = ClickButtonType.view, Url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdc3ee459a9b8f109&redirect_uri=http://119.27.191.247/web/supplymobile/bindphone&response_type=code&scope=snsapi_base#wechat_redirect", Name = "绑定手机号" }, new ClickButton { Name="主菜单", SubButton = new List { //new ClickButton //{ // Type = ClickButtonType.scancode_push, // Name = "扫一扫", // Key = "Event_Scan" //}, //new ClickButton //{ // Type = ClickButtonType.pic_sysphoto, // Name = "系统拍照发图", // Key = "Event_SysPhoto" //}, //new ClickButton //{ // Type = ClickButtonType.pic_weixin, // Name = "微信相册发图", // Key = "Event_Pic_WeiXin" //}, new ClickButton { Type = ClickButtonType.location_select, Name = "发送位置", Key = "Event_Location_Select" } } } }, AccessToken = AccessToken }; } } }