Commit b5ffaf3d authored by liming's avatar liming

app最新版本查看接口

parent ce1ffe6a
......@@ -24425,8 +24425,8 @@
},
{
"objectType": "Table_MYSQL",
"name": "app_version",
"comment": "app版本升级",
"name": "course_item",
"comment": "课程章节",
"engine": "InnoDB",
"characterSet": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
......@@ -24501,7 +24501,33 @@
},
{
"objectType": "TableField_MYSQL",
"name": "client_type",
"name": "name",
"type": "varchar",
"length": 100,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
"isNullable": true,
"defaultType": "Null",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "章节名称",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "name"
},
{
"objectType": "TableField_MYSQL",
"name": "target_type",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
......@@ -24516,20 +24542,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "1:android 2:ios",
"comment": "指标类型 1:ftp 2:踏频 3:速度",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "client_type"
"oldName": "target_type"
},
{
"objectType": "TableField_MYSQL",
"name": "version",
"type": "varchar",
"length": 50,
"name": "target_value_type",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24542,20 +24568,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "版本号x.y.z",
"comment": "目标值类型",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "version"
"oldName": "target_value_type"
},
{
"objectType": "TableField_MYSQL",
"name": "content",
"type": "varchar",
"length": 1000,
"name": "target_value",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24568,20 +24594,72 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "更新内容",
"comment": "目标值",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "content"
"oldName": "target_value"
},
{
"objectType": "TableField_MYSQL",
"name": "url",
"name": "allowable_deviation",
"type": "decimal",
"length": 18,
"decimals": 2,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "允许偏差",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "allowable_deviation"
},
{
"objectType": "TableField_MYSQL",
"name": "duration",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "持续时长s",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "duration"
},
{
"objectType": "TableField_MYSQL",
"name": "description",
"type": "varchar",
"length": 500,
"length": 1000,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -24594,19 +24672,19 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "下载地址",
"comment": "描述",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "url"
"oldName": "description"
},
{
"objectType": "TableField_MYSQL",
"name": "force",
"type": "bit",
"name": "show_order",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
......@@ -24617,17 +24695,69 @@
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "是否强制更新",
"comment": "显示顺序",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "force"
"oldName": "show_order"
},
{
"objectType": "TableField_MYSQL",
"name": "version",
"type": "bigint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "版本号",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "version"
},
{
"objectType": "TableField_MYSQL",
"name": "deleted",
"type": "tinyint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "删除标记",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "deleted"
},
{
"objectType": "TableField_MYSQL",
......@@ -24869,8 +24999,8 @@
},
{
"objectType": "Table_MYSQL",
"name": "course_item",
"comment": "课程章节",
"name": "app_version",
"comment": "app版本升级",
"engine": "InnoDB",
"characterSet": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
......@@ -24945,33 +25075,7 @@
},
{
"objectType": "TableField_MYSQL",
"name": "name",
"type": "varchar",
"length": 100,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "utf8mb4",
"collation": "utf8mb4_0900_ai_ci",
"isNullable": true,
"defaultType": "Null",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "章节名称",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "name"
},
{
"objectType": "TableField_MYSQL",
"name": "target_type",
"name": "client_type",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
......@@ -24986,20 +25090,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "指标类型 1:ftp 2:踏频 3:速度",
"comment": "1:android 2:ios",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "target_type"
"oldName": "client_type"
},
{
"objectType": "TableField_MYSQL",
"name": "target_value_type",
"type": "int",
"length": -2147483648,
"name": "version",
"type": "varchar",
"length": 50,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25012,20 +25116,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "目标值类型",
"comment": "版本号x.y.z",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "target_value_type"
"oldName": "version"
},
{
"objectType": "TableField_MYSQL",
"name": "target_value",
"type": "int",
"length": -2147483648,
"name": "content",
"type": "varchar",
"length": 1000,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25038,46 +25142,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "目标值",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "target_value"
},
{
"objectType": "TableField_MYSQL",
"name": "allowable_deviation",
"type": "decimal",
"length": 18,
"decimals": 2,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "允许偏差",
"comment": "更新内容",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "allowable_deviation"
"oldName": "content"
},
{
"objectType": "TableField_MYSQL",
"name": "duration",
"type": "int",
"length": -2147483648,
"name": "url",
"type": "varchar",
"length": 500,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25090,20 +25168,20 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "持续时长s",
"comment": "下载地址",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "duration"
"oldName": "url"
},
{
"objectType": "TableField_MYSQL",
"name": "description",
"name": "download_page_url",
"type": "varchar",
"length": 1000,
"length": 500,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
......@@ -25116,71 +25194,19 @@
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "描述",
"comment": "下载更新页面地址",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "description"
"oldName": "download_page_url"
},
{
"objectType": "TableField_MYSQL",
"name": "show_order",
"type": "int",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "显示顺序",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "show_order"
},
{
"objectType": "TableField_MYSQL",
"name": "version",
"type": "bigint",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
"isZeroFill": false,
"setEnumValues": "",
"isBinary": false,
"charset": "",
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "版本号",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "version"
},
{
"objectType": "TableField_MYSQL",
"name": "deleted",
"type": "tinyint",
"name": "force_update",
"type": "bit",
"length": -2147483648,
"decimals": -2147483648,
"isUnsigned": false,
......@@ -25191,17 +25217,17 @@
"collation": "",
"isNullable": true,
"defaultType": "Others",
"defaultValue": "0",
"defaultValue": "",
"isOnUpdateCurrentTimestamp": false,
"isAutoInc": false,
"comment": "删除标记",
"comment": "是否强制更新",
"columnFormat": "",
"storage": "",
"isVirtual": false,
"isGeneratedAlways": false,
"virtualExpr": "",
"virtualType": "",
"oldName": "deleted"
"oldName": "force_update"
},
{
"objectType": "TableField_MYSQL",
......
......@@ -47,6 +47,11 @@ public class AppVersion implements Serializable {
*/
private String url;
/**
* 下载页面地址
*/
private String downloadPageUrl;
/**
* 是否强制更新
*/
......
......@@ -2,10 +2,12 @@ package com.antai.sport.http.server.server.api.business.base.controller;
import com.antai.sport.http.server.common.base.Result;
import com.antai.sport.http.server.repository.base.entity.GameMode;
import com.antai.sport.http.server.server.api.business.base.dto.AppLatestVersionVO;
import com.antai.sport.http.server.server.api.business.base.dto.AreaRespDTO;
import com.antai.sport.http.server.server.api.business.base.service.BaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -36,4 +38,14 @@ public class BaseController {
public ResponseEntity<Result<List<AreaRespDTO>>> getProvince(@RequestParam(required = false) Long parentId) {
return success(baseService.getArea(parentId));
}
/**
* 获取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(baseService.getAppLatestVersion(clientType));
}
}
package com.antai.sport.http.server.server.api.business.base.dto;
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;
}
package com.antai.sport.http.server.server.api.business.base.mapper;
import com.antai.sport.http.server.server.api.business.base.dto.AppLatestVersionVO;
import com.antai.sport.http.server.server.api.business.base.dto.AreaRespDTO;
import org.apache.ibatis.annotations.Param;
......@@ -11,4 +12,6 @@ public interface BaseBusinessMapper {
String getGameMode(@Param("code") Integer code);
String getMapPath(@Param("pathKey") String pathKey);
AppLatestVersionVO getAppLatestVersion(@Param("clientType") Integer clientType);
}
......@@ -2,6 +2,7 @@ package com.antai.sport.http.server.server.api.business.base.service;
import com.antai.sport.http.server.repository.base.entity.GameMode;
import com.antai.sport.http.server.repository.base.mapper.GameModeMapper;
import com.antai.sport.http.server.server.api.business.base.dto.AppLatestVersionVO;
import com.antai.sport.http.server.server.api.business.base.dto.AreaRespDTO;
import com.antai.sport.http.server.server.api.business.base.mapper.BaseBusinessMapper;
import org.springframework.stereotype.Service;
......@@ -23,4 +24,8 @@ public class BaseService {
public List<AreaRespDTO> getArea(Long parentId) {
return baseBusinessMapper.getArea(parentId);
}
public AppLatestVersionVO getAppLatestVersion(Integer clientType) {
return baseBusinessMapper.getAppLatestVersion(clientType);
}
}
package com.antai.sport.http.server.server.api.business.course.controller;
import com.antai.sport.http.server.common.base.Result;
import com.antai.sport.http.server.server.api.business.course.service.CourseService;
import com.antai.sport.http.server.server.api.business.course.vo.CourseTypeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.antai.sport.http.server.common.util.ResultUtil.success;
@RestController
@RequestMapping("course")
@Api(tags = {"课程训练接口"})
public class CourseController {
private CourseService courseService;
@GetMapping("tree")
@ApiOperation("课程树")
public ResponseEntity<Result<List<CourseTypeVO>>> getCourseTree() {
return success(courseService.getCourseTree());
}
}
package com.antai.sport.http.server.server.api.business.course.service;
import com.antai.sport.http.server.server.api.business.course.vo.CourseTypeVO;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CourseService {
public List<CourseTypeVO> getCourseTree() {
return null;
}
}
package com.antai.sport.http.server.server.api.business.course.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("课程分类")
public class CourseTypeVO {
@ApiModelProperty("课程类型名称")
private String name;
@ApiModelProperty("课程列表")
private List<CourseVO> courseList;
}
package com.antai.sport.http.server.server.api.business.course.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("课程对象")
public class CourseVO {
@ApiModelProperty("课程id")
private Long id;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("时长")
private Integer duration;
@ApiModelProperty("描述")
private String description;
}
......@@ -21,4 +21,12 @@
<select id="getMapPath" resultType="java.lang.String">
select path_name from map_path where path_key = #{pathKey}
</select>
<select id="getAppLatestVersion" resultType="com.antai.sport.http.server.server.api.business.base.dto.AppLatestVersionVO">
select version,content,download_page_url,force_update
from app_version
where client_type=#{clientType}
order by id desc
limit 1
</select>
</mapper>
\ No newline at end of file
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