Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
62ddcd59
Commit
62ddcd59
authored
May 22, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回值统一
parent
a7049e7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
UploadController.java
...om/gic/haoban/manage/web/controller/UploadController.java
+5
-4
No files found.
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/UploadController.java
View file @
62ddcd59
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller;
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller;
import
cn.hutool.crypto.SecureUtil
;
import
cn.hutool.crypto.SecureUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.UploadUtils
;
import
com.gic.haoban.common.utils.UploadUtils
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
...
@@ -30,9 +31,9 @@ public class UploadController extends WebBaseController {
...
@@ -30,9 +31,9 @@ public class UploadController extends WebBaseController {
@RequestMapping
(
"/upload-file"
)
@RequestMapping
(
"/upload-file"
)
@ResponseBody
@ResponseBody
public
Haoban
Response
upload
(
@RequestParam
MultipartFile
file
)
throws
Exception
{
public
Rest
Response
upload
(
@RequestParam
MultipartFile
file
)
throws
Exception
{
if
(
file
==
null
||
file
.
isEmpty
())
{
if
(
file
==
null
||
file
.
isEmpty
())
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
RestResponse
.
failure
(
"-9999"
,
"上传的文件不能为空!"
);
}
}
String
name
=
file
.
getOriginalFilename
();
String
name
=
file
.
getOriginalFilename
();
// 未加密前文件名称
// 未加密前文件名称
...
@@ -75,10 +76,10 @@ public class UploadController extends WebBaseController {
...
@@ -75,10 +76,10 @@ public class UploadController extends WebBaseController {
res
.
put
(
"size"
,
len
);
res
.
put
(
"size"
,
len
);
res
.
put
(
"key"
,
key
);
res
.
put
(
"key"
,
key
);
res
.
put
(
"url"
,
cloudFileInfo
.
getOrgFileUrl
());
res
.
put
(
"url"
,
cloudFileInfo
.
getOrgFileUrl
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
res
);
return
RestResponse
.
successResult
(
res
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常:{}"
,
e
.
getMessage
(),
e
);
logger
.
info
(
"异常:{}"
,
e
.
getMessage
(),
e
);
return
resultResponse
(
HaoBanErrCode
.
ERR_0
);
return
RestResponse
.
failure
(
"-9999"
,
"操作失败"
);
}
}
}
}
}
}
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