Java Code Examples for com.macro.mall.common.api.CommonResult#failed()

The following examples show how to use com.macro.mall.common.api.CommonResult#failed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UmsMemberServiceImpl.java    From macrozheng with Apache License 2.0 6 votes vote down vote up
@Override
public CommonResult updatePassword(String telephone, String password, String authCode) {
    UmsMemberExample example = new UmsMemberExample();
    example.createCriteria().andPhoneEqualTo(telephone);
    List<UmsMember> memberList = memberMapper.selectByExample(example);
    if(CollectionUtils.isEmpty(memberList)){
        return CommonResult.failed("该账号不存在");
    }
    //验证验证码
    if(!verifyAuthCode(authCode,telephone)){
        return CommonResult.failed("验证码错误");
    }
    UmsMember umsMember = memberList.get(0);
    umsMember.setPassword(passwordEncoder.encode(password));
    memberMapper.updateByPrimaryKeySelective(umsMember);
    return CommonResult.success(null,"密码修改成功");
}
 
Example 2
Source File: SmsFlashPromotionProductRelationController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量选择商品添加关联")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsFlashPromotionProductRelation> relationList) {
    int count = relationService.create(relationList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 3
Source File: UmsRoleController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改角色权限")
@RequestMapping(value = "/permission/update", method = RequestMethod.POST)
@ResponseBody
public CommonResult updatePermission(@RequestParam Long roleId,
                                     @RequestParam("permissionIds") List<Long> permissionIds) {
    int count = roleService.updatePermission(roleId, permissionIds);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 4
Source File: PmsBrandController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value = "更新品牌")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable("id") Long id,
                           @Validated @RequestBody PmsBrandParam pmsBrandParam,
                           BindingResult result) {
    CommonResult commonResult;
    int count = brandService.updateBrand(id, pmsBrandParam);
    if (count == 1) {
        commonResult = CommonResult.success(count);
    } else {
        commonResult = CommonResult.failed();
    }
    return commonResult;
}
 
Example 5
Source File: MemberAttentionController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("取消关注")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(Long brandId) {
    int count = memberAttentionService.delete(brandId);
    if(count>0){
        return CommonResult.success(count);
    }else{
        return CommonResult.failed();
    }
}
 
Example 6
Source File: UmsMemberReceiveAddressController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("删除收货地址")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
    int count = memberReceiveAddressService.delete(id);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 7
Source File: SmsHomeRecommendProductController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
    int count = recommendProductService.delete(ids);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 8
Source File: OmsOrderReturnReasonController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改退货原因")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody OmsOrderReturnReason returnReason) {
    int count = orderReturnReasonService.update(id, returnReason);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 9
Source File: OmsCartItemController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改购物车中商品的规格")
@RequestMapping(value = "/update/attr", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateAttr(@RequestBody OmsCartItem cartItem) {
    int count = cartItemService.updateAttr(cartItem);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 10
Source File: SmsHomeNewProductController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量删除推荐")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
    int count = homeNewProductService.delete(ids);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 11
Source File: SmsHomeRecommendProductController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量修改推荐状态")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
    int count = recommendProductService.updateRecommendStatus(ids, recommendStatus);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 12
Source File: SmsFlashPromotionProductRelationController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("删除关联")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
    int count = relationService.delete(id);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 13
Source File: UmsAdminController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("删除指定用户信息")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
    int count = adminService.delete(id);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 14
Source File: UmsMenuController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改菜单显示状态")
@RequestMapping(value = "/updateHidden/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateHidden(@PathVariable Long id, @RequestParam("hidden") Integer hidden) {
    int count = menuService.updateHidden(id, hidden);
    if (count > 0) {
        return CommonResult.success(count);
    } else {
        return CommonResult.failed();
    }
}
 
Example 15
Source File: SmsFlashPromotionProductRelationController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改关联相关信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody SmsFlashPromotionProductRelation relation) {
    int count = relationService.update(id, relation);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 16
Source File: SmsCouponController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("删除优惠券")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
    int count = couponService.delete(id);
    if(count>0){
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 17
Source File: OmsOrderController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改订单费用信息")
@RequestMapping(value = "/update/moneyInfo", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateReceiverInfo(@RequestBody OmsMoneyInfoParam moneyInfoParam) {
    int count = orderService.updateMoneyInfo(moneyInfoParam);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example 18
Source File: PmsBrandController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation(value = "删除品牌")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
@ResponseBody
@PreAuthorize("hasAuthority('pms:brand:delete')")
public CommonResult delete(@PathVariable("id") Long id) {
    int count = brandService.deleteBrand(id);
    if (count == 1) {
        return CommonResult.success(null);
    } else {
        return CommonResult.failed();
    }
}
 
Example 19
Source File: PmsProductController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量推荐商品")
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids,
                                          @RequestParam("recommendStatus") Integer recommendStatus) {
    int count = productService.updateRecommendStatus(ids, recommendStatus);
    if (count > 0) {
        return CommonResult.success(count);
    } else {
        return CommonResult.failed();
    }
}
 
Example 20
Source File: PmsProductAttributeController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量删除商品属性")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
    int count = productAttributeService.delete(ids);
    if (count > 0) {
        return CommonResult.success(count);
    } else {
        return CommonResult.failed();
    }
}