This commit is contained in:
aozhiwei 2022-09-14 14:59:34 +08:00
parent 6cad7e6809
commit 2b75fda649
6 changed files with 93 additions and 4 deletions

38
doc/History.py Normal file
View File

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
import _common
class History(object):
def __init__(self):
self.apis = [
{
'name': 'queryHistoryBattle',
'desc': '查询历史战绩',
'group': 'History',
'url': 'webapp/index.php?c=Battle&a=queryHistoryBattle',
'params': [
_common.ReqHead(),
['last_idx', '', '回传last_idx, 第一次打开传空'],
],
'response': [
_common.RspHead(),
['!rows', [_common.HisBattle()], '历史战绩'],
['page', _common.Page(), '分页信息']
]
},
{
'name': 'getBattleReport',
'desc': '获取战报信息',
'group': 'History',
'url': 'webapp/index.php?c=Battle&a=getBattleReport',
'params': [
_common.ReqHead(),
['battle_uuid', '', '战斗唯一id'],
],
'response': [
_common.RspHead(),
['battle_result', _common.BattleReport(), '战斗结算信息']
]
},
]

View File

@ -111,4 +111,17 @@ class User(object):
['info',_common.UserDetailInfo(), '用户信息(详细)'], ['info',_common.UserDetailInfo(), '用户信息(详细)'],
] ]
}, },
{
'name': 'like',
'desc': '点赞',
'group': 'User',
'url': 'webapp/index.php?c=User&a=like',
'params': [
_common.ReqHead(),
['target_id', '', '对方的account_id']
],
'response': [
_common.RspHead(),
]
},
] ]

View File

@ -63,6 +63,7 @@ class Page(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['last_idx', '', '回传信息'],
['total', 0, '总记录数'], ['total', 0, '总记录数'],
['count', 0, '当前记录数'], ['count', 0, '当前记录数'],
['per_page', 0, '每页多少条记录'], ['per_page', 0, '每页多少条记录'],
@ -74,6 +75,7 @@ class Gun(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['token_id', '', 'token id'],
['gun_uniid', 0, '枪唯一id'], ['gun_uniid', 0, '枪唯一id'],
['gun_id', 0, '枪id'], ['gun_id', 0, '枪id'],
['state', 0, '0已购买 1体验中'], ['state', 0, '0已购买 1体验中'],
@ -183,6 +185,7 @@ class UserDetailInfo(object):
['hero_id', 0, '当前使用的英雄ID'], ['hero_id', 0, '当前使用的英雄ID'],
['current_rank', 0, '当前段位'], ['current_rank', 0, '当前段位'],
['history_best_rank', 0, '历史最高段位'], ['history_best_rank', 0, '历史最高段位'],
['like_count', 0, '点赞次数'],
['!history_seasons', [UserHisSeason()], '历史打过的赛季列表'], ['!history_seasons', [UserHisSeason()], '历史打过的赛季列表'],
] ]
@ -210,6 +213,7 @@ class Hero(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['token_id', '', 'token id'],
['hero_uniid', 0, '英雄唯一id'], ['hero_uniid', 0, '英雄唯一id'],
['hero_id', 0, '英雄id'], ['hero_id', 0, '英雄id'],
['hero_lv', 0, '英雄等级'], ['hero_lv', 0, '英雄等级'],
@ -728,7 +732,7 @@ class Cost(object):
] ]
class Fragment(object): class Fragment(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
@ -740,3 +744,33 @@ class Fragment(object):
['createtime', 0, '创建时间'], ['createtime', 0, '创建时间'],
['modifytime', 0, '修改时间'], ['modifytime', 0, '修改时间'],
] ]
class HisBattle(object):
def __init__(self):
self.fields = [
['battle_uuid', '', '本次比赛唯一id'],
['match_mode', 0, '比赛模式 1:匹配赛 2:排位赛 3: pve'],
['team_mode', 0, '组队模式 1:单人 2::多人'],
['result', '', '比赛结果 当pve模式时: 1:通关 2:通关失败 其他模式:排名'],
['kills', '', '击杀数'],
['hero_id', '', '英雄id'],
['weapon1_id', '', '武器1 id'],
['weapon2_id', '', '武器2 id'],
['level_class', 0, '段位'],
['score', 0, '段位-积分'],
['score_change', 0, '段位-积分变更'],
['pve_score', 0, 'pve积分 pve模式'],
['map_id', 0, '地图id'],
['pve_instance_id', 0, '副本id'],
['end_time', 0, '战斗时间 utc时间 客户端自己处理时区问题'],
]
class BattleReport(object):
def __init__(self):
self.fields = [
['battle_uuid', '', '本次比赛唯一id'],
['match_mode', 0, '比赛模式 1:匹配赛 2:排位赛 3: pve'],
['team_mode', 0, '组队模式 1:单人 2::多人'],
]

