use of co.yixiang.modules.logging.aop.log.Log in project yshopmall by guchengwuyue.
the class SystemGroupDataController method create.
@NoRepeatSubmit
@Log("新增数据配置")
@ApiOperation(value = "新增数据配置")
@PostMapping(value = "/yxSystemGroupData")
@CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY, allEntries = true)
@PreAuthorize("hasAnyRole('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE')")
public ResponseEntity create(@RequestBody String jsonStr) {
JSONObject jsonObject = JSON.parseObject(jsonStr);
if (ObjectUtil.isNotNull(jsonObject.get("name"))) {
if (StrUtil.isEmpty(jsonObject.get("name").toString())) {
throw new BadRequestException("名称必须填写");
}
}
if (ObjectUtil.isNotNull(jsonObject.get("title"))) {
if (StrUtil.isEmpty(jsonObject.get("title").toString())) {
throw new BadRequestException("标题必须填写");
}
}
if (ObjectUtil.isNotNull(jsonObject.get("info"))) {
if (StrUtil.isEmpty(jsonObject.get("info").toString())) {
throw new BadRequestException("简介必须填写");
}
}
if (ObjectUtil.isNotNull(jsonObject.get("pic"))) {
if (StrUtil.isEmpty(jsonObject.get("pic").toString())) {
throw new BadRequestException("图片必须上传");
}
}
YxSystemGroupData yxSystemGroupData = new YxSystemGroupData();
yxSystemGroupData.setGroupName(jsonObject.get("groupName").toString());
jsonObject.remove("groupName");
yxSystemGroupData.setValue(jsonObject.toJSONString());
yxSystemGroupData.setStatus(jsonObject.getInteger("status"));
yxSystemGroupData.setSort(jsonObject.getInteger("sort"));
return new ResponseEntity(yxSystemGroupDataService.save(yxSystemGroupData), HttpStatus.CREATED);
}
use of co.yixiang.modules.logging.aop.log.Log in project yshopmall by guchengwuyue.
the class SystemGroupDataController method getYxSystemGroupDatas.
@Log("查询数据配置")
@ApiOperation(value = "查询数据配置")
@GetMapping(value = "/yxSystemGroupData")
@PreAuthorize("hasAnyRole('admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_SELECT')")
public ResponseEntity getYxSystemGroupDatas(YxSystemGroupDataQueryCriteria criteria, Pageable pageable) {
Sort sort = Sort.by(Sort.Direction.DESC, "sort");
Pageable pageableT = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort);
return new ResponseEntity(yxSystemGroupDataService.queryAll(criteria, pageableT), HttpStatus.OK);
}
use of co.yixiang.modules.logging.aop.log.Log in project yshopmall by guchengwuyue.
the class SystemStoreStaffController method create.
@NoRepeatSubmit
@PostMapping
@Log("新增门店店员")
@ApiOperation("新增门店店员")
@PreAuthorize("@el.check('yxSystemStoreStaff:add')")
public ResponseEntity<Object> create(@Validated @RequestBody YxSystemStoreStaff resources) {
YxSystemStore systemStore = yxSystemStoreService.getOne(Wrappers.<YxSystemStore>lambdaQuery().eq(YxSystemStore::getId, resources.getStoreId()));
resources.setStoreName(systemStore.getName());
return new ResponseEntity<>(yxSystemStoreStaffService.save(resources), HttpStatus.CREATED);
}
use of co.yixiang.modules.logging.aop.log.Log in project yshopmall by guchengwuyue.
the class AliPayController method toPayAsPc.
@Log("支付宝PC网页支付")
@ApiOperation("PC网页支付")
@PostMapping(value = "/toPayAsPC")
public ResponseEntity<String> toPayAsPc(@Validated @RequestBody TradeVo trade) throws Exception {
AlipayConfig aliPay = alipayService.find();
trade.setOutTradeNo(alipayUtils.getOrderCode());
String payUrl = alipayService.toPayAsPc(aliPay, trade);
return ResponseEntity.ok(payUrl);
}
use of co.yixiang.modules.logging.aop.log.Log in project yshopmall by guchengwuyue.
the class AliPayController method toPayAsWeb.
@Log("支付宝手机网页支付")
@ApiOperation("手机网页支付")
@PostMapping(value = "/toPayAsWeb")
public ResponseEntity<String> toPayAsWeb(@Validated @RequestBody TradeVo trade) throws Exception {
AlipayConfig alipay = alipayService.find();
trade.setOutTradeNo(alipayUtils.getOrderCode());
String payUrl = alipayService.toPayAsWeb(alipay, trade);
return ResponseEntity.ok(payUrl);
}
Aggregations