Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
0eaeb751
Commit
0eaeb751
authored
Jun 24, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12
parent
1ef5a4d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
206 additions
and
0 deletions
+206
-0
AppVersion.java
...rc/main/java/com/xxfc/platform/app/entity/AppVersion.java
+100
-0
AppVersionBiz.java
...rc/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
+52
-0
AppVersionMapper.java
...n/java/com/xxfc/platform/app/mapper/AppVersionMapper.java
+15
-0
AppVersionController.java
...java/com/xxfc/platform/app/rest/AppVersionController.java
+39
-0
No files found.
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/AppVersion.java
0 → 100644
View file @
0eaeb751
package
com
.
xxfc
.
platform
.
app
.
entity
;
import
java.io.Serializable
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
*
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 10:34:00
*/
@Data
@Table
(
name
=
"app_version"
)
public
class
AppVersion
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* app版本信息表
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"app版本信息表"
)
private
Integer
id
;
/**
* app手机系统类型(0:安卓,1:IOS)
*/
@Column
(
name
=
"sys_type"
)
@ApiModelProperty
(
value
=
"app手机系统类型(0:安卓,1:IOS)"
)
private
Integer
sysType
;
/**
* 版本号
*/
@Column
(
name
=
"version"
)
@ApiModelProperty
(
value
=
"版本号"
)
private
String
version
;
/**
* 版本号
*/
@Column
(
name
=
"version_name"
)
@ApiModelProperty
(
value
=
"版本号名称"
)
private
String
versionName
;
/**
* 包的大小
*/
@Column
(
name
=
"packagesize"
)
@ApiModelProperty
(
value
=
"包的大小"
)
private
String
packagesize
;
/**
* 升级内容
*/
@Column
(
name
=
"content"
)
@ApiModelProperty
(
value
=
"升级内容"
)
private
String
content
;
/**
* 下载地址
*/
@Column
(
name
=
"download_url"
)
@ApiModelProperty
(
value
=
"下载地址"
)
private
String
downloadUrl
;
/**
* 下载开关(0:可下载,1:不可下载)
*/
@Column
(
name
=
"download_switch"
)
@ApiModelProperty
(
value
=
"下载开关(0:可下载,1:不可下载)"
)
private
Integer
downloadSwitch
;
/**
* 权重
*/
@Column
(
name
=
"weigh"
)
@ApiModelProperty
(
value
=
"权重"
)
private
Integer
weigh
;
/**
* 版本上传时间
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"版本上传时间"
,
hidden
=
true
)
private
Long
crtTime
;
/**
* 是否删除;0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除;0-正常;1-删除"
)
private
Integer
isDel
;
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/AppVersionBiz.java
0 → 100644
View file @
0eaeb751
package
com
.
xxfc
.
platform
.
app
.
biz
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.mapper.AppVersionMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
/**
*
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 10:34:00
*/
@Service
public
class
AppVersionBiz
extends
BaseBiz
<
AppVersionMapper
,
AppVersion
>
{
public
ObjectRestResponse
getVersion
(
String
version
,
Integer
type
){
if
(
StringUtils
.
isBlank
(
version
)||
type
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
version
=
version
.
trim
();
Example
example
=
new
Example
(
AppVersion
.
class
);
example
.
createCriteria
().
andEqualTo
(
"isDel"
,
0
).
andEqualTo
(
"downloadSwitch"
,
0
).
andEqualTo
(
"sysType"
,
type
);
example
.
setOrderByClause
(
"version DESC"
);
List
<
AppVersion
>
list
=
selectByExample
(
example
);
example
.
clear
();
example
.
createCriteria
().
andEqualTo
(
"version"
,
version
).
andEqualTo
(
"sysType"
,
type
);
List
<
AppVersion
>
list1
=
selectByExample
(
example
);
Integer
weigh1
=
0
;
if
(
list1
.
size
()>
0
){
weigh1
=
list1
.
get
(
0
).
getWeigh
();
}
if
(
list
.
size
()>
0
){
AppVersion
appVersion
=
list
.
get
(
0
);
String
lats_version
=
appVersion
.
getVersion
();
Integer
weigh
=
appVersion
.
getWeigh
();
if
(!
version
.
equals
(
lats_version
)&&
weigh
>
weigh1
){
return
new
ObjectRestResponse
().
status
(
RestCode
.
SUCCESS
.
getStatus
()).
msg
(
RestCode
.
SUCCESS
.
getMsg
()).
data
(
appVersion
).
rel
(
false
);
}
}
return
ObjectRestResponse
.
succ
();
}
}
\ No newline at end of file
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/mapper/AppVersionMapper.java
0 → 100644
View file @
0eaeb751
package
com
.
xxfc
.
platform
.
app
.
mapper
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
tk.mybatis.mapper.common.Mapper
;
/**
*
*
* @author libin
* @email 18178966185@163.com
* @date 2019-06-24 10:34:00
*/
public
interface
AppVersionMapper
extends
Mapper
<
AppVersion
>
{
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppVersionController.java
0 → 100644
View file @
0eaeb751
package
com
.
xxfc
.
platform
.
app
.
rest
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.app.biz.AppVersionBiz
;
import
com.xxfc.platform.app.entity.AppVersion
;
import
com.xxfc.platform.app.entity.Cofig
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
@RequestMapping
(
"version"
)
@IgnoreClientToken
public
class
AppVersionController
extends
BaseController
<
AppVersionBiz
,
AppVersion
>
{
@ApiModelProperty
(
"app自动更新"
)
@RequestMapping
(
value
=
"/app/unauth/info"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
info
(
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"version"
,
defaultValue
=
""
)
String
version
){
return
baseBiz
.
getVersion
(
version
,
type
);
}
}
\ No newline at end of file
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