dy-hu
7 months ago
12 changed files with 408 additions and 9 deletions
-
2cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml
-
125cereshop-business/src/main/java/com/shop/cereshop/business/controller/MemberLevelController.java
-
18cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java
-
69cereshop-business/src/main/java/com/shop/cereshop/business/page/member/MemberLevel.java
-
3cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MemberLevelSaveParam.java
-
6cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MemberLevelUpdateParam.java
-
20cereshop-business/src/main/java/com/shop/cereshop/business/service/member/CerePlatformMemberLevelService.java
-
118cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMemberLevelServiceImpl.java
-
4cereshop-business/src/main/java/com/shop/cereshop/business/service/scene/impl/CereShopSceneServiceImpl.java
-
43cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml
-
5cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/member/CerePlatformMemberLevel.java
-
4doc/3.0/update.sql
@ -0,0 +1,125 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.controller; |
|||
|
|||
|
|||
import com.shop.cereshop.business.annotation.NoRepeatSubmit; |
|||
import com.shop.cereshop.business.annotation.NoRepeatWebLog; |
|||
import com.shop.cereshop.business.page.member.MemberLevel; |
|||
import com.shop.cereshop.business.param.member.MemberLevelSaveParam; |
|||
import com.shop.cereshop.business.param.member.MemberLevelUpdateParam; |
|||
import com.shop.cereshop.business.param.member.MemberLevelgetByIdParam; |
|||
import com.shop.cereshop.business.service.member.CerePlatformMemberLevelService; |
|||
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; |
|||
import com.shop.cereshop.commons.domain.common.Page; |
|||
import com.shop.cereshop.commons.domain.common.PageParam; |
|||
import com.shop.cereshop.commons.domain.member.CerePlatformMembership; |
|||
import com.shop.cereshop.commons.domain.user.CerePlatformUser; |
|||
import com.shop.cereshop.commons.exception.CoBusinessException; |
|||
import com.shop.cereshop.commons.result.Result; |
|||
import com.shop.cereshop.commons.utils.GsonUtil; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
|
|||
/** |
|||
* 会员等级 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("memberlevel") |
|||
/** |
|||
* 注解方式生成日志对象,指定topic生成对象类名 |
|||
*/ |
|||
@Slf4j(topic = "MemberLevelController") |
|||
@Api(value = "会员模块", tags = "会员模块") |
|||
public class MemberLevelController { |
|||
|
|||
@Autowired |
|||
private CerePlatformMemberLevelService cerePlatformMemberLevelService; |
|||
|
|||
/** |
|||
* 添加会员等级 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "save") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "添加会员等级") |
|||
@NoRepeatWebLog |
|||
public Result save(@RequestBody @Validated MemberLevelSaveParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(user.getBusinessId()); |
|||
cerePlatformMemberLevelService.save(param,user); |
|||
return new Result(user.getUsername(),"添加会员等级", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 编辑会员等级 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "update") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "编辑会员等级") |
|||
@NoRepeatWebLog |
|||
public Result update(@RequestBody MemberLevelUpdateParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(user.getBusinessId()); |
|||
cerePlatformMemberLevelService.update(param,user); |
|||
return new Result(user.getUsername(),"编辑会员等级", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 删除会员等级 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "delete") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "删除会员等级") |
|||
@NoRepeatWebLog |
|||
public Result delete(@RequestBody MemberLevelgetByIdParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
cerePlatformMemberLevelService.delete(param,user); |
|||
return new Result(user.getUsername(),"删除会员等级", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 会员等级详情查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "getById") |
|||
@ApiOperation(value = "会员等级详情查询") |
|||
public Result<CerePlatformMembership> getById(@RequestBody MemberLevelgetByIdParam param) throws CoBusinessException { |
|||
MemberLevel memberLevel=cerePlatformMemberLevelService.getById(param); |
|||
return new Result(memberLevel); |
|||
} |
|||
|
|||
/** |
|||
* 会员等级列表查询 |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "getAll") |
|||
@ApiOperation(value = "会员等级列表查询") |
|||
public Result<Page<MemberLevel>> getAll(@RequestBody PageParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
Page page=cerePlatformMemberLevelService.getAll(user.getBusinessId(), param); |
|||
return new Result(page); |
|||
} |
|||
} |
@ -0,0 +1,69 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.page.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 会员等级返回数据 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MemberLevel", description = "会员等级返回数据") |
|||
public class MemberLevel { |
|||
|
|||
/** |
|||
* 会员等级id |
|||
*/ |
|||
@ApiModelProperty(value = "会员等级id") |
|||
private Long memberLevelId; |
|||
|
|||
/** |
|||
* 等级名称 |
|||
*/ |
|||
@ApiModelProperty(value = "等级名称") |
|||
private String memberLevelName; |
|||
|
|||
/** |
|||
* 图标 |
|||
*/ |
|||
@ApiModelProperty(value = "图标") |
|||
private String memberLevelIcon; |
|||
|
|||
/** |
|||
* 背景图 |
|||
*/ |
|||
@ApiModelProperty(value = "背景图") |
|||
private String memberLevelBackground; |
|||
|
|||
/** |
|||
* 成长值 |
|||
*/ |
|||
@ApiModelProperty(value = "成长值") |
|||
private Integer growth; |
|||
|
|||
/** |
|||
* 会员权益id数组 |
|||
*/ |
|||
@ApiModelProperty(value = "会员权益id数组") |
|||
private List<String> ids; |
|||
|
|||
/** |
|||
* 等级说明 |
|||
*/ |
|||
@ApiModelProperty(value = "等级说明") |
|||
private String memberLevelReason; |
|||
|
|||
/** |
|||
* 等级权益字符串 |
|||
*/ |
|||
@ApiModelProperty(value = "等级权益字符串") |
|||
private String memberIds; |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue