Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
691e614d
Commit
691e614d
authored
Mar 30, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/lee/chnmuseum-party
into master
parents
0a3d946b
7d9bc8a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
54 deletions
+45
-54
MvcConfiguration.java
...a/cn/wisenergy/chnmuseum/party/conf/MvcConfiguration.java
+1
-1
TAppVersion.java
.../java/cn/wisenergy/chnmuseum/party/model/TAppVersion.java
+0
-3
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+7
-7
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+27
-0
TAppVersionController.java
...chnmuseum/party/web/controller/TAppVersionController.java
+10
-43
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/conf/MvcConfiguration.java
View file @
691e614d
...
...
@@ -81,7 +81,7 @@ public class MvcConfiguration extends WebMvcConfigurationSupport {
// serializeConfig.put(Long.class, ToStringSerializer.instance);
// serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
serializeConfig
.
setPropertyNamingStrategy
(
PropertyNamingStrategy
.
CamelCase
);
serializeConfig
.
put
(
LocalDateTime
.
class
,
new
MyLocalDateTimeSerializer
(
"yyyy-MM-dd"
));
serializeConfig
.
put
(
LocalDateTime
.
class
,
new
MyLocalDateTimeSerializer
(
"yyyy-MM-dd
hh:mm:ss
"
));
serializeConfig
.
put
(
LocalDate
.
class
,
new
MyLocalDateSerializer
(
"yyyy-MM-dd"
));
fastJsonConfig
.
setSerializeConfig
(
serializeConfig
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/TAppVersion.java
View file @
691e614d
...
...
@@ -2,16 +2,13 @@ package cn.wisenergy.chnmuseum.party.model;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.Version
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
691e614d
...
...
@@ -638,11 +638,11 @@ public class ChinaMobileRestApiController extends BaseController {
current
=
currentList
.
get
(
0
);
}
Map
map
=
new
HashMap
();
map
.
put
(
"isLatest"
,
versionNo
.
equals
(
current
.
getAppVersion
()));
map
.
put
(
"versionNo"
,
current
.
getAppVersion
());
map
.
put
(
"versionUrl"
,
current
.
getApkUrl
());
map
.
put
(
"updateLog"
,
current
.
getUpdateLog
());
map
.
put
(
"updateTime"
,
DateUtil
.
format
(
current
.
getUpdateTime
(),
DateUtil
.
FORMAT_ONE
));
map
.
put
(
"isLatest"
,
versionNo
.
equals
(
current
.
getAppVersion
()));
map
.
put
(
"versionNo"
,
current
.
getAppVersion
());
map
.
put
(
"versionUrl"
,
current
.
getApkUrl
());
map
.
put
(
"updateLog"
,
current
.
getUpdateLog
());
map
.
put
(
"updateTime"
,
current
.
getUpdateTime
(
));
return
getResult
(
map
);
}
...
...
@@ -670,8 +670,8 @@ public class ChinaMobileRestApiController extends BaseController {
}
Map
map
=
new
HashMap
();
map
.
put
(
"dirImgUrl"
,
currentDir
!=
null
?
currentDir
.
getAppDirPic
()
:
"未设置目录图片"
);
map
.
put
(
"runImgUrl"
,
currentRun
!=
null
?
currentRun
.
getAppRunPic
()
:
"未设置运行图片"
);
map
.
put
(
"dirImgUrl"
,
currentDir
!=
null
?
currentDir
.
getAppDirPic
()
:
"未设置目录图片"
);
map
.
put
(
"runImgUrl"
,
currentRun
!=
null
?
currentRun
.
getAppRunPic
()
:
"未设置运行图片"
);
return
getResult
(
map
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
691e614d
...
...
@@ -181,6 +181,33 @@ public class FileUploadController {
return
ResponseEntity
.
ok
(
imageUploadResult
);
}
@PostMapping
(
value
=
"/file/upload/allType"
,
headers
=
"content-type=multipart/form-data"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@RequiresPermissions
(
"file:upload:allType"
)
@ApiOperation
(
value
=
"单文件上传(不限格式)"
,
notes
=
"单文件上传(不限格式)"
)
public
ResponseEntity
<
ImageUploadResult
>
uploadAllType
(
@RequestParam
(
value
=
"file"
)
MultipartFile
uploadFile
)
throws
Exception
{
if
(
uploadFile
==
null
||
uploadFile
.
getSize
()
==
0
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
(),
"没有文件可供上传"
);
}
String
fileName
=
uploadFile
.
getOriginalFilename
();
String
extension
=
FilenameUtils
.
getExtension
(
fileName
);
if
(
StringUtils
.
isBlank
(
extension
))
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
(),
"文件格式不支持"
);
}
// boolean anyMatch = Arrays.stream(IMAGE_TYPE).anyMatch(s -> Objects.equals(s, extension.toUpperCase()));
// if (!anyMatch) {
// throw new InterfaceException(RESPONSE_CODE_ENUM.SERVER_ERROR.getResultCode(), "文件格式不支持");
// }
String
url
=
FastDFSUtils
.
uploadFile
(
uploadFile
.
getInputStream
(),
uploadFile
.
getSize
(),
fileName
);
ImageUploadResult
imageUploadResult
=
new
ImageUploadResult
();
imageUploadResult
.
setFileName
(
fileName
);
imageUploadResult
.
setFileExtName
(
extension
);
imageUploadResult
.
setFileSize
(
uploadFile
.
getSize
());
imageUploadResult
.
setUrl
(
url
);
return
ResponseEntity
.
ok
(
imageUploadResult
);
}
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"file"
,
value
=
"音频文件"
,
paramType
=
"form"
,
dataType
=
"__file"
,
collectionFormat
=
"array"
,
allowMultiple
=
true
)
})
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TAppVersionController.java
View file @
691e614d
...
...
@@ -2,17 +2,12 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
cn.wisenergy.chnmuseum.party.model.TAppVersion
;
import
cn.wisenergy.chnmuseum.party.service.TAppVersionService
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -23,10 +18,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.stereotype.Controller
;
import
javax.annotation.Resource
;
import
java
x.validation.constraints.NotNull
;
import
java
.time.LocalDate
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -108,37 +101,6 @@ public class TAppVersionController extends BaseController {
return
getFailResult
();
}
// @PutMapping("/updateStatus/{id}")
// @RequiresPermissions("t:app:version:update:status")
// @ApiOperation(value = "更新版本状态", notes = "更新版本状态")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
// @ApiImplicitParam(name = "isCurrent", value = "是否为当前版本 0:否 1:是", paramType = "query", dataType = "Integer")
// })
// public Map<String, Object> updateStatus(@NotNull(message = "ID不能为空") @PathVariable("id") String id, @RequestParam("isCurrent") Integer isCurrent) {
// TAppVersion appVersion = new TAppVersion();
// appVersion.setId(id);
// appVersion.setIsCurrent(isCurrent);
//
// // 如果有其他版本是当前版本状态,将其当前版本状态取消
// QueryWrapper<TAppVersion> qw = new QueryWrapper<>();
// qw.eq("is_current",1);
// List<TAppVersion> currentList = tAppVersionService.list(qw);
// if (currentList != null && currentList.size() > 0 && isCurrent == 1){
// currentList.stream().forEach(c->{
// c.setIsCurrent(0);
// });
// tAppVersionService.updateBatchById(currentList);
// }
// // 将指定办版本设置为当前版本
// boolean flag = tAppVersionService.updateById(appVersion);
// if (flag) {
// return getSuccessResult();
// }
//
// return getFailResult();
// }
@DeleteMapping
(
"/delete/{id}"
)
@RequiresPermissions
(
"t:app:version:delete"
)
@ApiOperation
(
value
=
"根据ID删除"
,
notes
=
"根据ID删除"
)
...
...
@@ -169,22 +131,27 @@ public class TAppVersionController extends BaseController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始时间"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"isCurrent"
,
value
=
"是否为当前版本 0:否 1:是"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"t:app:version:page"
)
@ApiOperation
(
value
=
"获取分页列表"
,
notes
=
"获取分页列表"
)
public
Map
<
String
,
Object
>
getTAppVersionPageList
(
String
isCurrent
)
{
public
Map
<
String
,
Object
>
getTAppVersionPageList
(
LocalDate
startDate
,
LocalDate
endDate
,
String
isCurrent
)
{
LambdaQueryWrapper
<
TAppVersion
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 查询是否为当前版本
if
(
StringUtils
.
isNotBlank
(
isCurrent
))
{
queryWrapper
.
like
(
TAppVersion:
:
getIsCurrent
,
isCurrent
);
}
// 查询时间范围
if
(
startDate
!=
null
&&
endDate
!=
null
){
queryWrapper
.
ge
(
TAppVersion:
:
getUpdateTime
,
startDate
.
atTime
(
0
,
0
,
0
))
.
le
(
TAppVersion:
:
getUpdateTime
,
endDate
.
atTime
(
23
,
59
,
59
));
}
queryWrapper
.
select
().
orderByDesc
(
TAppVersion:
:
getUpdateTime
);
Page
<
TAppVersion
>
page
=
this
.
tAppVersionService
.
page
(
getPage
(),
queryWrapper
);
for
(
TAppVersion
tAppVersion
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
...
...
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