yshop1.7发布,后台升級eladmin2.4(前端,后台权限,代码生成器等重构),修复商品分类等一些问题
This commit is contained in:
@ -32,7 +32,7 @@ public class YxArticleController {
|
||||
|
||||
@ApiOperation(value = "查询YxArticle")
|
||||
@GetMapping(value = "/yxArticle")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_SELECT')")
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_SELECT')")
|
||||
public ResponseEntity getYxArticles(YxArticleQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(yxArticleService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class YxArticleController {
|
||||
|
||||
@ApiOperation(value = "新增YxArticle")
|
||||
@PostMapping(value = "/yxArticle")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_CREATE')")
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody YxArticle resources){
|
||||
resources.setAddTime(DateUtil.now());
|
||||
return new ResponseEntity(yxArticleService.create(resources),HttpStatus.CREATED);
|
||||
@ -49,7 +49,7 @@ public class YxArticleController {
|
||||
|
||||
@ApiOperation(value = "修改YxArticle")
|
||||
@PutMapping(value = "/yxArticle")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_EDIT')")
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody YxArticle resources){
|
||||
yxArticleService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
@ -58,7 +58,7 @@ public class YxArticleController {
|
||||
|
||||
@ApiOperation(value = "删除YxArticle")
|
||||
@DeleteMapping(value = "/yxArticle/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Integer id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxArticleService.delete(id);
|
||||
@ -67,7 +67,7 @@ public class YxArticleController {
|
||||
|
||||
@ApiOperation(value = "发布文章")
|
||||
@GetMapping(value = "/yxArticle/publish/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||
@PreAuthorize("@el.check('admin','YXARTICLE_ALL','YXARTICLE_DELETE')")
|
||||
public ResponseEntity publish(@PathVariable Integer id) throws Exception{
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
YxArticleDTO yxArticleDTO= yxArticleService.findById(id);
|
||||
|
@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @author hupeng
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Api(tags = "YxCache管理")
|
||||
@Api(tags = "微信菜單")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class YxCacheController {
|
||||
@ -37,7 +37,7 @@ public class YxCacheController {
|
||||
|
||||
@ApiOperation(value = "查询菜单")
|
||||
@GetMapping(value = "/yxCache")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXCACHE_ALL','YXCACHE_SELECT')")
|
||||
@PreAuthorize("@el.check('admin','YXCACHE_ALL','YXCACHE_SELECT')")
|
||||
public ResponseEntity getYxCaches(){
|
||||
return new ResponseEntity(yxCacheService.findById("wechat_menus"),HttpStatus.OK);
|
||||
}
|
||||
@ -45,7 +45,7 @@ public class YxCacheController {
|
||||
|
||||
@ApiOperation(value = "创建菜单")
|
||||
@PostMapping(value = "/yxCache")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXCACHE_ALL','YXCACHE_CREATE')")
|
||||
@PreAuthorize("@el.check('admin','YXCACHE_ALL','YXCACHE_CREATE')")
|
||||
public ResponseEntity create( @RequestBody String jsonStr){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
@ -64,7 +64,6 @@ public class YxCacheController {
|
||||
yxCacheService.create(yxCache);
|
||||
}
|
||||
|
||||
System.out.println("menu:"+menu);
|
||||
|
||||
//创建菜单
|
||||
try {
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @author hupeng
|
||||
* @date 2019-10-10
|
||||
*/
|
||||
@Api(tags = "YxWechatReply管理")
|
||||
@Api(tags = "微信回復管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class YxWechatReplyController {
|
||||
@ -30,7 +30,7 @@ public class YxWechatReplyController {
|
||||
|
||||
@ApiOperation(value = "查询")
|
||||
@GetMapping(value = "/yxWechatReply")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_SELECT')")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATREPLY_ALL','YXWECHATREPLY_SELECT')")
|
||||
public ResponseEntity getYxWechatReplys(){
|
||||
return new ResponseEntity(yxWechatReplyService.isExist("subscribe"),HttpStatus.OK);
|
||||
}
|
||||
@ -38,7 +38,7 @@ public class YxWechatReplyController {
|
||||
|
||||
@ApiOperation(value = "新增自动回复")
|
||||
@PostMapping(value = "/yxWechatReply")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATREPLY_ALL','YXWECHATREPLY_CREATE')")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATREPLY_ALL','YXWECHATREPLY_CREATE')")
|
||||
public ResponseEntity create(@RequestBody String jsonStr){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
|
@ -1,62 +1,62 @@
|
||||
package co.yixiang.mp.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.mp.service.YxWechatTemplateService;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
*/
|
||||
@Api(tags = "YxWechatTemplate管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class YxWechatTemplateController {
|
||||
|
||||
@Autowired
|
||||
private YxWechatTemplateService yxWechatTemplateService;
|
||||
|
||||
@ApiOperation(value = "查询YxWechatTemplate")
|
||||
@GetMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_SELECT')")
|
||||
public ResponseEntity getYxWechatTemplates(YxWechatTemplateQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(yxWechatTemplateService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增YxWechatTemplate")
|
||||
@PostMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody YxWechatTemplate resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
return new ResponseEntity(yxWechatTemplateService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改YxWechatTemplate")
|
||||
@PutMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody YxWechatTemplate resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxWechatTemplateService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除YxWechatTemplate")
|
||||
@DeleteMapping(value = "/yxWechatTemplate/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Integer id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxWechatTemplateService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
package co.yixiang.mp.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.mp.service.YxWechatTemplateService;
|
||||
import co.yixiang.mp.service.dto.YxWechatTemplateQueryCriteria;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author xuwenbo
|
||||
* @date 2019-12-10
|
||||
*/
|
||||
@Api(tags = "微信模板管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class YxWechatTemplateController {
|
||||
|
||||
@Autowired
|
||||
private YxWechatTemplateService yxWechatTemplateService;
|
||||
|
||||
@ApiOperation(value = "查询")
|
||||
@GetMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_SELECT')")
|
||||
public ResponseEntity getYxWechatTemplates(YxWechatTemplateQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(yxWechatTemplateService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增")
|
||||
@PostMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody YxWechatTemplate resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
return new ResponseEntity(yxWechatTemplateService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改")
|
||||
@PutMapping(value = "/yxWechatTemplate")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody YxWechatTemplate resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxWechatTemplateService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除")
|
||||
@DeleteMapping(value = "/yxWechatTemplate/{id}")
|
||||
@PreAuthorize("@el.check('admin','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Integer id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxWechatTemplateService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user