View File

@ -49,6 +49,7 @@ CREATE TABLE `t_user` (
`activatetime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间', `activatetime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间',
`already_guide` int(11) NOT NULL DEFAULT '0' COMMENT '已引导', `already_guide` int(11) NOT NULL DEFAULT '0' COMMENT '已引导',
`pve_instance_id` int(11) NOT NULL DEFAULT '0' COMMENT '已过pve副本id', `pve_instance_id` int(11) NOT NULL DEFAULT '0' COMMENT '已过pve副本id',
`like_count` int(11) NOT NULL DEFAULT '0' COMMENT '被点赞次数',
`head_list` mediumblob COMMENT '拥有的头像列表', `head_list` mediumblob COMMENT '拥有的头像列表',
`head_frame_list` mediumblob COMMENT '拥有的头像框列表', `head_frame_list` mediumblob COMMENT '拥有的头像框列表',
`consume_gold` bigint NOT NULL DEFAULT '0' COMMENT '消费金币数', `consume_gold` bigint NOT NULL DEFAULT '0' COMMENT '消费金币数',

View File

@ -44,6 +44,7 @@ class User extends BaseModel {
'first_fight' => $row['first_fight'], 'first_fight' => $row['first_fight'],
'already_guide' => $row['already_guide'], 'already_guide' => $row['already_guide'],
'pve_instance_id' => $row['pve_instance_id'], 'pve_instance_id' => $row['pve_instance_id'],
'like_count' => $row['like_count'],
'head_list' => self::getHeadList($row), 'head_list' => self::getHeadList($row),
'head_frame_list' => emptyReplace(json_decode($row['head_frame_list'], true), array()), 'head_frame_list' => emptyReplace(json_decode($row['head_frame_list'], true), array()),
); );
@ -72,6 +73,7 @@ class User extends BaseModel {
'already_guide' => $row['already_guide'], 'already_guide' => $row['already_guide'],
'head_list' => self::getHeadList($row), 'head_list' => self::getHeadList($row),
'pve_instance_id' => $row['pve_instance_id'], 'pve_instance_id' => $row['pve_instance_id'],
'like_count' => $row['like_count'],
'head_frame_list' => emptyReplace(json_decode($row['head_frame_list'], true), array()), 'head_frame_list' => emptyReplace(json_decode($row['head_frame_list'], true), array()),
); );
} }
@ -93,6 +95,7 @@ class User extends BaseModel {
'diamond' => $row['diamond'], 'diamond' => $row['diamond'],
'hero_id' => $row['hero_id'], 'hero_id' => $row['hero_id'],
'pve_instance_id' => $row['pve_instance_id'], 'pve_instance_id' => $row['pve_instance_id'],
'like_count' => $row['like_count'],
'first_fight' => $row['first_fight'], 'first_fight' => $row['first_fight'],
); );
} }

View File

@ -632,7 +632,7 @@ class MissionService extends BaseService {
$missionDto['state'] = 2; $missionDto['state'] = 2;
} }
} else { } else {
$missionDto['state'] = 2; $missionDto['state'] = 1;
} }
$missionDto['objects'] = $mission['objects']; $missionDto['objects'] = $mission['objects'];
$missionDto['ceg_num'] = $this->calcCegPreview($mission['objects']); $missionDto['ceg_num'] = $this->calcCegPreview($mission['objects']);