Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antai-sport
antai-sport-http-server
Commits
03afc0b6
Commit
03afc0b6
authored
Apr 12, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表信息上传
parent
d190732a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
4 deletions
+66
-4
RespRoomRank.java
...server/server/api/business/roommode/dto/RespRoomRank.java
+2
-2
SimpleMatchController.java
...usiness/simplematch/controller/SimpleMatchController.java
+7
-1
RespSimpleMatchRank.java
...ver/api/business/simplematch/dto/RespSimpleMatchRank.java
+32
-0
SimpleMatchBusinessMapper.java
...usiness/simplematch/mapper/SimpleMatchBusinessMapper.java
+3
-0
SimpleMatchService.java
.../api/business/simplematch/service/SimpleMatchService.java
+10
-0
RoomBusinessMapper.xml
...src/main/resources/mapper/roommode/RoomBusinessMapper.xml
+1
-1
SimpleMatchBusinessMapper.xml
...esources/mapper/simplematch/SimpleMatchBusinessMapper.xml
+11
-0
No files found.
server-api/src/main/java/com/antai/sport/http/server/server/api/business/roommode/dto/RespRoomRank.java
View file @
03afc0b6
...
@@ -10,12 +10,12 @@ import java.math.BigDecimal;
...
@@ -10,12 +10,12 @@ import java.math.BigDecimal;
@Data
@Data
public
class
RespRoomRank
{
public
class
RespRoomRank
{
@ApiModelProperty
(
"用户Id"
)
@ApiModelProperty
(
"用户Id"
)
private
Long
us
erId
;
private
Long
play
erId
;
@ApiModelProperty
(
"昵称"
)
@ApiModelProperty
(
"昵称"
)
private
String
nickname
;
private
String
nickname
;
@ApiModelProperty
(
"头像"
)
@ApiModelProperty
(
"头像"
)
private
String
avatar
;
private
String
avatar
;
@ApiModelProperty
(
"比赛名次
(没有可以不填)
"
)
@ApiModelProperty
(
"比赛名次"
)
private
Integer
matchRank
;
private
Integer
matchRank
;
@ApiModelProperty
(
"用时(秒)"
)
@ApiModelProperty
(
"用时(秒)"
)
private
Integer
duration
;
private
Integer
duration
;
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/simplematch/controller/SimpleMatchController.java
View file @
03afc0b6
...
@@ -3,7 +3,6 @@ package com.antai.sport.http.server.server.api.business.simplematch.controller;
...
@@ -3,7 +3,6 @@ package com.antai.sport.http.server.server.api.business.simplematch.controller;
import
com.antai.sport.http.server.common.base.Result
;
import
com.antai.sport.http.server.common.base.Result
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.*
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.*
;
import
com.antai.sport.http.server.server.api.business.simplematch.service.SimpleMatchService
;
import
com.antai.sport.http.server.server.api.business.simplematch.service.SimpleMatchService
;
import
com.antai.sport.http.server.server.api.common.dto.CyclingDataDTO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -73,4 +72,11 @@ public class SimpleMatchController {
...
@@ -73,4 +72,11 @@ public class SimpleMatchController {
simpleMatchService
.
recordUpload
(
dataList
);
simpleMatchService
.
recordUpload
(
dataList
);
return
success
();
return
success
();
}
}
@ApiOperation
(
"查询日常赛排名"
)
@GetMapping
(
"/rank/{matchId}"
)
public
ResponseEntity
<
Result
<
List
<
RespSimpleMatchRank
>>>
rank
(
@PathVariable
(
"matchId"
)
Long
matchId
)
{
return
success
(
simpleMatchService
.
rank
(
matchId
));
}
}
}
server-api/src/main/java/com/antai/sport/http/server/server/api/business/simplematch/dto/RespSimpleMatchRank.java
0 → 100644
View file @
03afc0b6
package
com
.
antai
.
sport
.
http
.
server
.
server
.
api
.
business
.
simplematch
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@ApiModel
(
"日常赛排名"
)
@Data
public
class
RespSimpleMatchRank
{
@ApiModelProperty
(
"用户Id"
)
private
Long
playerId
;
@ApiModelProperty
(
"昵称"
)
private
String
nickname
;
@ApiModelProperty
(
"头像"
)
private
String
avatar
;
@ApiModelProperty
(
"比赛名次"
)
private
Integer
matchRank
;
@ApiModelProperty
(
"用时(秒)"
)
private
Integer
duration
;
@ApiModelProperty
(
"骑行总长度"
)
private
BigDecimal
distance
;
@ApiModelProperty
(
"爬坡高度"
)
private
BigDecimal
climbDistance
;
@ApiModelProperty
(
"平均功率"
)
private
BigDecimal
avgFtp
;
@ApiModelProperty
(
"平均速度"
)
private
BigDecimal
avgSpeed
;
@ApiModelProperty
(
"状态 10:未完赛 20:已完赛"
)
private
Integer
status
;
}
server-api/src/main/java/com/antai/sport/http/server/server/api/business/simplematch/mapper/SimpleMatchBusinessMapper.java
View file @
03afc0b6
package
com
.
antai
.
sport
.
http
.
server
.
server
.
api
.
business
.
simplematch
.
mapper
;
package
com
.
antai
.
sport
.
http
.
server
.
server
.
api
.
business
.
simplematch
.
mapper
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.RespSimpleMatchList
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.RespSimpleMatchList
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.RespSimpleMatchRank
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -10,4 +11,6 @@ public interface SimpleMatchBusinessMapper {
...
@@ -10,4 +11,6 @@ public interface SimpleMatchBusinessMapper {
List
<
RespSimpleMatchList
>
getUnFinishedSimpleMatchListForUser
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"now"
)
LocalDateTime
now
);
List
<
RespSimpleMatchList
>
getUnFinishedSimpleMatchListForUser
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"now"
)
LocalDateTime
now
);
List
<
RespSimpleMatchList
>
getUnFinishedSimpleMatchListForServer
(
@Param
(
"now"
)
LocalDateTime
now
);
List
<
RespSimpleMatchList
>
getUnFinishedSimpleMatchListForServer
(
@Param
(
"now"
)
LocalDateTime
now
);
List
<
RespSimpleMatchRank
>
getSimpleMatchRank
(
@Param
(
"matchId"
)
Long
matchId
);
}
}
server-api/src/main/java/com/antai/sport/http/server/server/api/business/simplematch/service/SimpleMatchService.java
View file @
03afc0b6
...
@@ -180,4 +180,14 @@ public class SimpleMatchService {
...
@@ -180,4 +180,14 @@ public class SimpleMatchService {
simpleMatchPlayerRecordMapper
.
updateById
(
record
);
simpleMatchPlayerRecordMapper
.
updateById
(
record
);
});
});
}
}
/**
* 查询日常赛排名
*
* @param matchId
* @return
*/
public
List
<
RespSimpleMatchRank
>
rank
(
Long
matchId
)
{
return
simpleMatchBusinessMapper
.
getSimpleMatchRank
(
matchId
);
}
}
}
server-api/src/main/resources/mapper/roommode/RoomBusinessMapper.xml
View file @
03afc0b6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.antai.sport.http.server.server.api.business.roommode.mapper.RoomBusinessMapper"
>
<mapper
namespace=
"com.antai.sport.http.server.server.api.business.roommode.mapper.RoomBusinessMapper"
>
<select
id=
"getRoomBank"
resultType=
"com.antai.sport.http.server.server.api.business.roommode.dto.RespRoomRank"
>
<select
id=
"getRoomBank"
resultType=
"com.antai.sport.http.server.server.api.business.roommode.dto.RespRoomRank"
>
select t1.player_id
as user_id
,
select t1.player_id,
t2.avatar,
t2.avatar,
t2.nickname,
t2.nickname,
t1.*
t1.*
...
...
server-api/src/main/resources/mapper/simplematch/SimpleMatchBusinessMapper.xml
View file @
03afc0b6
...
@@ -27,4 +27,15 @@
...
@@ -27,4 +27,15 @@
and t1.deleted = 0
and t1.deleted = 0
order by t1.show_order, t1.start_time
order by t1.show_order, t1.start_time
</select>
</select>
<select
id=
"getSimpleMatchRank"
resultType=
"com.antai.sport.http.server.server.api.business.simplematch.dto.RespSimpleMatchRank"
>
select t1.player_id,
t2.avatar,
t2.nickname,
t1.*
from simple_match_player_record t1
left join sport_user t2 on t1.player_id = t2.id
where t1.match_id = #{matchId}
order by match_rank asc
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment