修复 redis存时间的问题
This commit is contained in:
19
README.md
19
README.md
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#### 项目简介
|
#### 项目简介
|
||||||
yshop基于当前流行技术组合: SpringBoot2+Jpa+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、
|
yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2+Jpa+MybatisPlus+SpringSecurity+jwt+redis+Vue的前后端分离的商城系统, 包含商城、拼团、砍价、商户管理、 秒杀、优惠券、积分、分销等功能,更适合企业或个人二次开发;;
|
||||||
秒杀、优惠券、积分、分销等功能,更适合企业或个人二次开发;
|
|
||||||
|
|
||||||
**开发文档** 【[查看文档](https://gitee.com/guchengwuyue/yshopmall/wikis/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83?sort_id=1718722)】
|
**开发文档** 【[查看文档](https://gitee.com/guchengwuyue/yshopmall/wikis/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83?sort_id=1718722)】
|
||||||
|
|
||||||
@ -54,7 +53,6 @@ yshop基于当前流行技术组合: SpringBoot2+Jpa+MybatisPlus+SpringSecurit
|
|||||||
#### 已经完成功能
|
#### 已经完成功能
|
||||||
- 可以具体查看演示地址查看当前版本已经完成的功能,不再絮叨啦
|
- 可以具体查看演示地址查看当前版本已经完成的功能,不再絮叨啦
|
||||||
|
|
||||||
|
|
||||||
#### 项目结构
|
#### 项目结构
|
||||||
项目采用分模块开发方式
|
项目采用分模块开发方式
|
||||||
- yshop-api 公众号(H5)API模块
|
- yshop-api 公众号(H5)API模块
|
||||||
@ -86,16 +84,16 @@ yshop基于当前流行技术组合: SpringBoot2+Jpa+MybatisPlus+SpringSecurit
|
|||||||
</table>
|
</table>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="https://images.gitee.com/uploads/images/2019/1121/231156_df0430c8_477893.jpeg"/></td>
|
<td><img src="https://images.gitee.com/uploads/images/2019/1129/234509_744765f9_477893.jpeg"/></td>
|
||||||
<td><img src="https://images.gitee.com/uploads/images/2019/1121/231246_797725e6_477893.jpeg"/></td>
|
<td><img src="https://images.gitee.com/uploads/images/2019/1129/234538_62ba99b7_477893.jpeg"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="https://images.gitee.com/uploads/images/2019/1121/231335_7d732dbd_477893.jpeg"/></td>
|
<td><img src="https://images.gitee.com/uploads/images/2019/1129/234601_7fb028a6_477893.jpeg"/></td>
|
||||||
<td><img src="https://images.gitee.com/uploads/images/2019/1107/201622_f913b59c_477893.png"/></td>
|
<td><img src="https://images.gitee.com/uploads/images/2019/1129/234622_6f593729_477893.jpeg"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="https://images.gitee.com/uploads/images/2019/1107/201646_5bc6df48_477893.png"/></td>
|
<td><img src="https://images.gitee.com/uploads/images/2019/1129/234644_242668a1_477893.jpeg"/></td>
|
||||||
<td><img src="https://images.gitee.com/uploads/images/2019/1107/201706_32ee305c_477893.png"/></td>
|
<td><img src="https://images.gitee.com/uploads/images/2019/1129/234703_49e8fe4f_477893.jpeg"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -123,7 +121,6 @@ yshop基于当前流行技术组合: SpringBoot2+Jpa+MybatisPlus+SpringSecurit
|
|||||||
* 2.1 Vue 全家桶
|
* 2.1 Vue 全家桶
|
||||||
* 2.2 Element
|
* 2.2 Element
|
||||||
|
|
||||||
|
|
||||||
#### 项目发布明细
|
#### 项目发布明细
|
||||||
|
|
||||||
- 1.0版本
|
- 1.0版本
|
||||||
@ -132,6 +129,8 @@ yshop基于当前流行技术组合: SpringBoot2+Jpa+MybatisPlus+SpringSecurit
|
|||||||
- 1.2.1增加了未付款订单取消功能库存销量退出、优惠券、积分功能,个人中心增加了积分流水
|
- 1.2.1增加了未付款订单取消功能库存销量退出、优惠券、积分功能,个人中心增加了积分流水
|
||||||
- 1.3版本新增拼团功能,已经发布
|
- 1.3版本新增拼团功能,已经发布
|
||||||
- 1.3.1版本手机端新增商户管理、后台新增统计
|
- 1.3.1版本手机端新增商户管理、后台新增统计
|
||||||
|
- 1.3.2新增后台微信相关及其支付配置,新增自动回复配置
|
||||||
|
- 1.3.3新增 后台微信图文发送功能,小程序配置,增加小程序授权等,修复一些bug等
|
||||||
- 1.4版本规划:补充公众号功能、发布mpvue小程序
|
- 1.4版本规划:补充公众号功能、发布mpvue小程序
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class YxArticleController {
|
|||||||
@DeleteMapping(value = "/yxArticle/{id}")
|
@DeleteMapping(value = "/yxArticle/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Integer id){
|
public ResponseEntity delete(@PathVariable Integer id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
yxArticleService.delete(id);
|
yxArticleService.delete(id);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class YxArticleController {
|
|||||||
@GetMapping(value = "/yxArticle/publish/{id}")
|
@GetMapping(value = "/yxArticle/publish/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||||
public ResponseEntity publish(@PathVariable Integer id) throws Exception{
|
public ResponseEntity publish(@PathVariable Integer id) throws Exception{
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
YxArticleDTO yxArticleDTO= yxArticleService.findById(id);
|
YxArticleDTO yxArticleDTO= yxArticleService.findById(id);
|
||||||
yxArticleService.uploadNews(yxArticleDTO);
|
yxArticleService.uploadNews(yxArticleDTO);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
|
@ -47,7 +47,7 @@ public class YxCacheController {
|
|||||||
@PostMapping(value = "/yxCache")
|
@PostMapping(value = "/yxCache")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXCACHE_ALL','YXCACHE_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXCACHE_ALL','YXCACHE_CREATE')")
|
||||||
public ResponseEntity create( @RequestBody String jsonStr){
|
public ResponseEntity create( @RequestBody String jsonStr){
|
||||||
//if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
String jsonButton = jsonObject.get("buttons").toString();
|
String jsonButton = jsonObject.get("buttons").toString();
|
||||||
YxCache yxCache = new YxCache();
|
YxCache yxCache = new YxCache();
|
||||||
|
@ -41,7 +41,7 @@ public class YxWechatReplyController {
|
|||||||
@PostMapping(value = "/yxWechatReply")
|
@PostMapping(value = "/yxWechatReply")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_CREATE')")
|
||||||
public ResponseEntity create(@RequestBody String jsonStr){
|
public ResponseEntity create(@RequestBody String jsonStr){
|
||||||
//if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
YxWechatReply yxWechatReply = new YxWechatReply();
|
YxWechatReply yxWechatReply = new YxWechatReply();
|
||||||
YxWechatReply isExist = yxWechatReplyService.isExist(jsonObject.get("key").toString());
|
YxWechatReply isExist = yxWechatReplyService.isExist(jsonObject.get("key").toString());
|
||||||
|
@ -31,13 +31,12 @@ public class SubscribeHandler extends AbstractHandler {
|
|||||||
WxSessionManager sessionManager) throws WxErrorException {
|
WxSessionManager sessionManager) throws WxErrorException {
|
||||||
|
|
||||||
|
|
||||||
|
String str = "你好,欢迎关注yshop!";
|
||||||
YxWechatReply wechatReply = yxWechatReplyService.isExist("subscribe");
|
YxWechatReply wechatReply = yxWechatReplyService.isExist("subscribe");
|
||||||
if(ObjectUtil.isNull(wechatReply)){
|
if(!ObjectUtil.isNull(wechatReply)){
|
||||||
|
str = JSONObject.parseObject(wechatReply.getData()).getString("content");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String str = JSONObject.parseObject(wechatReply.getData()).getString("content");
|
|
||||||
try {
|
try {
|
||||||
WxMpXmlOutMessage msg= WxMpXmlOutMessage.TEXT()
|
WxMpXmlOutMessage msg= WxMpXmlOutMessage.TEXT()
|
||||||
.content(str)
|
.content(str)
|
||||||
|
@ -45,7 +45,7 @@ public class YxStoreCombinationController {
|
|||||||
@PutMapping(value = "/yxStoreCombination")
|
@PutMapping(value = "/yxStoreCombination")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT')")
|
||||||
public ResponseEntity update(@Validated @RequestBody YxStoreCombination resources){
|
public ResponseEntity update(@Validated @RequestBody YxStoreCombination resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
if(ObjectUtil.isNotNull(resources.getStartTimeDate())){
|
if(ObjectUtil.isNotNull(resources.getStartTimeDate())){
|
||||||
resources.setStartTime(OrderUtil.
|
resources.setStartTime(OrderUtil.
|
||||||
dateToTimestamp(resources.getStartTimeDate()));
|
dateToTimestamp(resources.getStartTimeDate()));
|
||||||
@ -67,7 +67,7 @@ public class YxStoreCombinationController {
|
|||||||
@ApiOperation(value = "开启关闭")
|
@ApiOperation(value = "开启关闭")
|
||||||
@PostMapping(value = "/yxStoreCombination/onsale/{id}")
|
@PostMapping(value = "/yxStoreCombination/onsale/{id}")
|
||||||
public ResponseEntity onSale(@PathVariable Integer id,@RequestBody String jsonStr){
|
public ResponseEntity onSale(@PathVariable Integer id,@RequestBody String jsonStr){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
int status = Integer.valueOf(jsonObject.get("status").toString());
|
int status = Integer.valueOf(jsonObject.get("status").toString());
|
||||||
//System.out.println(status);
|
//System.out.println(status);
|
||||||
@ -80,7 +80,7 @@ public class YxStoreCombinationController {
|
|||||||
@DeleteMapping(value = "/yxStoreCombination/{id}")
|
@DeleteMapping(value = "/yxStoreCombination/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Integer id){
|
public ResponseEntity delete(@PathVariable Integer id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
YxStoreCombination combination = new YxStoreCombination();
|
YxStoreCombination combination = new YxStoreCombination();
|
||||||
combination.setIsDel(1);
|
combination.setIsDel(1);
|
||||||
yxStoreCombinationService.update(combination);
|
yxStoreCombinationService.update(combination);
|
||||||
|
@ -36,11 +36,13 @@ public class RedisServiceImpl implements RedisService {
|
|||||||
}
|
}
|
||||||
for (Object s : redisTemplate.keys(key)) {
|
for (Object s : redisTemplate.keys(key)) {
|
||||||
// 过滤掉权限的缓存
|
// 过滤掉权限的缓存
|
||||||
if (s.toString().indexOf("role::loadPermissionByUser") != -1 || s.toString().indexOf("user::loadUserByUsername") != -1) {
|
if (s.toString().indexOf("role::loadPermissionByUser") != -1
|
||||||
|
|| s.toString().indexOf("user::loadUserByUsername") != -1
|
||||||
|
|| s.toString().indexOf("wechat") != -1 || s.toString().indexOf("wxpay") != -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DataType dataType = redisTemplate.type(s.toString());
|
DataType dataType = redisTemplate.type(s.toString());
|
||||||
if(dataType.code().equals("hash")) continue;
|
if(!dataType.code().equals("string")) continue;
|
||||||
RedisVo redisVo = new RedisVo(s.toString(),redisTemplate.opsForValue().get(s.toString()).toString());
|
RedisVo redisVo = new RedisVo(s.toString(),redisTemplate.opsForValue().get(s.toString()).toString());
|
||||||
redisVos.add(redisVo);
|
redisVos.add(redisVo);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class QuartzJobController {
|
|||||||
@PostMapping(value = "/jobs")
|
@PostMapping(value = "/jobs")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_CREATE')")
|
||||||
public ResponseEntity create(@Validated @RequestBody QuartzJob resources){
|
public ResponseEntity create(@Validated @RequestBody QuartzJob resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ public class QuartzJobController {
|
|||||||
@PutMapping(value = "/jobs")
|
@PutMapping(value = "/jobs")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
|
||||||
public ResponseEntity update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){
|
public ResponseEntity update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
quartzJobService.update(resources);
|
quartzJobService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ public class QuartzJobController {
|
|||||||
@PutMapping(value = "/jobs/{id}")
|
@PutMapping(value = "/jobs/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
|
||||||
public ResponseEntity updateIsPause(@PathVariable Long id){
|
public ResponseEntity updateIsPause(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
quartzJobService.updateIsPause(quartzJobService.findById(id));
|
quartzJobService.updateIsPause(quartzJobService.findById(id));
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ public class QuartzJobController {
|
|||||||
@PutMapping(value = "/jobs/exec/{id}")
|
@PutMapping(value = "/jobs/exec/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
|
||||||
public ResponseEntity execution(@PathVariable Long id){
|
public ResponseEntity execution(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
quartzJobService.execution(quartzJobService.findById(id));
|
quartzJobService.execution(quartzJobService.findById(id));
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ public class QuartzJobController {
|
|||||||
@DeleteMapping(value = "/jobs/{id}")
|
@DeleteMapping(value = "/jobs/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
quartzJobService.delete(quartzJobService.findById(id));
|
quartzJobService.delete(quartzJobService.findById(id));
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class YxStoreCategoryController {
|
|||||||
@PostMapping(value = "/yxStoreCategory")
|
@PostMapping(value = "/yxStoreCategory")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')")
|
||||||
public ResponseEntity create(@Validated @RequestBody YxStoreCategory resources){
|
public ResponseEntity create(@Validated @RequestBody YxStoreCategory resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
resources.setAddTime(OrderUtil.getSecondTimestampTwo());
|
resources.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||||
return new ResponseEntity(yxStoreCategoryService.create(resources),HttpStatus.CREATED);
|
return new ResponseEntity(yxStoreCategoryService.create(resources),HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ public class YxStoreCategoryController {
|
|||||||
@PutMapping(value = "/yxStoreCategory")
|
@PutMapping(value = "/yxStoreCategory")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')")
|
||||||
public ResponseEntity update(@Validated @RequestBody YxStoreCategory resources){
|
public ResponseEntity update(@Validated @RequestBody YxStoreCategory resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
yxStoreCategoryService.update(resources);
|
yxStoreCategoryService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ public class YxStoreCategoryController {
|
|||||||
@DeleteMapping(value = "/yxStoreCategory/{id}")
|
@DeleteMapping(value = "/yxStoreCategory/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Integer id){
|
public ResponseEntity delete(@PathVariable Integer id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
yxStoreCategoryService.delete(id);
|
yxStoreCategoryService.delete(id);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class YxStoreProductController {
|
|||||||
@PostMapping(value = "/yxStoreProduct")
|
@PostMapping(value = "/yxStoreProduct")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')")
|
||||||
public ResponseEntity create(@Validated @RequestBody YxStoreProduct resources){
|
public ResponseEntity create(@Validated @RequestBody YxStoreProduct resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
resources.setAddTime(OrderUtil.getSecondTimestampTwo());
|
resources.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||||
if(ObjectUtil.isEmpty(resources.getGiveIntegral())) resources.setGiveIntegral(BigDecimal.ZERO);
|
if(ObjectUtil.isEmpty(resources.getGiveIntegral())) resources.setGiveIntegral(BigDecimal.ZERO);
|
||||||
if(ObjectUtil.isEmpty(resources.getCost())) resources.setCost(BigDecimal.ZERO);
|
if(ObjectUtil.isEmpty(resources.getCost())) resources.setCost(BigDecimal.ZERO);
|
||||||
@ -58,7 +58,7 @@ public class YxStoreProductController {
|
|||||||
@PutMapping(value = "/yxStoreProduct")
|
@PutMapping(value = "/yxStoreProduct")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT')")
|
||||||
public ResponseEntity update(@Validated @RequestBody YxStoreProduct resources){
|
public ResponseEntity update(@Validated @RequestBody YxStoreProduct resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
yxStoreProductService.update(resources);
|
yxStoreProductService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ public class YxStoreProductController {
|
|||||||
@DeleteMapping(value = "/yxStoreProduct/{id}")
|
@DeleteMapping(value = "/yxStoreProduct/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Integer id){
|
public ResponseEntity delete(@PathVariable Integer id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
yxStoreProductService.delete(id);
|
yxStoreProductService.delete(id);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@ -107,7 +107,6 @@ public class YxStoreProductController {
|
|||||||
@ApiOperation(value = "清除属性")
|
@ApiOperation(value = "清除属性")
|
||||||
@PostMapping(value = "/yxStoreProduct/clearAttr/{id}")
|
@PostMapping(value = "/yxStoreProduct/clearAttr/{id}")
|
||||||
public ResponseEntity clearAttr(@PathVariable Integer id){
|
public ResponseEntity clearAttr(@PathVariable Integer id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
|
||||||
yxStoreProductService.clearProductAttr(id,true);
|
yxStoreProductService.clearProductAttr(id,true);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public class YxSystemGroupDataController {
|
|||||||
@PostMapping(value = "/yxSystemGroupData")
|
@PostMapping(value = "/yxSystemGroupData")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
|
||||||
public ResponseEntity create(@RequestBody String jsonStr){
|
public ResponseEntity create(@RequestBody String jsonStr){
|
||||||
//if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
|
|
||||||
if(ObjectUtil.isNotNull(jsonObject.get("name"))){
|
if(ObjectUtil.isNotNull(jsonObject.get("name"))){
|
||||||
@ -88,7 +88,7 @@ public class YxSystemGroupDataController {
|
|||||||
@PutMapping(value = "/yxSystemGroupData")
|
@PutMapping(value = "/yxSystemGroupData")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT')")
|
||||||
public ResponseEntity update(@RequestBody String jsonStr){
|
public ResponseEntity update(@RequestBody String jsonStr){
|
||||||
//if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
if(ObjectUtil.isNotNull(jsonObject.get("name"))){
|
if(ObjectUtil.isNotNull(jsonObject.get("name"))){
|
||||||
if(StrUtil.isEmpty(jsonObject.get("name").toString())){
|
if(StrUtil.isEmpty(jsonObject.get("name").toString())){
|
||||||
@ -123,7 +123,7 @@ public class YxSystemGroupDataController {
|
|||||||
@DeleteMapping(value = "/yxSystemGroupData/{id}")
|
@DeleteMapping(value = "/yxSystemGroupData/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Integer id){
|
public ResponseEntity delete(@PathVariable Integer id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
yxSystemGroupDataService.delete(id);
|
yxSystemGroupDataService.delete(id);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class MenuController {
|
|||||||
@PostMapping(value = "/menus")
|
@PostMapping(value = "/menus")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_CREATE')")
|
||||||
public ResponseEntity create(@Validated @RequestBody Menu resources){
|
public ResponseEntity create(@Validated @RequestBody Menu resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ public class MenuController {
|
|||||||
@PutMapping(value = "/menus")
|
@PutMapping(value = "/menus")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_EDIT')")
|
||||||
public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){
|
public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
menuService.update(resources);
|
menuService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ public class MenuController {
|
|||||||
@DeleteMapping(value = "/menus/{id}")
|
@DeleteMapping(value = "/menus/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
//if(id>0) throw new BadRequestException("演示环境禁止操作");
|
if(id>0) throw new BadRequestException("演示环境禁止操作");
|
||||||
List<Menu> menuList = menuService.findByPid(id);
|
List<Menu> menuList = menuService.findByPid(id);
|
||||||
Set<Menu> menuSet = new HashSet<>();
|
Set<Menu> menuSet = new HashSet<>();
|
||||||
menuSet.add(menuService.findOne(id));
|
menuSet.add(menuService.findOne(id));
|
||||||
|
@ -67,7 +67,7 @@ public class PermissionController {
|
|||||||
@PutMapping(value = "/permissions")
|
@PutMapping(value = "/permissions")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_EDIT')")
|
||||||
public ResponseEntity update(@Validated(Permission.Update.class) @RequestBody Permission resources){
|
public ResponseEntity update(@Validated(Permission.Update.class) @RequestBody Permission resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
permissionService.update(resources);
|
permissionService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ public class PermissionController {
|
|||||||
@DeleteMapping(value = "/permissions/{id}")
|
@DeleteMapping(value = "/permissions/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
List<Permission> permissions = permissionService.findByPid(id);
|
List<Permission> permissions = permissionService.findByPid(id);
|
||||||
Set<Permission> permissionSet = new HashSet<>();
|
Set<Permission> permissionSet = new HashSet<>();
|
||||||
permissionSet.add(permissionMapper.toEntity(permissionService.findById(id)));
|
permissionSet.add(permissionMapper.toEntity(permissionService.findById(id)));
|
||||||
|
@ -84,7 +84,7 @@ public class RoleController {
|
|||||||
@PutMapping(value = "/roles")
|
@PutMapping(value = "/roles")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
|
||||||
public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role resources){
|
public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
roleService.update(resources);
|
roleService.update(resources);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ public class RoleController {
|
|||||||
@PutMapping(value = "/roles/permission")
|
@PutMapping(value = "/roles/permission")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
|
||||||
public ResponseEntity updatePermission(@RequestBody Role resources){
|
public ResponseEntity updatePermission(@RequestBody Role resources){
|
||||||
//if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(resources)) throw new BadRequestException("演示环境禁止操作");
|
||||||
roleService.updatePermission(resources,roleService.findById(resources.getId()));
|
roleService.updatePermission(resources,roleService.findById(resources.getId()));
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ public class RoleController {
|
|||||||
@DeleteMapping(value = "/roles/{id}")
|
@DeleteMapping(value = "/roles/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
// if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
try {
|
try {
|
||||||
roleService.delete(id);
|
roleService.delete(id);
|
||||||
}catch (Throwable e){
|
}catch (Throwable e){
|
||||||
|
@ -125,7 +125,7 @@ public class UserController {
|
|||||||
@DeleteMapping(value = "/users/{id}")
|
@DeleteMapping(value = "/users/{id}")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_DELETE')")
|
@PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_DELETE')")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
Integer currentLevel = Collections.min(roleService.findByUsers_Id(SecurityUtils.getUserId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()));
|
Integer currentLevel = Collections.min(roleService.findByUsers_Id(SecurityUtils.getUserId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()));
|
||||||
Integer optLevel = Collections.min(roleService.findByUsers_Id(id).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()));
|
Integer optLevel = Collections.min(roleService.findByUsers_Id(id).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()));
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ public class UserController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping(value = "/users/updatePass")
|
@PostMapping(value = "/users/updatePass")
|
||||||
public ResponseEntity updatePass(@RequestBody UserPassVo user){
|
public ResponseEntity updatePass(@RequestBody UserPassVo user){
|
||||||
//if(ObjectUtil.isNotNull(user)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(user)) throw new BadRequestException("演示环境禁止操作");
|
||||||
UserDetails userDetails = SecurityUtils.getUserDetails();
|
UserDetails userDetails = SecurityUtils.getUserDetails();
|
||||||
if(!userDetails.getPassword().equals(EncryptUtils.encryptPassword(user.getOldPass()))){
|
if(!userDetails.getPassword().equals(EncryptUtils.encryptPassword(user.getOldPass()))){
|
||||||
throw new BadRequestException("修改失败,旧密码错误");
|
throw new BadRequestException("修改失败,旧密码错误");
|
||||||
@ -162,7 +162,7 @@ public class UserController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping(value = "/users/updateAvatar")
|
@PostMapping(value = "/users/updateAvatar")
|
||||||
public ResponseEntity updateAvatar(@RequestParam MultipartFile file){
|
public ResponseEntity updateAvatar(@RequestParam MultipartFile file){
|
||||||
//if(ObjectUtil.isNotNull(file)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(file)) throw new BadRequestException("演示环境禁止操作");
|
||||||
userService.updateAvatar(file);
|
userService.updateAvatar(file);
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class YxSystemConfigController {
|
|||||||
@PostMapping(value = "/yxSystemConfig")
|
@PostMapping(value = "/yxSystemConfig")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')")
|
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')")
|
||||||
public ResponseEntity create(@RequestBody String jsonStr){
|
public ResponseEntity create(@RequestBody String jsonStr){
|
||||||
//if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
if(StrUtil.isNotEmpty(jsonStr)) throw new BadRequestException("演示环境禁止操作");
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
jsonObject.forEach(
|
jsonObject.forEach(
|
||||||
(key,value)->{
|
(key,value)->{
|
||||||
@ -52,7 +52,7 @@ public class YxSystemConfigController {
|
|||||||
YxSystemConfig yxSystemConfigModel = new YxSystemConfig();
|
YxSystemConfig yxSystemConfigModel = new YxSystemConfig();
|
||||||
yxSystemConfigModel.setMenuName(key);
|
yxSystemConfigModel.setMenuName(key);
|
||||||
yxSystemConfigModel.setValue(value.toString());
|
yxSystemConfigModel.setValue(value.toString());
|
||||||
RedisUtil.set(key,value.toString());
|
RedisUtil.set(key,value.toString(),0);
|
||||||
if(ObjectUtil.isNull(yxSystemConfig)){
|
if(ObjectUtil.isNull(yxSystemConfig)){
|
||||||
yxSystemConfigService.create(yxSystemConfigModel);
|
yxSystemConfigService.create(yxSystemConfigModel);
|
||||||
}else{
|
}else{
|
||||||
|
@ -40,7 +40,7 @@ public class QiniuController {
|
|||||||
@Log("配置七牛云存储")
|
@Log("配置七牛云存储")
|
||||||
@PutMapping(value = "/qiNiuConfig")
|
@PutMapping(value = "/qiNiuConfig")
|
||||||
public ResponseEntity emailConfig(@Validated @RequestBody QiniuConfig qiniuConfig){
|
public ResponseEntity emailConfig(@Validated @RequestBody QiniuConfig qiniuConfig){
|
||||||
//if(ObjectUtil.isNotNull(qiniuConfig)) throw new BadRequestException("演示环境禁止操作");
|
if(ObjectUtil.isNotNull(qiniuConfig)) throw new BadRequestException("演示环境禁止操作");
|
||||||
qiNiuService.update(qiniuConfig);
|
qiNiuService.update(qiniuConfig);
|
||||||
qiNiuService.update(qiniuConfig.getType());
|
qiNiuService.update(qiniuConfig.getType());
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
@ -60,6 +60,7 @@ public class QiniuController {
|
|||||||
@Log("上传文件")
|
@Log("上传文件")
|
||||||
@PostMapping(value = "/qiNiuContent")
|
@PostMapping(value = "/qiNiuContent")
|
||||||
public ResponseEntity upload(@RequestParam MultipartFile file){
|
public ResponseEntity upload(@RequestParam MultipartFile file){
|
||||||
|
if(ObjectUtil.isNotNull(file)) throw new BadRequestException("演示环境禁止操作");
|
||||||
QiniuContent qiniuContent = qiNiuService.upload(file,qiNiuService.find());
|
QiniuContent qiniuContent = qiNiuService.upload(file,qiNiuService.find());
|
||||||
Map map = new HashMap(3);
|
Map map = new HashMap(3);
|
||||||
map.put("id",qiniuContent.getId());
|
map.put("id",qiniuContent.getId());
|
||||||
@ -89,7 +90,7 @@ public class QiniuController {
|
|||||||
@Log("下载文件")
|
@Log("下载文件")
|
||||||
@GetMapping(value = "/qiNiuContent/download/{id}")
|
@GetMapping(value = "/qiNiuContent/download/{id}")
|
||||||
public ResponseEntity download(@PathVariable Long id){
|
public ResponseEntity download(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
Map map = new HashMap(1);
|
Map map = new HashMap(1);
|
||||||
map.put("url", qiNiuService.download(qiNiuService.findByContentId(id),qiNiuService.find()));
|
map.put("url", qiNiuService.download(qiNiuService.findByContentId(id),qiNiuService.find()));
|
||||||
return new ResponseEntity(map,HttpStatus.OK);
|
return new ResponseEntity(map,HttpStatus.OK);
|
||||||
@ -104,7 +105,7 @@ public class QiniuController {
|
|||||||
@Log("删除文件")
|
@Log("删除文件")
|
||||||
@DeleteMapping(value = "/qiNiuContent/{id}")
|
@DeleteMapping(value = "/qiNiuContent/{id}")
|
||||||
public ResponseEntity delete(@PathVariable Long id){
|
public ResponseEntity delete(@PathVariable Long id){
|
||||||
//if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
if(id > 0) throw new BadRequestException("演示环境禁止操作");
|
||||||
qiNiuService.delete(qiNiuService.findByContentId(id),qiNiuService.find());
|
qiNiuService.delete(qiNiuService.findByContentId(id),qiNiuService.find());
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@ -117,7 +118,7 @@ public class QiniuController {
|
|||||||
@Log("删除图片")
|
@Log("删除图片")
|
||||||
@DeleteMapping(value = "/qiNiuContent")
|
@DeleteMapping(value = "/qiNiuContent")
|
||||||
public ResponseEntity deleteAll(@RequestBody Long[] ids) {
|
public ResponseEntity deleteAll(@RequestBody Long[] ids) {
|
||||||
//if(ArrayUtil.isNotEmpty(ids)) throw new BadRequestException("演示环境禁止操作");
|
if(ArrayUtil.isNotEmpty(ids)) throw new BadRequestException("演示环境禁止操作");
|
||||||
qiNiuService.deleteAll(ids, qiNiuService.find());
|
qiNiuService.deleteAll(ids, qiNiuService.find());
|
||||||
return new ResponseEntity(HttpStatus.OK);
|
return new ResponseEntity(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user