Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
answer-backend
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
answer
answer-backend
Commits
d33e4cf1
Commit
d33e4cf1
authored
Mar 30, 2023
by
wqc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新上传图片和活动规则
parent
78e851a4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
6 deletions
+52
-6
admin-server/src/main/java/com/zq/admin/config/security/SpringSecurityConfig.java
+1
-0
answer-common-utils/src/main/java/com/zq/common/utils/UploadUtils.java
+3
-2
file-server/src/main/java/com/zq/file/controller/FileController.java
+1
-0
user-server/src/main/java/com/zq/user/controller/LotteryInfoController.java
+3
-4
user-server/src/main/java/com/zq/user/entity/LotteryInfo.java
+18
-0
user-server/src/main/java/com/zq/user/service/LotteryInfoService.java
+9
-0
user-server/src/main/java/com/zq/user/vo/LotteryInfoVo.java
+17
-0
No files found.
admin-server/src/main/java/com/zq/admin/config/security/SpringSecurityConfig.java
View file @
d33e4cf1
...
@@ -112,6 +112,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -112,6 +112,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
// 文件
// 文件
.
antMatchers
(
"/admin/avatar/**"
).
permitAll
()
.
antMatchers
(
"/admin/avatar/**"
).
permitAll
()
.
antMatchers
(
"/admin/file/**"
).
permitAll
()
.
antMatchers
(
"/admin/file/**"
).
permitAll
()
.
antMatchers
(
"/images/mzcj/**"
).
permitAll
()
// 阿里巴巴 druid
// 阿里巴巴 druid
.
antMatchers
(
"/admin/druid/**"
).
permitAll
()
.
antMatchers
(
"/admin/druid/**"
).
permitAll
()
// 放行OPTIONS请求
// 放行OPTIONS请求
...
...
answer-common-utils/src/main/java/com/zq/common/utils/UploadUtils.java
View file @
d33e4cf1
...
@@ -22,6 +22,7 @@ import java.util.Objects;
...
@@ -22,6 +22,7 @@ import java.util.Objects;
public
class
UploadUtils
{
public
class
UploadUtils
{
private
final
static
String
DATE_FORMAT
=
"/yyyyMM/dd/"
;
private
final
static
String
DATE_FORMAT
=
"/yyyyMM/dd/"
;
private
final
static
String
FILE_PATH
=
"https://mzxt.mzt.gxzf.gov.cn:11110"
;
/**
/**
* 保存图片
* 保存图片
...
@@ -39,7 +40,7 @@ public class UploadUtils {
...
@@ -39,7 +40,7 @@ public class UploadUtils {
String
yyyyMMdd
=
new
SimpleDateFormat
(
DATE_FORMAT
).
format
(
new
Date
());
String
yyyyMMdd
=
new
SimpleDateFormat
(
DATE_FORMAT
).
format
(
new
Date
());
File
dest
=
new
File
(
"/images/"
+
systemName
+
yyyyMMdd
+
name
);
File
dest
=
new
File
(
"/images/"
+
systemName
+
yyyyMMdd
+
name
);
FileUtils
.
writeByteArrayToFile
(
dest
,
file
.
getBytes
());
FileUtils
.
writeByteArrayToFile
(
dest
,
file
.
getBytes
());
return
"/images/"
+
systemName
+
yyyyMMdd
+
name
;
return
FILE_PATH
+
"/images/"
+
systemName
+
yyyyMMdd
+
name
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"图保存失败:{}"
,
e
.
getMessage
());
log
.
error
(
"图保存失败:{}"
,
e
.
getMessage
());
throw
new
BusinessException
(
"图保存失败"
);
throw
new
BusinessException
(
"图保存失败"
);
...
@@ -61,7 +62,7 @@ public class UploadUtils {
...
@@ -61,7 +62,7 @@ public class UploadUtils {
String
yyyyMMdd
=
new
SimpleDateFormat
(
DATE_FORMAT
).
format
(
new
Date
());
String
yyyyMMdd
=
new
SimpleDateFormat
(
DATE_FORMAT
).
format
(
new
Date
());
File
dest
=
new
File
(
"/file/"
+
systemName
+
yyyyMMdd
+
name
);
File
dest
=
new
File
(
"/file/"
+
systemName
+
yyyyMMdd
+
name
);
FileUtils
.
writeByteArrayToFile
(
dest
,
file
.
getBytes
());
FileUtils
.
writeByteArrayToFile
(
dest
,
file
.
getBytes
());
return
"/file/"
+
systemName
+
yyyyMMdd
+
name
;
return
FILE_PATH
+
"/file/"
+
systemName
+
yyyyMMdd
+
name
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"文件保存失败:{}"
,
e
.
getMessage
());
log
.
error
(
"文件保存失败:{}"
,
e
.
getMessage
());
throw
new
BusinessException
(
"文件保存失败"
);
throw
new
BusinessException
(
"文件保存失败"
);
...
...
file-server/src/main/java/com/zq/file/controller/FileController.java
View file @
d33e4cf1
package
com
.
zq
.
file
.
controller
;
package
com
.
zq
.
file
.
controller
;
import
com.zq.common.annotation.AnonymousAccess
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.utils.UploadUtils
;
import
com.zq.common.utils.UploadUtils
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.common.vo.ResultVo
;
...
...
user-server/src/main/java/com/zq/user/controller/LotteryInfoController.java
View file @
d33e4cf1
...
@@ -100,10 +100,9 @@ public class LotteryInfoController {
...
@@ -100,10 +100,9 @@ public class LotteryInfoController {
*/
*/
@ApiOperation
(
"修改活动介绍"
)
@ApiOperation
(
"修改活动介绍"
)
@PutMapping
(
value
=
"/update"
)
@PutMapping
(
value
=
"/update"
)
public
ResultVo
updateLotteryInfo
(
@RequestBody
LotteryInfoVo
vo
)
{
public
ResultVo
updateLotteryInfo
(
@RequestBody
LotteryInfo
vo
)
{
AssertUtils
.
isTrue
(
vo
.
getId
()
!=
null
,
"传入id为空"
);
AssertUtils
.
isTrue
(
vo
.
getId
()
!=
null
,
"传入id为空"
);;
lotteryInfoService
.
updateLotteryInfo
(
vo
);
return
ResultVo
.
success
(
lotteryInfoService
.
update
(
vo
));
return
ResultVo
.
success
();
}
}
/**
/**
...
...
user-server/src/main/java/com/zq/user/entity/LotteryInfo.java
View file @
d33e4cf1
...
@@ -45,6 +45,24 @@ class LotteryInfo implements Serializable {
...
@@ -45,6 +45,24 @@ class LotteryInfo implements Serializable {
private
String
remark
;
private
String
remark
;
/**
/**
* 活动规则
*/
@ApiModelProperty
(
value
=
"活动规则 "
)
private
String
rules
;
/**
* 奖品照片
*/
@ApiModelProperty
(
value
=
"奖品照片 "
)
private
String
prizeImage
;
/**
* 奖品描述
*/
@ApiModelProperty
(
value
=
"奖品描述 "
)
private
String
prizeContent
;
/**
* 是否启用该抽奖
* 是否启用该抽奖
*
*
*/
*/
...
...
user-server/src/main/java/com/zq/user/service/LotteryInfoService.java
View file @
d33e4cf1
...
@@ -234,5 +234,14 @@ public class LotteryInfoService {
...
@@ -234,5 +234,14 @@ public class LotteryInfoService {
return
page
;
return
page
;
}
}
public
Boolean
update
(
LotteryInfo
vo
)
{
int
res
;
if
(
vo
.
getId
()
==
null
)
{
res
=
lotteryInfoDao
.
insert
(
vo
);
}
else
{
res
=
lotteryInfoDao
.
updateById
(
vo
);
}
return
res
>
0
;
}
}
}
user-server/src/main/java/com/zq/user/vo/LotteryInfoVo.java
View file @
d33e4cf1
...
@@ -43,6 +43,23 @@ public class LotteryInfoVo extends PageReqVo {
...
@@ -43,6 +43,23 @@ public class LotteryInfoVo extends PageReqVo {
private
String
remark
;
private
String
remark
;
/**
/**
* 活动规则
*/
@ApiModelProperty
(
value
=
"活动规则 "
)
private
String
rules
;
/**
* 奖品照片
*/
@ApiModelProperty
(
value
=
"奖品照片 "
)
private
String
prizeImage
;
/**
* 奖品描述
*/
@ApiModelProperty
(
value
=
"奖品描述 "
)
private
String
prizeContent
;
/**
* 是否启用该抽奖
* 是否启用该抽奖
*
*
*/
*/
...
...
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