OAuthUserInfo.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #region Apache License Version 2.0
  2. /*----------------------------------------------------------------
  3. Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. except in compliance with the License. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software distributed under the
  8. License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  9. either express or implied. See the License for the specific language governing permissions
  10. and limitations under the License.
  11. Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
  12. ----------------------------------------------------------------*/
  13. #endregion Apache License Version 2.0
  14. /*----------------------------------------------------------------
  15. Copyright (C) 2019 Senparc
  16. 文件名:OAuthUserInfo.cs
  17. 文件功能描述:通过OAuth的获取到的用户信息
  18. 创建标识:Senparc - 20150211
  19. 修改标识:Senparc - 20150303
  20. 修改描述:整理接口
  21. ----------------------------------------------------------------*/
  22. namespace Senparc.Weixin.MP.AdvancedAPIs.OAuth
  23. {
  24. /// <summary>
  25. /// 通过OAuth的获取到的用户信息(snsapi_userinfo=scope)
  26. /// </summary>
  27. public class OAuthUserInfo
  28. {
  29. /// <summary>
  30. /// 用户的唯一标识
  31. /// </summary>
  32. public string openid { get; set; }
  33. /// <summary>
  34. /// 用户昵称
  35. /// </summary>
  36. public string nickname { get; set; }
  37. /// <summary>
  38. /// 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
  39. /// </summary>
  40. public int sex { get; set; }
  41. /// <summary>
  42. /// 用户个人资料填写的省份
  43. /// </summary>
  44. public string province { get; set; }
  45. /// <summary>
  46. /// 普通用户个人资料填写的城市
  47. /// </summary>
  48. public string city { get; set; }
  49. /// <summary>
  50. /// 国家,如中国为CN
  51. /// </summary>
  52. public string country { get; set; }
  53. /// <summary>
  54. /// 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空
  55. /// </summary>
  56. public string headimgurl { get; set; }
  57. /// <summary>
  58. /// 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom)
  59. /// 作者注:其实这个格式称不上JSON,只是个单纯数组。
  60. /// </summary>
  61. public string[] privilege { get; set; }
  62. /// <summary>
  63. /// 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。详见:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&amp;t=resource/res_list&verify=1&amp;lang=zh_CN
  64. /// </summary>
  65. public string unionid { get; set; }
  66. }
  67. }