Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d5d9fd4132
|
|
@ -30,4 +30,12 @@ public class DeviceController {
|
|||
}
|
||||
return deviceService.getDeviceInfo(dto);
|
||||
}
|
||||
@ApiOperation("获取设备版本信息")
|
||||
@RequestMapping("/getAppVersion")
|
||||
public AjaxResult getAppVersion(@RequestBody AppDTO dto) {
|
||||
if (ObjectUtil.isEmpty(dto.getId())) {
|
||||
throw new ServiceException("Version不能为空");
|
||||
}
|
||||
return deviceService.getAppVersion(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@ public class AppDTO {
|
|||
private String type;
|
||||
|
||||
private String userId;
|
||||
private String id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.canteen.core.android.mapper;
|
||||
|
||||
import com.bonus.canteen.core.android.dto.AppDTO;
|
||||
import com.bonus.canteen.core.android.vo.AppVersionVo;
|
||||
import com.bonus.canteen.core.android.vo.DeviceInfoVo;
|
||||
import com.bonus.canteen.core.device.dto.DeviceDTO;
|
||||
import com.bonus.canteen.core.device.dto.DeviceSearchDTO;
|
||||
|
|
@ -23,4 +24,6 @@ public interface DeviceMapper {
|
|||
* @return 设备绑定多档口子
|
||||
*/
|
||||
DeviceInfoVo getDeviceInfo(AppDTO dto);
|
||||
|
||||
AppVersionVo getAppVersion(AppDTO dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,6 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
|||
|
||||
public interface DeviceService {
|
||||
AjaxResult getDeviceInfo(AppDTO dto);
|
||||
|
||||
AjaxResult getAppVersion(AppDTO dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.canteen.core.android.service.impl;
|
|||
import com.bonus.canteen.core.android.dto.AppDTO;
|
||||
import com.bonus.canteen.core.android.mapper.DeviceMapper;
|
||||
import com.bonus.canteen.core.android.service.DeviceService;
|
||||
import com.bonus.canteen.core.android.vo.AppVersionVo;
|
||||
import com.bonus.canteen.core.android.vo.DeviceInfoVo;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.constant.GlobalConstants;
|
||||
|
|
@ -33,4 +34,13 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
deviceInfoVo.setTenantId(String.valueOf(GlobalConstants.TENANT_ID));
|
||||
return AjaxResult.success(deviceInfoVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getAppVersion(AppDTO dto) {
|
||||
AppVersionVo appVersionVo = mapper.getAppVersion(dto);
|
||||
if (appVersionVo == null){
|
||||
return AjaxResult.success("无需更新");
|
||||
}
|
||||
return AjaxResult.success(appVersionVo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.canteen.core.android.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppVersionVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String version;
|
||||
|
||||
private String versionName;
|
||||
|
||||
private String apkName;
|
||||
|
||||
private String apkPath;
|
||||
|
||||
private String updateContent;
|
||||
|
||||
private String deployTime;
|
||||
|
||||
private String deployUser;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -28,4 +28,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where di.device_sn = #{deviceSn}
|
||||
GROUP BY di.device_id
|
||||
</select>
|
||||
<select id="getAppVersion" resultType="com.bonus.canteen.core.android.vo.AppVersionVo">
|
||||
select
|
||||
version as id,
|
||||
version as version,
|
||||
version_name as versionName,
|
||||
apk_name as apkName,
|
||||
apk_path as apkPath,
|
||||
update_content as updateContent,
|
||||
deploy_time as deployTime,
|
||||
deploy_user as deployUser
|
||||
from app_version
|
||||
where type = #{type} and version > #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue