com.macro.mall.model.UmsMemberLevel Java Examples

The following examples show how to use com.macro.mall.model.UmsMemberLevel. 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: UmsMemberLevelController.java    From mall with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation("查询所有会员等级")
@ResponseBody
public CommonResult<List<UmsMemberLevel>> list(@RequestParam("defaultStatus") Integer defaultStatus) {
    List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
    return CommonResult.success(memberLevelList);
}
 
Example #2
Source File: UmsMemberLevelController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@RequestMapping(value = "/list",method = RequestMethod.GET)
@ApiOperation("查询所有会员等级")
@ResponseBody
public Object list(@RequestParam("defaultStatus") Integer defaultStatus){
    List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
    return new CommonResult().success(memberLevelList);
}
 
Example #3
Source File: UmsMemberServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public CommonResult register(String username, String password, String telephone, String authCode) {
    //验证验证码
    if(!verifyAuthCode(authCode,telephone)){
        return new CommonResult().failed("验证码错误");
    }
    //查询是否已有该用户
    UmsMemberExample example = new UmsMemberExample();
    example.createCriteria().andUsernameEqualTo(username);
    example.or(example.createCriteria().andPhoneEqualTo(telephone));
    List<UmsMember> umsMembers = memberMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(umsMembers)) {
        return new CommonResult().failed("该用户已经存在");
    }
    //没有该用户进行添加操作
    UmsMember umsMember = new UmsMember();
    umsMember.setUsername(username);
    umsMember.setPhone(telephone);
    umsMember.setPassword(passwordEncoder.encodePassword(password, null));
    umsMember.setCreateTime(new Date());
    umsMember.setStatus(1);
    //获取默认会员等级并设置
    UmsMemberLevelExample levelExample = new UmsMemberLevelExample();
    levelExample.createCriteria().andDefaultStatusEqualTo(1);
    List<UmsMemberLevel> memberLevelList = memberLevelMapper.selectByExample(levelExample);
    if (!CollectionUtils.isEmpty(memberLevelList)) {
        umsMember.setMemberLevelId(memberLevelList.get(0).getId());
    }
    memberMapper.insert(umsMember);
    umsMember.setPassword(null);
    return new CommonResult().success("注册成功",null);
}
 
Example #4
Source File: UmsMemberServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public CommonResult register(String username, String password, String telephone, String authCode) {
    //验证验证码
    if(!verifyAuthCode(authCode,telephone)){
        return CommonResult.failed("验证码错误");
    }
    //查询是否已有该用户
    UmsMemberExample example = new UmsMemberExample();
    example.createCriteria().andUsernameEqualTo(username);
    example.or(example.createCriteria().andPhoneEqualTo(telephone));
    List<UmsMember> umsMembers = memberMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(umsMembers)) {
        return CommonResult.failed("该用户已经存在");
    }
    //没有该用户进行添加操作
    UmsMember umsMember = new UmsMember();
    umsMember.setUsername(username);
    umsMember.setPhone(telephone);
    umsMember.setPassword(passwordEncoder.encode(password));
    umsMember.setCreateTime(new Date());
    umsMember.setStatus(1);
    //获取默认会员等级并设置
    UmsMemberLevelExample levelExample = new UmsMemberLevelExample();
    levelExample.createCriteria().andDefaultStatusEqualTo(1);
    List<UmsMemberLevel> memberLevelList = memberLevelMapper.selectByExample(levelExample);
    if (!CollectionUtils.isEmpty(memberLevelList)) {
        umsMember.setMemberLevelId(memberLevelList.get(0).getId());
    }
    memberMapper.insert(umsMember);
    umsMember.setPassword(null);
    return CommonResult.success(null,"注册成功");
}
 
Example #5
Source File: UmsMemberLevelController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation("查询所有会员等级")
@ResponseBody
public CommonResult<List<UmsMemberLevel>> list(@RequestParam("defaultStatus") Integer defaultStatus) {
    List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
    return CommonResult.success(memberLevelList);
}
 
Example #6
Source File: UmsMemberServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public void register(String username, String password, String telephone, String authCode) {
    //验证验证码
    if(!verifyAuthCode(authCode,telephone)){
        Asserts.fail("验证码错误");
    }
    //查询是否已有该用户
    UmsMemberExample example = new UmsMemberExample();
    example.createCriteria().andUsernameEqualTo(username);
    example.or(example.createCriteria().andPhoneEqualTo(telephone));
    List<UmsMember> umsMembers = memberMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(umsMembers)) {
        Asserts.fail("该用户已经存在");
    }
    //没有该用户进行添加操作
    UmsMember umsMember = new UmsMember();
    umsMember.setUsername(username);
    umsMember.setPhone(telephone);
    umsMember.setPassword(passwordEncoder.encode(password));
    umsMember.setCreateTime(new Date());
    umsMember.setStatus(1);
    //获取默认会员等级并设置
    UmsMemberLevelExample levelExample = new UmsMemberLevelExample();
    levelExample.createCriteria().andDefaultStatusEqualTo(1);
    List<UmsMemberLevel> memberLevelList = memberLevelMapper.selectByExample(levelExample);
    if (!CollectionUtils.isEmpty(memberLevelList)) {
        umsMember.setMemberLevelId(memberLevelList.get(0).getId());
    }
    memberMapper.insert(umsMember);
    umsMember.setPassword(null);
}
 
Example #7
Source File: UmsMemberLevelController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation("查询所有会员等级")
@ResponseBody
public CommonResult<List<UmsMemberLevel>> list(@RequestParam("defaultStatus") Integer defaultStatus) {
    List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
    return CommonResult.success(memberLevelList);
}
 
