Commit b5ffaf3d authored by liming's avatar liming

app最新版本查看接口

parent ce1ffe6a
This diff is collapsed.
......@@ -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