Commit 7f3593f4 authored by liming's avatar liming

增加app下载接口

parent 59346168
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.mobile.api.business.app.service.AppService;
import com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO;
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 javax.annotation.Resource;
import static com.antai.sport.http.server.common.util.ResultUtil.success;
@RestController
@RequestMapping("app")
@Api(tags = {"app相关接口"})
public class AppController {
@Resource
private AppService appService;
@GetMapping("download/path")
@ApiOperation(value = "获取app下载地址")
public ResponseEntity<Result<AppDownloadPathVO>> getAppDownloadPath() {
return success(appService.getAppDownloadPath());
}
}
package com.antai.sport.http.server.mobile.api.business.app.mapper;
import com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO;
public interface AppBusinessMapper {
AppDownloadPathVO getAppDownloadPath();
}
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.vo.AppDownloadPathVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class AppService {
@Resource
private AppBusinessMapper appBusinessMapper;
public AppDownloadPathVO getAppDownloadPath() {
return appBusinessMapper.getAppDownloadPath();
}
}
package com.antai.sport.http.server.mobile.api.business.app.vo;
import lombok.Data;
/**
* @author lidong
* @Date 2019/11/14 15:16
* @Email 517440009@qq.com
*/
@Data
public class AppDownloadPathVO {
String androidPath;
String iosPath;
}
......@@ -52,6 +52,7 @@ project:
- /match/bicycle/player/record
- /match/bicycle/auto/create
- /test/**
- /app/download/path
swagger:
enable: false
......
<?xml version="1.0" encoding="UTF-8"?>
<!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.mobile.api.business.app.mapper.AppBusinessMapper">
<select id="getAppDownloadPath" resultType="com.antai.sport.http.server.mobile.api.business.app.vo.AppDownloadPathVO">
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>
</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