Example #8
Source File: UmsMemberServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public void register(String username, String password, String telephone, String authCode) {
    //验证验证码
    if(!verifyAuthCode(authCode,telephone)){
        Asserts.fail("验证码错误");
    }
    //查询是否已有该用户
    UmsMemberExample example = new UmsMemberExample();
    example.createCriteria().andUsernameEqualTo(username);
    example.or(example.createCriteria().andPhoneEqualTo(telephone));
    List<UmsMember> umsMembers = memberMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(umsMembers)) {
        Asserts.fail("该用户已经存在");
    }
    //没有该用户进行添加操作
    UmsMember umsMember = new UmsMember();
    umsMember.setUsername(username);
    umsMember.setPhone(telephone);
    umsMember.setPassword(passwordEncoder.encode(password));
    umsMember.setCreateTime(new Date());
    umsMember.setStatus(1);
    //获取默认会员等级并设置
    UmsMemberLevelExample levelExample = new UmsMemberLevelExample();
    levelExample.createCriteria().andDefaultStatusEqualTo(1);
    List<UmsMemberLevel> memberLevelList = memberLevelMapper.selectByExample(levelExample);
    if (!CollectionUtils.isEmpty(memberLevelList)) {
        umsMember.setMemberLevelId(memberLevelList.get(0).getId());
    }
    memberMapper.insert(umsMember);
    umsMember.setPassword(null);
}
 
Example #9
Source File: UmsMemberLevelServiceImpl.java    From macrozheng-mall with MIT License 4 votes vote down vote up
@Override
public List<UmsMemberLevel> list(Integer defaultStatus) {
    UmsMemberLevelExample example = new UmsMemberLevelExample();
    example.createCriteria().andDefaultStatusEqualTo(defaultStatus);
    return memberLevelMapper.selectByExample(example);
}
 
Example #10
Source File: UmsMemberLevelServiceImpl.java    From mall with Apache License 2.0 4 votes vote down vote up
@Override
public List<UmsMemberLevel> list(Integer defaultStatus) {
    UmsMemberLevelExample example = new UmsMemberLevelExample();
    example.createCriteria().andDefaultStatusEqualTo(defaultStatus);
    return memberLevelMapper.selectByExample(example);
}
 
Example #11
Source File: UmsMemberLevelServiceImpl.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
@Override
public List<UmsMemberLevel> list(Integer defaultStatus) {
    UmsMemberLevelExample example = new UmsMemberLevelExample();
    example.createCriteria().andDefaultStatusEqualTo(defaultStatus);
    return memberLevelMapper.selectByExample(example);
}
 
Example #12
Source File: UmsMemberLevelServiceImpl.java    From mall-swarm with Apache License 2.0 4 votes vote down vote up
@Override
public List<UmsMemberLevel> list(Integer defaultStatus) {
    UmsMemberLevelExample example = new UmsMemberLevelExample();
    example.createCriteria().andDefaultStatusEqualTo(defaultStatus);
    return memberLevelMapper.selectByExample(example);
}
 
Example #13
Source File: UmsMemberLevelService.java    From mall-swarm with Apache License 2.0 2 votes vote down vote up
/**
 * 获取所有会员登录
 * @param defaultStatus 是否为默认会员
 */
List<UmsMemberLevel> list(Integer defaultStatus);
 
Example #14
Source File: UmsMemberLevelService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 获取所有会员登录
 * @param defaultStatus 是否为默认会员
 */
List<UmsMemberLevel> list(Integer defaultStatus);
 
Example #15
Source File: UmsMemberLevelService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 获取所有会员登录
 * @param defaultStatus 是否为默认会员
 */
List<UmsMemberLevel> list(Integer defaultStatus);
 
Example #16
Source File: UmsMemberLevelService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 获取所有会员登录
 * @param defaultStatus 是否为默认会员
 */
List<UmsMemberLevel> list(Integer defaultStatus);
 
Example #17
Source File: UmsMemberLevelMapper.java    From mall with Apache License 2.0 votes vote down vote up
int updateByPrimaryKey(UmsMemberLevel record); 
Example #18
Source File: UmsMemberLevelMapper.java    From mall with Apache License 2.0 votes vote down vote up
int updateByPrimaryKeySelective(UmsMemberLevel record); 
Example #19
Source File: UmsMemberLevelMapper.java    From mall with Apache License 2.0 votes vote down vote up
int insert(UmsMemberLevel record); 
Example #20
Source File: UmsMemberLevelMapper.java    From mall with Apache License 2.0 votes vote down vote up
int updateByExample(@Param("record") UmsMemberLevel record, @Param("example") UmsMemberLevelExample example); 
Example #21
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int insert(UmsMemberLevel record); 
Example #22
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int insertSelective(UmsMemberLevel record); 
Example #23
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
List<UmsMemberLevel> selectByExample(UmsMemberLevelExample example); 
Example #24
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
UmsMemberLevel selectByPrimaryKey(Long id); 
Example #25
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int updateByExampleSelective(@Param("record") UmsMemberLevel record, @Param("example") UmsMemberLevelExample example); 
Example #26
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int updateByExample(@Param("record") UmsMemberLevel record, @Param("example") UmsMemberLevelExample example); 
Example #27
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int updateByPrimaryKeySelective(UmsMemberLevel record); 
Example #28
Source File: UmsMemberLevelMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int updateByPrimaryKey(UmsMemberLevel record); 
Example #29
Source File: UmsMemberLevelMapper.java    From macrozheng with Apache License 2.0 votes vote down vote up
List<UmsMemberLevel> selectByExample(UmsMemberLevelExample example); 
Example #30
Source File: UmsMemberLevelMapper.java    From mall-swarm with Apache License 2.0 votes vote down vote up
int insertSelective(UmsMemberLevel record);