Commit aef690fd authored by Peter Xin's avatar Peter Xin

draft for historical record

parent 10cfe04d
Pipeline #22602 passed with stages
in 2 minutes and 29 seconds
...@@ -230,6 +230,10 @@ export class AppController { ...@@ -230,6 +230,10 @@ export class AppController {
async getBattleHistory(@Query() query: any) { async getBattleHistory(@Query() query: any) {
return await this.appService.getBattleHistory(query); return await this.appService.getBattleHistory(query);
} }
@Get('historyScore')
async getScoreHistory(@Query() query: any) {
return await this.appService.getScoreHistory(query);
}
@Get('user') @Get('user')
async getUser(@Query('username') username: string) { async getUser(@Query('username') username: string) {
return await this.appService.getUser(username); return await this.appService.getUser(username);
......
...@@ -41,6 +41,7 @@ import { HomePageMatchCountDto } from './dto/HomePageMatchCount.dto'; ...@@ -41,6 +41,7 @@ import { HomePageMatchCountDto } from './dto/HomePageMatchCount.dto';
import { AccountService } from './account/account.service'; import { AccountService } from './account/account.service';
import { CodeResponseDto } from './dto/CodeResponse.dto'; import { CodeResponseDto } from './dto/CodeResponse.dto';
import { PayExpDto } from './dto/PayExp.dto'; import { PayExpDto } from './dto/PayExp.dto';
import { UserHistoricalRecord } from './entities/mycard/UserHistoricalRecord';
const attrOffset = 1010; const attrOffset = 1010;
const raceOffset = 1020; const raceOffset = 1020;
...@@ -1528,6 +1529,19 @@ export class AppService { ...@@ -1528,6 +1529,19 @@ export class AppService {
} }
return ret; return ret;
} }
async getScoreHistory(query: any): Promise<UserHistoricalRecord> {
const username: string = query.username;
const season: string = query.season;
const q = this.mcdb
.getRepository(UserHistoricalRecord)
.createQueryBuilder()
.where('username = :username and season = :season', {
username: username,
season: season,
});
const result = await q.getOne();
return result;
}
async getUser(username: string) { async getUser(username: string) {
const resultData = { const resultData = {
exp: 0, exp: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment