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
dc4b6860
Commit
dc4b6860
authored
Aug 29, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile端增加app版本获取接口
parent
7521ec27
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
0 deletions
+76
-0
AppController.java
...ver/mobile/api/business/app/controller/AppController.java
+13
-0
AppBusinessMapper.java
...ver/mobile/api/business/app/mapper/AppBusinessMapper.java
+4
-0
AppService.java
...tp/server/mobile/api/business/app/service/AppService.java
+5
-0
AppLatestVersionVO.java
...server/mobile/api/business/app/vo/AppLatestVersionVO.java
+45
-0
application.yaml
mobile-api/src/main/resources/application.yaml
+1
-0
AppBusinessMapper.xml
...e-api/src/main/resources/mapper/app/AppBusinessMapper.xml
+8
-0
No files found.
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/app/controller/AppController.java
View file @
dc4b6860
...
@@ -3,11 +3,14 @@ package com.antai.sport.http.server.mobile.api.business.app.controller;
...
@@ -3,11 +3,14 @@ package com.antai.sport.http.server.mobile.api.business.app.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.mobile.api.business.app.service.AppService
;
import
com.antai.sport.http.server.mobile.api.business.app.service.AppService
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppLatestVersionVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -26,4 +29,14 @@ public class AppController {
...
@@ -26,4 +29,14 @@ public class AppController {
public
ResponseEntity
<
Result
<
AppDownloadPathVO
>>
getAppDownloadPath
()
{
public
ResponseEntity
<
Result
<
AppDownloadPathVO
>>
getAppDownloadPath
()
{
return
success
(
appService
.
getAppDownloadPath
());
return
success
(
appService
.
getAppDownloadPath
());
}
}
/**
* 获取app最新版本
*/
@ApiOperation
(
value
=
"获取app最新版本"
,
notes
=
"作者: 潘维吉"
)
@GetMapping
(
"/version"
)
public
ResponseEntity
<
Result
<
AppLatestVersionVO
>>
getAppLatestVersion
(
@ApiParam
(
value
=
"客户端类型: 1.android 2.ios"
,
required
=
true
)
@RequestParam
Integer
clientType
)
{
return
success
(
appService
.
getAppLatestVersion
(
clientType
));
}
}
}
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/app/mapper/AppBusinessMapper.java
View file @
dc4b6860
package
com
.
antai
.
sport
.
http
.
server
.
mobile
.
api
.
business
.
app
.
mapper
;
package
com
.
antai
.
sport
.
http
.
server
.
mobile
.
api
.
business
.
app
.
mapper
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppLatestVersionVO
;
import
org.apache.ibatis.annotations.Param
;
public
interface
AppBusinessMapper
{
public
interface
AppBusinessMapper
{
AppDownloadPathVO
getAppDownloadPath
();
AppDownloadPathVO
getAppDownloadPath
();
AppLatestVersionVO
getAppLatestVersion
(
@Param
(
"clientType"
)
Integer
clientType
);
}
}
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/app/service/AppService.java
View file @
dc4b6860
...
@@ -2,6 +2,7 @@ package com.antai.sport.http.server.mobile.api.business.app.service;
...
@@ -2,6 +2,7 @@ package com.antai.sport.http.server.mobile.api.business.app.service;
import
com.antai.sport.http.server.mobile.api.business.app.mapper.AppBusinessMapper
;
import
com.antai.sport.http.server.mobile.api.business.app.mapper.AppBusinessMapper
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO
;
import
com.antai.sport.http.server.mobile.api.business.app.vo.AppLatestVersionVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -14,4 +15,8 @@ public class AppService {
...
@@ -14,4 +15,8 @@ public class AppService {
public
AppDownloadPathVO
getAppDownloadPath
()
{
public
AppDownloadPathVO
getAppDownloadPath
()
{
return
appBusinessMapper
.
getAppDownloadPath
();
return
appBusinessMapper
.
getAppDownloadPath
();
}
}
public
AppLatestVersionVO
getAppLatestVersion
(
Integer
clientType
)
{
return
appBusinessMapper
.
getAppLatestVersion
(
clientType
);
}
}
}
mobile-api/src/main/java/com/antai/sport/http/server/mobile/api/business/app/vo/AppLatestVersionVO.java
0 → 100644
View file @
dc4b6860
package
com
.
antai
.
sport
.
http
.
server
.
mobile
.
api
.
business
.
app
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
/**
* @author 潘维吉
* @date 2019/10/17 14:50
* @email 406798106@qq.com
* @description APP最新版本VO
*/
@ApiModel
(
value
=
"AppLatestVersionVO"
,
description
=
"APP最新版本接口响应数据"
)
@Getter
@Setter
@ToString
public
class
AppLatestVersionVO
{
/**
* 版本号x.y.z
*/
@ApiModelProperty
(
"版本号x.y.z"
)
private
String
version
;
/**
* 更新内容
*/
@ApiModelProperty
(
"更新内容"
)
private
String
content
;
/**
* 下载URL
*/
@ApiModelProperty
(
"下载页url"
)
private
String
downloadPageUrl
;
/**
* false.不强制 true.强制
*/
@ApiModelProperty
(
"false.不强制 true.强制"
)
private
Boolean
forceUpdate
;
}
mobile-api/src/main/resources/application.yaml
View file @
dc4b6860
...
@@ -53,6 +53,7 @@ project:
...
@@ -53,6 +53,7 @@ project:
-
/match/bicycle/auto/create
-
/match/bicycle/auto/create
-
/test/**
-
/test/**
-
/app/download/path
-
/app/download/path
-
/app/version
swagger
:
swagger
:
enable
:
false
enable
:
false
...
...
mobile-api/src/main/resources/mapper/app/AppBusinessMapper.xml
View file @
dc4b6860
...
@@ -5,4 +5,12 @@
...
@@ -5,4 +5,12 @@
select (select url from app_version where client_type = 1 order by id desc limit 1) as android_path,
select (select url from app_version where client_type = 1 order by id desc limit 1) as android_path,
(select download_page_url from app_version where client_type = 2 order by id desc limit 1) as ios_path
(select download_page_url from app_version where client_type = 2 order by id desc limit 1) as ios_path
</select>
</select>
<select
id=
"getAppLatestVersion"
resultType=
"com.antai.sport.http.server.mobile.api.business.app.vo.AppLatestVersionVO"
>
select version,content,download_page_url,force_update
from app_version
where client_type=#{clientType}
order by id desc
limit 1
</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