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
48105093
Commit
48105093
authored
Mar 31, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
cef41355
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
84 deletions
+140
-84
DatumVo.java
.../java/cn/wisenergy/chnmuseum/party/common/vo/DatumVo.java
+28
-0
ExhibitionBoard.java
...a/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
+4
-0
ChinaMobileRestApiController.java
...um/party/web/controller/ChinaMobileRestApiController.java
+21
-16
ExhibitionBoardController.java
...useum/party/web/controller/ExhibitionBoardController.java
+67
-52
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+12
-7
LearningContentController.java
...useum/party/web/controller/LearningContentController.java
+1
-1
BaseController.java
...y/chnmuseum/party/web/controller/base/BaseController.java
+7
-8
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/vo/DatumVo.java
0 → 100644
View file @
48105093
package
cn
.
wisenergy
.
chnmuseum
.
party
.
common
.
vo
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
DatumVo
{
private
String
fileName
;
private
String
fileExtName
;
private
String
fileType
;
private
Long
fileSize
;
private
String
fileUrl
;
private
String
updateTime
;
private
String
md5
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/ExhibitionBoard.java
View file @
48105093
...
@@ -140,4 +140,8 @@ public class ExhibitionBoard implements Serializable {
...
@@ -140,4 +140,8 @@ public class ExhibitionBoard implements Serializable {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
String
>
materialUrlList
;
private
List
<
String
>
materialUrlList
;
@ApiModelProperty
(
"所属学习内容ID"
)
@TableField
(
exist
=
false
)
private
String
learningContentId
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ChinaMobileRestApiController.java
View file @
48105093
...
@@ -7,6 +7,7 @@ import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
...
@@ -7,6 +7,7 @@ import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import
cn.wisenergy.chnmuseum.party.common.util.TimeUtils
;
import
cn.wisenergy.chnmuseum.party.common.util.TimeUtils
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.vo.AudioVo
;
import
cn.wisenergy.chnmuseum.party.common.vo.AudioVo
;
import
cn.wisenergy.chnmuseum.party.common.vo.DatumVo
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.common.vo.VideoVo
;
import
cn.wisenergy.chnmuseum.party.common.vo.VideoVo
;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.model.*
;
...
@@ -132,7 +133,9 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -132,7 +133,9 @@ public class ChinaMobileRestApiController extends BaseController {
final
String
organId
=
tBoxOperation
.
getOrganId
();
final
String
organId
=
tBoxOperation
.
getOrganId
();
final
TUser
tUser
=
getcurUser
();
final
TUser
tUser
=
getcurUser
();
if
(
tUser
!=
null
&&
organId
.
equals
(
tUser
.
getOrgId
()))
{
if
(
tUser
!=
null
&&
organId
.
equals
(
tUser
.
getOrgId
()))
{
return
getResult
(
tBoxOperation
.
getPrivateKey
());
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"key"
,
tBoxOperation
.
getPrivateKey
());
return
getResult
(
jsonObject
);
}
else
{
}
else
{
throw
new
InterfaceException
(
"400"
,
"您无权获取本单位机顶盒密钥"
);
throw
new
InterfaceException
(
"400"
,
"您无权获取本单位机顶盒密钥"
);
}
}
...
@@ -367,7 +370,7 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -367,7 +370,7 @@ public class ChinaMobileRestApiController extends BaseController {
@PostMapping
(
"/exhibitionBoard/getPage"
)
@PostMapping
(
"/exhibitionBoard/getPage"
)
@RequiresPermissions
(
"exhibition:board:page"
)
@RequiresPermissions
(
"exhibition:board:page"
)
@ApiOperation
(
value
=
"展板列表查询"
,
notes
=
"展板列表查询"
)
@ApiOperation
(
value
=
"展板列表查询"
,
notes
=
"展板列表查询"
)
public
Map
<
String
,
Object
>
getExhibitionBoardPageList
(
@RequestParam
(
value
=
"learningContentId"
,
required
=
false
)
String
learningContentId
)
{
public
Map
<
String
,
Object
>
getExhibitionBoardPageList
(
@RequestParam
(
value
=
"learningContentId"
)
String
learningContentId
)
{
final
IPage
<
ExhibitionBoard
>
page
=
this
.
learningContentBoardService
.
getBoardPageByLearningContentId
(
getPage
(),
learningContentId
,
null
);
final
IPage
<
ExhibitionBoard
>
page
=
this
.
learningContentBoardService
.
getBoardPageByLearningContentId
(
getPage
(),
learningContentId
,
null
);
for
(
ExhibitionBoard
exhibitionBoard
:
page
.
getRecords
())
{
for
(
ExhibitionBoard
exhibitionBoard
:
page
.
getRecords
())
{
if
(
exhibitionBoard
.
getAssetCopyrightOwnerId
()
!=
null
)
{
if
(
exhibitionBoard
.
getAssetCopyrightOwnerId
()
!=
null
)
{
...
@@ -381,9 +384,10 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -381,9 +384,10 @@ public class ChinaMobileRestApiController extends BaseController {
final
String
assetId
=
exhibitionBoard
.
getAssetId
();
final
String
assetId
=
exhibitionBoard
.
getAssetId
();
final
Asset
asset
=
this
.
assetService
.
getById
(
assetId
);
final
Asset
asset
=
this
.
assetService
.
getById
(
assetId
);
final
String
videoUrl
=
asset
.
getVideoUrl
();
final
String
videoUrl
=
asset
.
getVideoUrl
();
final
List
<
VideoVo
>
videoVoList
=
JSONObject
.
parseObject
(
videoUrl
,
new
TypeReference
<
List
<
VideoVo
>>()
{
final
List
<
VideoVo
>
videoVoList
=
JSONObject
.
parseObject
(
videoUrl
,
new
TypeReference
<
List
<
VideoVo
>>()
{},
Feature
.
OrderedField
);
},
Feature
.
OrderedField
);
exhibitionBoard
.
setVideoUrlList
(
videoVoList
.
stream
().
map
(
VideoVo:
:
getFileUrl
).
collect
(
Collectors
.
toList
()));
exhibitionBoard
.
setVideoUrlList
(
videoVoList
.
stream
().
map
(
VideoVo:
:
getFileUrl
).
collect
(
Collectors
.
toList
()));
exhibitionBoard
.
setVideoUrl
(
videoUrl
);
exhibitionBoard
.
setLearningContentId
(
learningContentId
);
}
}
return
getResult
(
page
);
return
getResult
(
page
);
}
}
...
@@ -452,16 +456,19 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -452,16 +456,19 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"learningProjectId"
,
value
=
"学习项目ID"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
@PostMapping
(
"/learningContent/getPage"
)
@PostMapping
(
"/learningContent/getPage"
)
@RequiresPermissions
(
"learning:content:page"
)
@RequiresPermissions
(
"learning:content:page"
)
@ApiOperation
(
value
=
"查询学习内容"
,
notes
=
"查询学习内容"
)
@ApiOperation
(
value
=
"查询学习内容"
,
notes
=
"查询学习内容"
)
public
Map
<
String
,
Object
>
getLearningContentPageList
(
GenericPageParam
genericPageParam
)
{
public
Map
<
String
,
Object
>
getLearningContentPageList
(
GenericPageParam
genericPageParam
,
@RequestParam
(
value
=
"learningProjectId"
,
required
=
false
)
String
learningProjectId
)
{
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
LearningContent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
learningProjectId
))
{
queryWrapper
.
eq
(
LearningContent:
:
getLearningProjectId
,
learningProjectId
);
}
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
LearningContent:
:
getName
,
genericPageParam
.
getNameOrCode
());
queryWrapper
.
like
(
LearningContent:
:
getName
,
genericPageParam
.
getNameOrCode
());
}
}
...
@@ -532,19 +539,17 @@ public class ChinaMobileRestApiController extends BaseController {
...
@@ -532,19 +539,17 @@ public class ChinaMobileRestApiController extends BaseController {
}
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"boardId"
,
value
=
"展板内容ID"
,
paramType
=
"path"
,
dataType
=
"String"
,
required
=
true
)
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"boardId"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
@
PostMapping
(
"/exhibitionBoard/getRefMaterial
"
)
@
GetMapping
(
"/exhibitionBoard/getRefMaterial/{boardId}
"
)
@RequiresPermissions
(
"learning:project:page"
)
@RequiresPermissions
(
"learning:project:page"
)
@ApiOperation
(
value
=
"展板参考资料查询"
,
notes
=
"展板参考资料查询"
)
@ApiOperation
(
value
=
"展板参考资料查询"
,
notes
=
"展板参考资料查询"
)
public
Map
<
String
,
Object
>
getBoardRefMaterial
(
@
RequestParam
(
value
=
"boardId"
,
required
=
false
)
String
boardId
)
{
public
Map
<
String
,
Object
>
getBoardRefMaterial
(
@
PathVariable
(
value
=
"boardId"
)
String
boardId
)
{
final
ExhibitionBoard
exhibitionBoard
=
this
.
exhibitionBoardService
.
getById
(
boardId
);
final
ExhibitionBoard
exhibitionBoard
=
this
.
exhibitionBoardService
.
getById
(
boardId
);
final
String
refMaterialUrl
=
exhibitionBoard
.
getRefMaterialUrl
();
final
String
refMaterialUrl
=
exhibitionBoard
.
getRefMaterialUrl
();
final
List
<
AudioVo
>
audioVoList
=
JSONObject
.
parseObject
(
refMaterialUrl
,
new
TypeReference
<
List
<
AudioVo
>>()
{
final
List
<
DatumVo
>
datumVoList
=
JSONObject
.
parseObject
(
refMaterialUrl
,
new
TypeReference
<
List
<
DatumVo
>>()
{},
Feature
.
OrderedField
);
},
Feature
.
OrderedField
);
return
getResult
(
datumVoList
);
return
getResult
(
audioVoList
);
}
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ExhibitionBoardController.java
View file @
48105093
This diff is collapsed.
Click to expand it.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
48105093
...
@@ -16,7 +16,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -16,7 +16,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -43,9 +42,9 @@ import java.util.Objects;
...
@@ -43,9 +42,9 @@ import java.util.Objects;
public
class
FileUploadController
{
public
class
FileUploadController
{
private
static
final
String
[]
IMAGE_TYPE
=
new
String
[]{
"JPG"
,
"JPEG"
,
"PNG"
,
"BMP"
,
"WBMP"
};
private
static
final
String
[]
IMAGE_TYPE
=
new
String
[]{
"JPG"
,
"JPEG"
,
"PNG"
,
"BMP"
,
"WBMP"
};
private
static
final
String
[]
AUDIO_TYPE
=
new
String
[]{
"MP3"
,
"AAC"
,
"WMA"
,
"
WAV"
,
"
FLAC"
,
"RM"
,
"OGG"
};
private
static
final
String
[]
AUDIO_TYPE
=
new
String
[]{
"MP3"
,
"AAC"
,
"WMA"
,
"FLAC"
,
"RM"
,
"OGG"
};
private
static
final
String
[]
VIDEO_TYPE
=
new
String
[]{
"MP4"
,
"FLV"
};
private
static
final
String
[]
VIDEO_TYPE
=
new
String
[]{
"MP4"
,
"FLV"
};
private
static
final
String
[]
DOC_TYPE
=
new
String
[]{
"PDF"
,
"DOC"
,
"DOCX"
,
"
XLS"
,
"XLSX"
,
"PPT"
,
"PPT
X"
};
private
static
final
String
[]
DOC_TYPE
=
new
String
[]{
"PDF"
,
"DOC"
,
"DOCX"
,
"
PPT"
,
"PPTX"
,
"XLS"
,
"XLS
X"
};
private
static
final
String
[]
DATUM_TYPE
=
ArrayUtil
.
addAll
(
DOC_TYPE
,
IMAGE_TYPE
,
VIDEO_TYPE
);
private
static
final
String
[]
DATUM_TYPE
=
ArrayUtil
.
addAll
(
DOC_TYPE
,
IMAGE_TYPE
,
VIDEO_TYPE
);
// @RequestMapping(value = "/upload", method = RequestMethod.POST)
// @RequestMapping(value = "/upload", method = RequestMethod.POST)
...
@@ -111,7 +110,7 @@ public class FileUploadController {
...
@@ -111,7 +110,7 @@ public class FileUploadController {
int
failureCount
=
0
;
int
failureCount
=
0
;
List
<
BatchUploadResVO
.
HandleResult
>
handleList
=
new
ArrayList
<>();
List
<
BatchUploadResVO
.
HandleResult
>
handleList
=
new
ArrayList
<>();
List
<
String
>
video
UrlList
=
new
ArrayList
<>();
List
<
String
>
datum
UrlList
=
new
ArrayList
<>();
for
(
MultipartFile
file
:
files
)
{
for
(
MultipartFile
file
:
files
)
{
// 当前维度表下线结果
// 当前维度表下线结果
BatchUploadResVO
.
HandleResult
handleResult
=
new
BatchUploadResVO
.
HandleResult
();
BatchUploadResVO
.
HandleResult
handleResult
=
new
BatchUploadResVO
.
HandleResult
();
...
@@ -132,10 +131,16 @@ public class FileUploadController {
...
@@ -132,10 +131,16 @@ public class FileUploadController {
handleResult
.
setHandleResult
(
HANDLE_STATUS_ENUM
.
SUCCESS
.
getName
());
handleResult
.
setHandleResult
(
HANDLE_STATUS_ENUM
.
SUCCESS
.
getName
());
boolean
anyMatch
=
Arrays
.
stream
(
DATUM_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
FilenameUtils
.
getExtension
(
originalFilename
).
toUpperCase
()));
boolean
anyMatch
=
Arrays
.
stream
(
DATUM_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
FilenameUtils
.
getExtension
(
originalFilename
).
toUpperCase
()));
if
(
anyMatch
)
{
if
(
anyMatch
)
{
String
url
=
FastDFSUtils
.
uploadFile
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
);
String
url
;
boolean
anyVideoMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
FilenameUtils
.
getExtension
(
originalFilename
).
toUpperCase
()));
if
(
anyVideoMatch
)
{
url
=
FastDFSUtils
.
uploadFile
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
);
}
else
{
url
=
FastDFSUtils
.
uploadFile
(
file
.
getInputStream
(),
file
.
getSize
(),
originalFilename
);
}
handleResult
.
setFileUrl
(
url
);
handleResult
.
setFileUrl
(
url
);
handleResult
.
setDescription
(
"操作成功"
);
handleResult
.
setDescription
(
"操作成功"
);
video
UrlList
.
add
(
url
);
datum
UrlList
.
add
(
url
);
successCount
++;
successCount
++;
}
else
{
}
else
{
handleResult
.
setFileUrl
(
""
);
handleResult
.
setFileUrl
(
""
);
...
@@ -151,7 +156,7 @@ public class FileUploadController {
...
@@ -151,7 +156,7 @@ public class FileUploadController {
batchUploadResVO
.
setSuccessCount
(
successCount
);
batchUploadResVO
.
setSuccessCount
(
successCount
);
batchUploadResVO
.
setTotal
(
files
.
length
);
batchUploadResVO
.
setTotal
(
files
.
length
);
batchUploadResVO
.
setHandleList
(
handleList
);
batchUploadResVO
.
setHandleList
(
handleList
);
batchUploadResVO
.
setUrlList
(
video
UrlList
);
batchUploadResVO
.
setUrlList
(
datum
UrlList
);
return
ResponseEntity
.
ok
(
batchUploadResVO
);
return
ResponseEntity
.
ok
(
batchUploadResVO
);
}
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentController.java
View file @
48105093
...
@@ -112,7 +112,7 @@ public class LearningContentController extends BaseController {
...
@@ -112,7 +112,7 @@ public class LearningContentController extends BaseController {
QueryWrapper
<
LearningContentBoard
>
learningContentBoardQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
LearningContentBoard
>
learningContentBoardQueryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"max(sortorder) as sortorder"
);
queryWrapper
.
select
(
"max(sortorder) as sortorder"
);
LearningContentBoard
one
=
this
.
learningContentBoardService
.
getOne
(
learningContentBoardQueryWrapper
);
LearningContentBoard
one
=
this
.
learningContentBoardService
.
getOne
(
learningContentBoardQueryWrapper
);
if
(
one
!=
null
)
{
if
(
one
!=
null
&&
one
.
getSortorder
()
!=
null
)
{
learningContentBoard
.
setSortorder
(
one
.
getSortorder
()
+
1
);
learningContentBoard
.
setSortorder
(
one
.
getSortorder
()
+
1
);
}
else
{
}
else
{
learningContentBoard
.
setSortorder
(
1
);
learningContentBoard
.
setSortorder
(
1
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/base/BaseController.java
View file @
48105093
...
@@ -9,7 +9,6 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -9,7 +9,6 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SimplePropertyPreFilter
;
import
com.alibaba.fastjson.serializer.SimplePropertyPreFilter
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.catalina.User
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -17,7 +16,7 @@ import org.slf4j.LoggerFactory;
...
@@ -17,7 +16,7 @@ import org.slf4j.LoggerFactory;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.
Linked
HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -63,7 +62,7 @@ public class BaseController implements Serializable {
...
@@ -63,7 +62,7 @@ public class BaseController implements Serializable {
* @return map
* @return map
*/
*/
protected
Map
<
String
,
Object
>
getResult
(
Object
obj
)
{
protected
Map
<
String
,
Object
>
getResult
(
Object
obj
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
Linked
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getMessage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getMessage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
obj
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
obj
);
...
@@ -76,7 +75,7 @@ public class BaseController implements Serializable {
...
@@ -76,7 +75,7 @@ public class BaseController implements Serializable {
* @return map
* @return map
*/
*/
protected
Map
<
String
,
Object
>
getSuccessResult
()
{
protected
Map
<
String
,
Object
>
getSuccessResult
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
Linked
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getMessage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
REQUEST_SUCCESS
.
getMessage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
""
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_BODY
.
getKey
(),
""
);
...
@@ -91,7 +90,7 @@ public class BaseController implements Serializable {
...
@@ -91,7 +90,7 @@ public class BaseController implements Serializable {
* @return map
* @return map
*/
*/
protected
Map
<
String
,
Object
>
getFailResult
(
String
code
,
String
msg
)
{
protected
Map
<
String
,
Object
>
getFailResult
(
String
code
,
String
msg
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
Linked
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
code
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
code
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
msg
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
msg
);
return
map
;
return
map
;
...
@@ -104,7 +103,7 @@ public class BaseController implements Serializable {
...
@@ -104,7 +103,7 @@ public class BaseController implements Serializable {
* @return map
* @return map
*/
*/
protected
Map
<
String
,
Object
>
getFailResult
(
RESPONSE_CODE_ENUM
responseCodeEnum
)
{
protected
Map
<
String
,
Object
>
getFailResult
(
RESPONSE_CODE_ENUM
responseCodeEnum
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
Linked
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
responseCodeEnum
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
responseCodeEnum
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
responseCodeEnum
.
getMessage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
responseCodeEnum
.
getMessage
());
return
map
;
return
map
;
...
@@ -116,7 +115,7 @@ public class BaseController implements Serializable {
...
@@ -116,7 +115,7 @@ public class BaseController implements Serializable {
* @return map
* @return map
*/
*/
protected
Map
<
String
,
Object
>
getFailResult
()
{
protected
Map
<
String
,
Object
>
getFailResult
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
Linked
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getMessage
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getMessage
());
return
map
;
return
map
;
...
@@ -128,7 +127,7 @@ public class BaseController implements Serializable {
...
@@ -128,7 +127,7 @@ public class BaseController implements Serializable {
* @return map
* @return map
*/
*/
protected
Map
<
String
,
Object
>
getFailResult
(
String
msg
)
{
protected
Map
<
String
,
Object
>
getFailResult
(
String
msg
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
Linked
HashMap
<>();
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_CODE
.
getKey
(),
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
());
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
msg
);
map
.
put
(
RESULT_INFO_ENUM
.
RESULT_MSG
.
getKey
(),
msg
);
return
map
;
return
map
;
...
...
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