Commit bc69d4fc by ilal Committed by chenzg

app检查应用程序版本

parent b854fd5f
package cn.timer.api.bean.app;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-08-12
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "check_app_version")
@ApiModel("APP更新记录")
public class CheckAppVersion extends Model<CheckAppVersion> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "平台类型 ", example = "平台类型")
private String system;
@ApiModelProperty(value = "最新版本 ", example = "最新版本")
private String version;
@ApiModelProperty(value = "最低限制 ", example = "最低限制")
private String limiti;
@ApiModelProperty(value = "下载地址 ", example = "下载地址")
private String url;
@ApiModelProperty(value = "下载地址 ", example = "下载地址")
private String downloadUrl;
@ApiModelProperty(value = "更新内容 ", example = "更新内容")
private String remark;
@ApiModelProperty(value = " ", example = "101")
private Integer forcei;
@ApiModelProperty(value = "最后修改时间 ", example = "最后修改时间")
private String updateTime;
}
\ No newline at end of file
...@@ -47,6 +47,7 @@ public class WebSecurityConfig implements WebMvcConfigurer { ...@@ -47,6 +47,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
.excludePathPatterns("/swagger*/**") .excludePathPatterns("/swagger*/**")
.excludePathPatterns("/v2/api-docs") .excludePathPatterns("/v2/api-docs")
.excludePathPatterns("/druid/login*") .excludePathPatterns("/druid/login*")
.excludePathPatterns("/app/**")
.excludePathPatterns("/webjars/**"); .excludePathPatterns("/webjars/**");
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*"); // registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
} }
......
package cn.timer.api.controller.app;
import java.text.ParseException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.timer.api.bean.app.CheckAppVersion;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "APP")
@RestController
@Transactional
@RequestMapping(value = "/app", produces = { "application/json", "multipart/form-data" })
public class AppModuleController {
@GetMapping(value = "/check_app_version/{typename}")
@ApiOperation(value = "检查应用程序版本", httpMethod = "GET", notes = "查询数据")
public Result<Object> CheckAppVersion(@PathVariable("typename") String typename)
throws ParseException {
// 1:android 2:ios
CheckAppVersion ver = CheckAppVersion.builder().build().selectOne(new QueryWrapper<CheckAppVersion>().lambda().eq(CheckAppVersion::getSystem, typename));
return ResultUtil.data(ver, "操作成功!");
}
}
package cn.timer.api.dao.app;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.app.CheckAppVersion;
/**
* APP更新记录
* @author LAL 2020-08-12
*/
@Repository
public interface CheckAppVersionMapper extends BaseMapper<CheckAppVersion> {
}
<?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="cn.timer.api.dao.app.CheckAppVersionMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.app.CheckAppVersion" >
<id column="id" property="id" />
<result column="system" property="system" />
<result column="version" property="version" />
<result column="limiti" property="limiti" />
<result column="url" property="url" />
<result column="download_url" property="downloadUrl" />
<result column="remark" property="remark" />
<result column="forcei" property="forcei" />
<result column="update_time" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id,
system,
version,
limiti,
url,
download_url,
remark,
forcei,
update_time
</sql>
<sql id="Base_Column_List_Alias">
id CheckAppVersion_id,
system CheckAppVersion_system,
version CheckAppVersion_version,
limiti CheckAppVersion_limiti,
url CheckAppVersion_url,
download_url CheckAppVersion_download_url,
remark CheckAppVersion_remark,
forcei CheckAppVersion_forcei,
update_time CheckAppVersion_update_time
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.app.CheckAppVersion">
INSERT INTO check_app_version
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != system'>
system,
</if>
<if test ='null != version'>
version,
</if>
<if test ='null != limiti'>
limiti,
</if>
<if test ='null != url'>
url,
</if>
<if test ='null != downloadUrl'>
download_url,
</if>
<if test ='null != remark'>
remark,
</if>
<if test ='null != forcei'>
forcei,
</if>
<if test ='null != updateTime'>
update_time
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != system'>
#{system},
</if>
<if test ='null != version'>
#{version},
</if>
<if test ='null != limiti'>
#{limiti},
</if>
<if test ='null != url'>
#{url},
</if>
<if test ='null != downloadUrl'>
#{downloadUrl},
</if>
<if test ='null != remark'>
#{remark},
</if>
<if test ='null != forcei'>
#{forcei},
</if>
<if test ='null != updateTime'>
#{updateTime}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM check_app_version
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.app.CheckAppVersion">
UPDATE check_app_version
<set>
<if test ='null != system'>system = #{system},</if>
<if test ='null != version'>version = #{version},</if>
<if test ='null != limiti'>limiti = #{limiti},</if>
<if test ='null != url'>url = #{url},</if>
<if test ='null != downloadUrl'>download_url = #{downloadUrl},</if>
<if test ='null != remark'>remark = #{remark},</if>
<if test ='null != forcei'>forcei = #{forcei},</if>
<if test ='null != updateTime'>update_time = #{updateTime}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM check_app_version
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM check_app_version
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM check_app_version
</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