Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
3ccefeda
Commit
3ccefeda
authored
4 years ago
by
ilal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app检查应用程序版本
parent
ba2f738a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
259 additions
and
0 deletions
+259
-0
src/main/java/cn/timer/api/bean/app/CheckAppVersion.java
+65
-0
src/main/java/cn/timer/api/config/interceptor/WebSecurityConfig.java
+1
-0
src/main/java/cn/timer/api/controller/app/AppModuleController.java
+35
-0
src/main/java/cn/timer/api/dao/app/CheckAppVersionMapper.java
+17
-0
src/main/resources/mapping/app/CheckAppVersionMapper.xml
+141
-0
No files found.
src/main/java/cn/timer/api/bean/app/CheckAppVersion.java
0 → 100644
View file @
3ccefeda
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
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/config/interceptor/WebSecurityConfig.java
View file @
3ccefeda
...
...
@@ -47,6 +47,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
.
excludePathPatterns
(
"/swagger*/**"
)
.
excludePathPatterns
(
"/v2/api-docs"
)
.
excludePathPatterns
(
"/druid/login*"
)
.
excludePathPatterns
(
"/app/**"
)
.
excludePathPatterns
(
"/webjars/**"
);
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/app/AppModuleController.java
0 → 100644
View file @
3ccefeda
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
,
"操作成功!"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/app/CheckAppVersionMapper.java
0 → 100644
View file @
3ccefeda
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
>
{
}
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/app/CheckAppVersionMapper.xml
0 → 100644
View file @
3ccefeda
<?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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment