sunpengfei
2 小时以前 2370d9c2c36f6e132603a7674474489e82ae942c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace FlexJobApi.Core.Utils.WxmpUtils
{
    /// <summary>
    /// 微信小程序获取接口调用凭据
    /// </summary>
    public class WxmpGetAccessTokenRequest
    {
        /// <summary>
        /// 填写 client_credential
        /// </summary>
        [JsonProperty("grant_type")]
        public string GrantType { get; set; } = "client_credential";
 
        /// <summary>
        /// 小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态
        /// </summary>
        [JsonProperty("appid")]
        public string Appid { get; set; }
 
        /// <summary>
        /// 小程序唯一凭证密钥,即 AppSecret,获取方式同 appid
        /// </summary>
        [JsonProperty("secret")]
        public string Secret { get; set; }
    }
 
    /// <summary>
    /// 微信小程序获取接口调用凭据-结果
    /// </summary>
    public class WxmpGetAccessTokenResponse
    {
        /// <summary>
        /// 获取到的凭证
        /// </summary>
        [JsonProperty("access_token")]
        public string AccessToken { get; set; }
        /// <summary>
        /// 凭证有效时间,单位:秒。目前是7200秒之内的值。
        /// </summary>
        [JsonProperty("expires_in")]
        public int ExpiresIn { get; set; }
    }
}