dy-hu
7 months ago
13 changed files with 525 additions and 0 deletions
-
119cereshop-business/src/main/java/com/shop/cereshop/business/controller/MemberShipController.java
-
7cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMembershipDAO.java
-
63cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MemberLevelSaveParam.java
-
69cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MemberLevelUpdateParam.java
-
25cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MemberLevelgetByIdParam.java
-
25cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MembershipGetByIdParam.java
-
47cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MembershipSaveParam.java
-
49cereshop-business/src/main/java/com/shop/cereshop/business/param/member/MembershipUpdateParam.java
-
18cereshop-business/src/main/java/com/shop/cereshop/business/service/member/CerePlatformMembershipService.java
-
79cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMembershipServiceImpl.java
-
14cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMembershipDAO.xml
-
6cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/member/CerePlatformMembership.java
-
4doc/3.0/update.sql
@ -0,0 +1,119 @@ |
|||
/* |
|||
* 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.param.member.MembershipGetByIdParam; |
|||
import com.shop.cereshop.business.param.member.MembershipSaveParam; |
|||
import com.shop.cereshop.business.param.member.MembershipUpdateParam; |
|||
import com.shop.cereshop.business.service.member.CerePlatformMembershipService; |
|||
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.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("membership") |
|||
/** |
|||
* 注解方式生成日志对象,指定topic生成对象类名 |
|||
*/ |
|||
@Slf4j(topic = "MemberShipController") |
|||
@Api(value = "会员模块", tags = "会员模块") |
|||
public class MemberShipController { |
|||
|
|||
@Autowired |
|||
private CerePlatformMembershipService cerePlatformMembershipService; |
|||
|
|||
/** |
|||
* 添加会员权益 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "save") |
|||
@NoRepeatSubmit |
|||
@ApiOperation(value = "添加会员权益") |
|||
@NoRepeatWebLog |
|||
public Result save(@RequestBody @Validated MembershipSaveParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
param.setBusinessId(user.getBusinessId()); |
|||
cerePlatformMembershipService.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 MembershipUpdateParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
cerePlatformMembershipService.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 MembershipGetByIdParam param, HttpServletRequest request) throws CoBusinessException { |
|||
//获取当前登录账户 |
|||
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); |
|||
cerePlatformMembershipService.delete(param,user); |
|||
return new Result(user.getUsername(),"删除会员权益", GsonUtil.objectToGson(param)); |
|||
} |
|||
|
|||
/** |
|||
* 会员权益详情查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "getById") |
|||
@ApiOperation(value = "会员权益详情查询") |
|||
public Result<CerePlatformMembership> getById(@RequestBody MembershipGetByIdParam param) throws CoBusinessException { |
|||
CerePlatformMembership membership=cerePlatformMembershipService.getById(param); |
|||
return new Result(membership); |
|||
} |
|||
|
|||
/** |
|||
* 会员权益列表查询 |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "getAll") |
|||
@ApiOperation(value = "会员权益列表查询") |
|||
public Result<Page<CerePlatformMembership>> getAll(@RequestBody PageParam param) throws CoBusinessException { |
|||
Page page=cerePlatformMembershipService.getAll(param); |
|||
return new Result(page); |
|||
} |
|||
} |
@ -0,0 +1,63 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.param.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 添加会员等级请求 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MemberLevelSaveParam", description = "添加会员等级请求") |
|||
public class MemberLevelSaveParam { |
|||
|
|||
/** |
|||
* 等级名称 |
|||
*/ |
|||
@ApiModelProperty(value = "等级名称") |
|||
@NotBlank(message = "等级名称不能为空") |
|||
private String memberLevelName; |
|||
|
|||
/** |
|||
* 图标 |
|||
*/ |
|||
@ApiModelProperty(value = "图标") |
|||
@NotBlank(message = "图标不能为空") |
|||
private String memberLevelIcon; |
|||
|
|||
/** |
|||
* 背景图 |
|||
*/ |
|||
@ApiModelProperty(value = "背景图") |
|||
@NotBlank(message = "背景图不能为空") |
|||
private String memberLevelBackground; |
|||
|
|||
/** |
|||
* 成长值 |
|||
*/ |
|||
@ApiModelProperty(value = "成长值") |
|||
@NotNull(message = "成长值不能为空") |
|||
private Integer growth; |
|||
|
|||
/** |
|||
* 会员权益id数组 |
|||
*/ |
|||
@ApiModelProperty(value = "会员权益id数组") |
|||
private List<String> ids; |
|||
|
|||
/** |
|||
* 等级说明 |
|||
*/ |
|||
@ApiModelProperty(value = "等级说明") |
|||
private String memberLevelReason; |
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.param.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 编辑会员等级请求 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MemberLevelUpdateParam", description = "编辑会员等级请求") |
|||
public class MemberLevelUpdateParam { |
|||
|
|||
/** |
|||
* 会员等级id |
|||
*/ |
|||
@ApiModelProperty(value = "会员等级id") |
|||
private Long memberLevelId; |
|||
|
|||
/** |
|||
* 等级名称 |
|||
*/ |
|||
@ApiModelProperty(value = "等级名称") |
|||
@NotBlank(message = "等级名称不能为空") |
|||
private String memberLevelName; |
|||
|
|||
/** |
|||
* 图标 |
|||
*/ |
|||
@ApiModelProperty(value = "图标") |
|||
@NotBlank(message = "图标不能为空") |
|||
private String memberLevelIcon; |
|||
|
|||
/** |
|||
* 背景图 |
|||
*/ |
|||
@ApiModelProperty(value = "背景图") |
|||
@NotBlank(message = "背景图不能为空") |
|||
private String memberLevelBackground; |
|||
|
|||
/** |
|||
* 成长值 |
|||
*/ |
|||
@ApiModelProperty(value = "成长值") |
|||
@NotNull(message = "成长值不能为空") |
|||
private Integer growth; |
|||
|
|||
/** |
|||
* 会员权益id数组 |
|||
*/ |
|||
@ApiModelProperty(value = "会员权益id数组") |
|||
private List<String> ids; |
|||
|
|||
/** |
|||
* 等级说明 |
|||
*/ |
|||
@ApiModelProperty(value = "等级说明") |
|||
private String memberLevelReason; |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.param.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 编辑会员等级请求 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MemberLevelUpdateParam", description = "编辑会员等级请求") |
|||
public class MemberLevelgetByIdParam { |
|||
|
|||
/** |
|||
* 会员等级id |
|||
*/ |
|||
@ApiModelProperty(value = "会员等级id") |
|||
private Long memberLevelId; |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.param.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 会员权益详情请求 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MembershipGetByIdParam", description = "会员权益详情请求") |
|||
public class MembershipGetByIdParam { |
|||
|
|||
/** |
|||
* 权益id |
|||
*/ |
|||
@ApiModelProperty(value = "权益id") |
|||
private Long memberId; |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.param.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 添加会员权益请求 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MembershipSaveParam", description = "添加会员权益请求") |
|||
public class MembershipSaveParam { |
|||
|
|||
/** |
|||
* 商家id |
|||
*/ |
|||
@ApiModelProperty(value = "商家id") |
|||
private Long businessId; |
|||
|
|||
/** |
|||
* 权益名称 |
|||
*/ |
|||
@ApiModelProperty(value = "权益名称") |
|||
@NotBlank(message = "权益名称名称不能为空") |
|||
private String memberName; |
|||
|
|||
/** |
|||
* 权益图标 |
|||
*/ |
|||
@ApiModelProperty(value = "权益图标") |
|||
@NotBlank(message = "权益图标不能为空") |
|||
private String memberIcon; |
|||
|
|||
/** |
|||
* 权益说明 |
|||
*/ |
|||
@ApiModelProperty(value = "权益说明") |
|||
private String memberReason; |
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
/* |
|||
* Copyright (C) 2017-2021 |
|||
* All rights reserved, Designed By 深圳中科鑫智科技有限公司 |
|||
* Copyright authorization contact 18814114118 |
|||
*/ |
|||
package com.shop.cereshop.business.param.member; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 编辑会员权益请求 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "MembershipUpdateParam", description = "编辑会员权益请求") |
|||
public class MembershipUpdateParam { |
|||
|
|||
/** |
|||
* 权益id |
|||
*/ |
|||
@ApiModelProperty(value = "权益id") |
|||
private Long memberId; |
|||
|
|||
/** |
|||
* 商家id |
|||
*/ |
|||
@ApiModelProperty(value = "商家id") |
|||
private Long businessId; |
|||
|
|||
/** |
|||
* 权益名称 |
|||
*/ |
|||
@ApiModelProperty(value = "权益名称") |
|||
private String memberName; |
|||
|
|||
/** |
|||
* 权益图标 |
|||
*/ |
|||
@ApiModelProperty(value = "权益图标") |
|||
private String memberIcon; |
|||
|
|||
/** |
|||
* 权益说明 |
|||
*/ |
|||
@ApiModelProperty(value = "权益说明") |
|||
private String memberReason; |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue