[关闭]
@a5635268 2018-03-06T13:30:00.000000Z 字数 10507 阅读 3878

电竞接口文档

接口文档


  • 参数默认都是必传的,非必传的会有说明

  • 都是通过POST方式请求

  • 成功的status状态都为0

会员

发送验证码

api

http://gameapi.chamshare.cn/member/Publics/sendSms

params

{"mobile" : "18221998888"}

response

  1. {
  2. "status": 5,
  3. "data": [],
  4. "message": "手机号码格式不正确"
  5. }

获取微信用户数据

api

http://gameapi.chamshare.cn/member/Publics/getWxInfo

params

  1. {
  2. "code": "asdf",
  3. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. // 微信的那堆用户数据
  5. },
  6. "message": "调用成功"
  7. }

会员注册

api

http://gameapi.chamshare.cn/member/Publics/register

params

  1. {
  2. "open_id": "N5Jh)@8cyefL)+UAc5?7s&kfPcl*7*AM<K%PE(%JK*z4ivhA@E",
  3. "nickname": "微信昵称",
  4. "avatar": "微信头像",
  5. "mobile": "17947654687",
  6. "sex": 1 //1男2女,通过接口获得
  7. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "token": "386bXzjJW/hCecyJtniMLYr4nRVqynnNdArTZzQsAw"
  5. "team_id": 1,
  6. "role": 0 // 0吃瓜群众 1队长 2副队长 3队员
  7. },
  8. "message": "调用成功"
  9. }

会员登录

api

http://gameapi.chamshare.cn/member/Publics/login

params

  1. // 因为前端用了vue,其实这里也就是通过openid换取token的过程
  2. // 前端得到token以后存在session里面,过期之后再去请求微信接口得到以下数据来换取token
  3. {
  4. "open_id": "jVc*Wg9*i4CND:at]r={XXDB&x]<6T3E6z17+s/egc(NA?l73u",
  5. "nickname": "微信昵称", // 未免用户在微信端更新了自己的头像和昵称,所以再登录的时候同步一下;
  6. "avatar": "微信头像"
  7. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "token": "386bXzjJW/hCecyJtniMLYr4nRVqynnNdArTZzQsAw"
  5. "team_id": 1,
  6. "role": 0 // 0吃瓜群众 1队长 2副队长 3队员
  7. },
  8. "message": "调用成功"
  9. }

个人资料完善

api

http://gameapi.chamshare.cn/member/Member/profile

params

  1. {
  2. "token": "token",
  3. "realname": "周孝刚2",
  4. "idcard": "522730198802020056" //身份证号
  5. }

我的战绩 [todo]

数据太难造了,等测试的时候,直接读出来吧

我的关注

api

http://gameapi.chamshare.cn/member/Member/myConcern

params

  1. {
  2. "token": "kkkk",
  3. "page": 1, // 默认
  4. "page_size": 20, //默认
  5. "type" // 0所有,1未开始,2进行中,3已结束
  6. }

返回值和赛程列表一模一样

我的比赛

api

http://gameapi.chamshare.cn/member/Member/myMatch

params

  1. {
  2. "token": "kkkk",
  3. "page": 1, // 默认
  4. "page_size": 20, //默认
  5. "type": 1, // 1待审核,2待比赛,3已结束
  6. }

返回值和赛程列表一模一样,上面的状态值自己添加(选择的时候就已经知道是什么状态了)

我的报名

api

http://gameapi.chamshare.cn/member/Member/myApply

params

  1. {
  2. "token": "kkkk",
  3. }

response

  1. {
  2. "status": 0,
  3. "data": [
  4. {
  5. "apply_id": 1,
  6. "squad_id": 3,
  7. "event_id": 3,
  8. "event_name": "电竞跨年吃鸡夜",
  9. "banner": "http://gamemp.chamshare.cn/d/file/content/2017/12/5a40c55100794.jpg",
  10. "apply_status": 2, // 报名状态 1,正在进行中,2未开始,3已结束
  11. "confirm_status": 0, // 0未审核 1已审核
  12. "apply_status_text": "报名未开始"
  13. }
  14. ],
  15. "message": "调用成功"
  16. }

添加评论

api

http://gameapi.chamshare.cn/member/Member/addComment

params

  1. {
  2. "token": "kkkk",
  3. "object_id": 1, // 赛事或赛程ID
  4. "comment_type": 2, // 评论类型, 1: 赛事. 2: 赛程
  5. "content": "hahahahahah"
  6. }

关注赛事

api

http://gameapi.chamshare.cn/member/Member/concernCourse

params

  1. {
  2. "token": "kkkk",
  3. "course_id": 1, // 赛程ID
  4. }

取消关注

api

http://gameapi.chamshare.cn/member/Member/unfollowCourse

params

  1. {
  2. "token": "kkkk",
  3. "course_id": 1, // 赛程ID
  4. }

评论列表

api

http://gameapi.chamshare.cn/member/Member/commentList

params

  1. {
  2. "token": "kkkk",
  3. "object_id": 1, // 赛事或赛程ID
  4. "comment_type": 2 // 评论类型, 1: 赛事. 2: 赛程
  5. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "count": 5,
  5. "list": [
  6. {
  7. "comment_id": 5,
  8. "member_id": 11,
  9. "content": "hahahahahah",
  10. "create_time": "2017-11-15 17:02:48",
  11. "nickname": "gangge",
  12. "avatar": "取配置的链接" //头像
  13. }
  14. ]
  15. },
  16. "message": "调用成功"
  17. }

战队

战队列表

api

http://gameapi.chamshare.cn/Member/Team/query

params

  1. // 可以加page_size来限制取出个数,用于首页

response

  1. {
  2. "team_id": 5,
  3. "team_name": "WE",
  4. "team_leader_id": 11, // 队长ID
  5. "nationality": "中国",
  6. "logo": "http://game.chamshare.cn/static/image/skt.png",
  7. "introduce": "WE,一只有强大底蕴的战队", //介绍
  8. "notice": "公告公告公告公告公告公告公告公告公告公告公告公告公告",
  9. "team_leader_name": "gangge"
  10. }

检查审核成功

api

http://gameapi.chamshare.cn/Member/TeamOperate/checkJoin

params

  1. // token

我的战队

api

http://gameapi.chamshare.cn/Member/TeamOperate/myTeam

params

  1. {
  2. "token": "token"
  3. }

response

  1. {
  2. "team_id": 5,
  3. "team_name": "WE",
  4. "team_leader_id": 11, // 队长ID
  5. "nationality": "中国",
  6. "logo": "http://game.chamshare.cn/static/image/skt.png",
  7. "introduce": "WE,一只有强大底蕴的战队", //介绍
  8. "notice": "公告公告公告公告公告公告公告公告公告公告公告公告公告",
  9. "team_leader_name": "gangge"
  10. }

战队创建

api

http://gameapi.chamshare.cn/Member/TeamOperate/build

params

  1. {
  2. "token": "token",
  3. "team_name": "战队名称",
  4. "logo": "logo地址",
  5. "introduce": "战队描述"
  6. }

战队战绩 [todo]

数据太难造了,等测试的时候,直接读出来吧

上传战队图标

api

http://gameapi.chamshare.cn/Member/TeamOperate/uploadLogo

params

  1. {
  2. "token": "token"
  3. }

加入战队

api

http://gameapi.chamshare.cn/Member/TeamOperate/join

params

  1. {
  2. "token": "token",
  3. "team_id": "战队ID"
  4. }

修改战队信息

api

http://gameapi.chamshare.cn/Member/TeamOperate/editInfo

params

  1. {
  2. "token": "token",
  3. "team_id": 5,
  4. "team_name": "战队名称222",
  5. "introduce": "战队简介",
  6. "logo" : "战队图标"
  7. }

修改战队公告

api

http://gameapi.chamshare.cn/Member/TeamOperate/editNotice

params

  1. {
  2. "token": "token",
  3. "team_id": 5,
  4. "notice": "战队名称222"
  5. }

转让队长

api

http://gameapi.chamshare.cn/Member/TeamOperate/transfer

params

  1. {
  2. "token": "token",
  3. "to_member_id": 11, // 要转让给的人
  4. }

当前战队副队长查询

api

http://gameapi.chamshare.cn/Member/TeamOperate/viceCaptainTotal

params

  1. {
  2. "token": "token",
  3. "team_id": 5,
  4. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "count": 0 //副队长人数
  5. },
  6. "message": "调用成功"
  7. }

提升为副队长

api

http://gameapi.chamshare.cn/Member/TeamOperate/promote

params

  1. {
  2. "token": "token",
  3. "to_member_id": 11, // 提升谁
  4. }

将为普通队员

api

http://gameapi.chamshare.cn/Member/TeamOperate/demotion

params

  1. {
  2. "token": "token",
  3. "to_member_id": 11, // 降谁
  4. }

开除战队资格

api

http://gameapi.chamshare.cn/Member/TeamOperate/expel

params

  1. {
  2. "token": "token",
  3. "to_member_id": 11, // 开除谁
  4. }

审核为战队队员

api

http://gameapi.chamshare.cn/Member/TeamOperate/confirm

params

  1. {
  2. "token": "token",
  3. "to_member_id": 15, // 审核谁
  4. }

战队的队员列表

api

http://gameapi.chamshare.cn/Member/TeamOperate/teamMemberList

params

  1. {
  2. "token": "token",
  3. "team_id": 15, // 战队ID
  4. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "count": 1,
  5. "list": [
  6. {
  7. "member_id": 11,
  8. "team_id": 5, //战队ID
  9. "role": 1, // 角色ID 1队长 2副队长 3队员
  10. "nickname": "gangge",
  11. "logo": "配置地址logo地址",
  12. "role_confirm_status": 0 //审核状态: 0是未审核 1是已审核
  13. }
  14. ]
  15. },
  16. "message": "调用成功"
  17. }

当前战队的近期赛程

api

http://gameapi.chamshare.cn/event/Course/query

params

  1. // 都非必传
  2. {
  3. "token": sadfasdf,
  4. "team_id": ,
  5. "is_recent": 1,
  6. }

战队招募

api

http://gameapi.chamshare.cn/Member/TeamOperate/recruit

params

  1. {
  2. "token": sadfasdf,
  3. "url": '当前页面的URL',
  4. }

赛事

赛事列表

api

http://gameapi.chamshare.cn/event/Event/listForFront

params

  1. // 都非必传
  2. {
  3. "game_id": 2, //非必传
  4. }

response

  1. {
  2. "status": 0,
  3. "data": [
  4. {
  5. "event_id": 2,
  6. "event_name": "事件名称",
  7. "logo": "配置地址赛事logo",
  8. "state": 1, // 1进行中,2未开始,3已结束
  9. "apply_state": 0 // 报名状态 1进行中
  10. }
  11. ],
  12. "message": "调用成功"
  13. }

赛事详情

api

http://gameapi.chamshare.cn/event/Event/detail

params

  1. {
  2. "event_id": 1,
  3. }

response

  1. // my_opponent : 我的对手

奖金列表

api

http://gameapi.chamshare.cn/event/Contest/bonusList

params

  1. {
  2. "contest_id": 1,
  3. }

response

  1. `bonus_name` '奖项名称',
  2. `allowe_num` '奖项名额',
  3. `award` '奖励'

赛程

赛程列表

api

http://gameapi.chamshare.cn/event/Course/query

params

  1. {
  2. "token": 'sadfasdf',
  3. "event_id": 1,
  4. "game_id": 1,
  5. "page": 1,
  6. "page_size": 1,
  7. "is_recent": 1 //是否取最近的,1是 是的话就只取开始时间大于现在的
  8. }

response

  1. {
  2. "course_id": 16,
  3. "course_name": "比赛",
  4. "squad_id": 15, // 分组
  5. "video": "videovideovideo", // 视频
  6. "object_id1": 6, //战队或队员ID
  7. "object_id2": 12,
  8. "score1": -1, //比分,-1是弃权
  9. "score2": 0,
  10. "apply_type": 1, //战队或队员
  11. "is_over": 0, // 是否已结束 1是0否
  12. "event_logo": "配置地址/d/file/content/2017/11/5a1294f5f3984.jpg", // 赛事id
  13. "tournament_name": "1v1单挑赛",
  14. "event_start_time": "2017-11-27 18:21:16",
  15. "object_id1_logo": "http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIjz2mMk3ibWhFcycgyGP5uN3ml2icPKqRnNKdkoazQIVZt3z41YSEv8JTKWLMvrXK3ibSIibcUPQfQpA/0", // 战队或队员LOGO
  16. "object_id2_logo": "http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIjz2mMk3ibWhFcycgyGP5uN3ml2icPKqRnNKdkoazQIVZt3z41YSEv8JTKWLMvrXK3ibSIibcUPQfQpA/0",
  17. "object_id1_name": "清风未醉", // 战队或队员名称
  18. "object_id2_name": "清风未醉",
  19. "is_follow": 0, // 是否关注 1是0否
  20. "follow_count": 0 // 关注数量
  21. }

赛程详情

api

http://gameapi.chamshare.cn/event/Course/detail

params

  1. {
  2. "token": sadfasdf,
  3. "course_id" :
  4. }

会员贡献

api

http://gameapi.chamshare.cn/member/Member/support

params

  1. {
  2. "token": sadfasdf,
  3. "course_id" : 2 ,
  4. "object_id" // 战队ID或队员ID
  5. }

当前赛程下的贡献榜

api

http://gameapi.chamshare.cn/member/Member/supportTop

params

  1. {
  2. "token": sadfasdf,
  3. "course_id" : 2
  4. }

response

  1. # 按贡献值contribution从高到底排序
  2. {
  3. "status": 0,
  4. "data": [
  5. {
  6. "member_id": 6,
  7. "count": "30",
  8. "nickname": "测试1",
  9. "contribution": "http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIjz2mMk3ibWhFcycgyGP5uN3ml2icPKqRnNKdkoazQIVZt3z41YSEv8JTKWLMvrXK3ibSIibcUPQfQpA/0 "
  10. },
  11. {
  12. "member_id": 22,
  13. "count": "18",
  14. "nickname": "测试号不要动",
  15. "contribution": "http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIjz2mMk3ibWhFcycgyGP5uN3ml2icPKqRnNKdkoazQIVZt3z41YSEv8JTKWLMvrXK3ibSIibcUPQfQpA/0 "
  16. }
  17. ],
  18. "message": "调用成功"
  19. }

当前赛程下的回放视频

后续根据具体的资源来定位

报名相关

获取参赛项目与对应项目的报名方式

api

http://gameapi.chamshare.cn/event/Contest/query

params

  1. {
  2. "event_id": 1, //赛事ID
  3. }

response

  1. {
  2. "status": 0,
  3. "data": [
  4. {
  5. "contest_id": 5, // 项目ID
  6. "game_id": 4,
  7. "game_name": "王者荣耀"
  8. 'min_apply_num': "最少报名人数"
  9. 'maxapply_num': "同上面的字段一起保存起来,下个界面用",
  10. "apply_type" // 允许报名的类型 1个人 2团队
  11. }
  12. ],
  13. "message": "调用成功"
  14. }

获取参赛地区与对应地区下的分组

api

http://gameapi.chamshare.cn/event/Area/query

params

  1. {
  2. "contest_id": 1, //项目ID
  3. }

response

  1. {
  2. "status": 0,
  3. "data": [
  4. {
  5. "area_id": 3,
  6. "area_name": "华东",
  7. "content": "赛区说明赛区说明赛区说明赛区说明" , // 一个字段包含
  8. "squads": [
  9. {
  10. "squad_id": 7,
  11. "squad_name": "死亡组"
  12. },
  13. {
  14. "squad_id": 8,
  15. "squad_name": "天使组"
  16. },
  17. {
  18. "squad_id": 9,
  19. "squad_name": "平民组"
  20. }
  21. }
  22. ],
  23. "message": "调用成功"
  24. }

报名

api

http://gameapi.chamshare.cn/member/Member/apply

params

  1. {
  2. "token": "kkkk",
  3. "squad_id": 14, //分组ID
  4. "apply_type": 2 //报名类型
  5. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "apply_id": "4"
  5. },
  6. "message": "调用成功"
  7. }

战队成员列表

api

http://gameapi.chamshare.cn/member/Member/teamMembers

params

  1. {
  2. "token": "kkkk",
  3. "team_id": 14, // 可以不传,不传时取当前登录者所在的战队
  4. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "count": 9,
  5. "list": [
  6. {
  7. "member_id": 19,
  8. "nickname": "gangge",
  9. "avatar": "配置地址",
  10. "nationality": "国际",
  11. "realname": "真实姓名",
  12. "mobile": "10014864298",
  13. "idcard": "身份证号码",
  14. "is_complete": 0 // 是否完善资料,1完善 0不完善
  15. }
  16. },
  17. "message": "调用成功"
  18. }

战队成员详情

api

http://gameapi.chamshare.cn/member/Member/detail

params

  1. {
  2. "token": "kkkk",
  3. "member_id": 14, // 要查的会员详情,不传就取自己的
  4. }

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "member_id": 1,
  5. "mobile": "18852600625",
  6. "nationality": "中国",
  7. "realname": "田亚",
  8. "idcard": "632356231595365362" // 身份证号,没有证件类型
  9. },
  10. "message": "调用成功"
  11. }

添加战队成员

如果是个人报名就添加自己

api

http://gameapi.chamshare.cn/member/Member/applyList

params

  1. {
  2. "token": "22222",
  3. "list": [
  4. // 如果是个人报名就添加自己
  5. {
  6. "apply_id": 1, //报名ID
  7. "member_id": 11,
  8. "player_name": "王大锤" // 游戏ID
  9. },
  10. {
  11. "apply_id": 1,
  12. "member_id": 12,
  13. "player_name": "王二锤"
  14. }
  15. ]
  16. }

参赛信息

params

  1. {
  2. "token": "22222",
  3. "apply_id": 14
  4. }

response

  1. {
  2. "apply_id": 14,
  3. "member_id": 1,
  4. "squad_id": 18,
  5. "apply_type": 2,
  6. "confirm_status": 0,
  7. "confirm_status_text": "未审核", // 参赛资格
  8. "gameName": "守望先锋",
  9. "eventName": "《绝地求生》亚洲邀请赛",
  10. "members": [
  11. {
  12. "apply_list_id": 29,
  13. "member_id": 2,
  14. "team_id": 1,
  15. "player_name": "给哦啊",
  16. "realname": "田亚",
  17. "idcard": "632356231595365362",
  18. "nationality": "中国",
  19. "mobile": "18822223333"
  20. }
  21. ]
  22. }

参赛信息下的近期赛程

使用这个接口: https://www.zybuluo.com/a5635268/note/950529#%E5%BD%93%E5%89%8D%E6%88%98%E9%98%9F%E7%9A%84%E8%BF%91%E6%9C%9F%E8%B5%9B%E7%A8%8B

传入以下参数即可:

  1. {
  2. "token": sadfasdf,
  3. "team_id": 1, // 当前这个人所在的战队,上面的接口有返回;
  4. "is_recent": 1,
  5. }

游戏

游戏列表

api

http://gameapi.chamshare.cn/game/Game/query

params

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "count": 1,
  5. "list": [
  6. {
  7. "game_id": 2,
  8. "game_name": "游戏名称",
  9. "logo": "游戏logo",
  10. "introduce": "游戏简介"
  11. }
  12. ]
  13. },
  14. "message": "调用成功"
  15. }

其它

Banner数据

api

http://gameapi.chamshare.cn/adverse/adverse/query

params

response

  1. {
  2. "status": 0,
  3. "data": {
  4. "count": 4,
  5. "list": [
  6. {
  7. "id": 27,
  8. "title": "会员福利",
  9. "img": "sq_img/201709/59c21cf6c2bf7.png",
  10. "link": "",
  11. "type"1 ,// 1滚动Banner , 2赛事报名Banne 3,公告
  12. }
  13. },
  14. "message": "调用成功"
  15. }

获取appid的接口

api

http://gameapi.chamshare.cn/member/Publics/getAppid

params

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注