74 changed files with 1026 additions and 592 deletions
@ -1,23 +0,0 @@ |
|||||
package com.bnyer.img.api.dto; |
|
||||
|
|
||||
import io.swagger.annotations.ApiModel; |
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
import lombok.Getter; |
|
||||
import lombok.Setter; |
|
||||
|
|
||||
/** |
|
||||
* @author :WXC |
|
||||
* @Date :2023/03/31 |
|
||||
* @description : |
|
||||
*/ |
|
||||
@Getter |
|
||||
@Setter |
|
||||
@ApiModel("会员vip查询类") |
|
||||
public class QueryUserVipDto { |
|
||||
@ApiModelProperty(value="主键Id") |
|
||||
private Long id; |
|
||||
|
|
||||
@ApiModelProperty(value="vip客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信") |
|
||||
private Integer userClientType; |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.bnyer.img.api.remote; |
||||
|
|
||||
|
import com.bnyer.common.core.constant.ServiceNameConstants; |
||||
|
import com.bnyer.common.core.domain.R; |
||||
|
import com.bnyer.img.api.factory.RemoteWxMiniFallbackFactory; |
||||
|
import com.bnyer.img.api.vo.UserVipVo; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @description : |
||||
|
*/ |
||||
|
@FeignClient(path = "/img/mini/vip",contextId = "remoteWxMiniService", value = ServiceNameConstants.IMG_SERVICE, fallbackFactory = RemoteWxMiniFallbackFactory.class) |
||||
|
public interface RemoteUserVipService { |
||||
|
|
||||
|
/** |
||||
|
* 获取会员信息 |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping(value = "/queryUserVip/{id}") |
||||
|
R<UserVipVo> queryUserVip(@PathVariable(value = "id") Long id); |
||||
|
} |
||||
@ -1,27 +0,0 @@ |
|||||
package com.bnyer.img.api.remote; |
|
||||
|
|
||||
import com.bnyer.common.core.constant.ServiceNameConstants; |
|
||||
import com.bnyer.common.core.domain.R; |
|
||||
import com.bnyer.img.api.dto.QueryUserVipDto; |
|
||||
import com.bnyer.img.api.factory.RemoteWxMiniFallbackFactory; |
|
||||
import com.bnyer.img.api.vo.UserVipInfoVo; |
|
||||
import org.springframework.cloud.openfeign.FeignClient; |
|
||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @author :WXC |
|
||||
* @description : |
|
||||
*/ |
|
||||
@FeignClient(contextId = "remoteWxMiniService", value = ServiceNameConstants.IMG_SERVICE, fallbackFactory = RemoteWxMiniFallbackFactory.class) |
|
||||
public interface RemoteWxMiniService { |
|
||||
|
|
||||
/** |
|
||||
* 获取会员列表 |
|
||||
* @return |
|
||||
*/ |
|
||||
@PostMapping(value = "/img/mini/fh/queryUserVipList") |
|
||||
R<List<UserVipInfoVo>> queryUserVipList(@RequestBody QueryUserVipDto dto); |
|
||||
} |
|
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.bnyer.order.api.query; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/03/27 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@NoArgsConstructor |
||||
|
public class VipOrderExtQuery implements Serializable { |
||||
|
|
||||
|
@ApiModelProperty(value = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
@ApiModelProperty(value="订单号") |
||||
|
private String orderNo; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.bnyer.common.core.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.*; |
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ToString |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
@TableName(value = "img_vip_type") |
||||
|
public class VipType extends BaseDomain { |
||||
|
|
||||
|
/** |
||||
|
* 类型编码 |
||||
|
*/ |
||||
|
@TableField(value = "type_code") |
||||
|
@ApiModelProperty(value="类型编码") |
||||
|
private String typeCode; |
||||
|
|
||||
|
/** |
||||
|
* 类型名称 |
||||
|
*/ |
||||
|
@TableField(value = "type_name") |
||||
|
@ApiModelProperty(value="类型名称") |
||||
|
private String typeName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,83 @@ |
|||||
|
package com.bnyer.common.core.dto; |
||||
|
|
||||
|
import com.bnyer.common.core.domain.BaseDomain; |
||||
|
import com.bnyer.common.core.utils.StringUtils; |
||||
|
import com.bnyer.common.core.utils.bean.ReflectUtils; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/05/10 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BaseDto <T extends BaseDomain> implements Serializable { |
||||
|
private static final long serialVersionUID = 320272502336434381L; |
||||
|
|
||||
|
/** |
||||
|
* 主键ID |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 数据创建时间 |
||||
|
*/ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 数据更新时间 |
||||
|
*/ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date updateTime; |
||||
|
|
||||
|
/** |
||||
|
* 是否显示 |
||||
|
*/ |
||||
|
private String isShow; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 主键ID集合 |
||||
|
*/ |
||||
|
private List<Long> ids; |
||||
|
|
||||
|
/** |
||||
|
* 转为实体类 |
||||
|
* |
||||
|
* @return 实体类 |
||||
|
*/ |
||||
|
public T toEntity() { |
||||
|
Class<T> entity = ReflectUtils.getParameterizedType(this.getClass()); |
||||
|
T entityInstance = ReflectUtils.newInstance(entity); |
||||
|
BeanUtils.copyProperties(this, entityInstance); |
||||
|
if (this.id == null) { |
||||
|
entityInstance.setIsShow("1"); |
||||
|
entityInstance.setCreateTime(new Date()); |
||||
|
entityInstance.setUpdateTime(null); |
||||
|
if (StringUtils.isNotBlank(this.isShow)){ |
||||
|
entityInstance.setIsShow(this.isShow); |
||||
|
}else { |
||||
|
entityInstance.setIsShow("1"); |
||||
|
} |
||||
|
if (this.sort != null){ |
||||
|
entityInstance.setSort(this.sort); |
||||
|
}else { |
||||
|
entityInstance.setSort(0); |
||||
|
} |
||||
|
} else { |
||||
|
entityInstance.setUpdateTime(new Date()); |
||||
|
} |
||||
|
return entityInstance; |
||||
|
} |
||||
|
} |
||||
@ -1,23 +0,0 @@ |
|||||
package com.bnyer.common.core.dto; |
|
||||
|
|
||||
import io.swagger.annotations.ApiModel; |
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
import lombok.Getter; |
|
||||
import lombok.Setter; |
|
||||
|
|
||||
/** |
|
||||
* @author :WXC |
|
||||
* @Date :2023/03/31 |
|
||||
* @description : |
|
||||
*/ |
|
||||
@Getter |
|
||||
@Setter |
|
||||
@ApiModel("会员vip查询类") |
|
||||
public class QueryUserVipDto { |
|
||||
@ApiModelProperty(value="主键Id") |
|
||||
private Long id; |
|
||||
|
|
||||
@ApiModelProperty(value="vip客户端类型:10用户-抖音 20用户-快手 30用户-微信 40艺术家-微信") |
|
||||
private Integer userClientType; |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,45 @@ |
|||||
|
package com.bnyer.common.core.utils.bean; |
||||
|
|
||||
|
import org.springframework.beans.BeanInstantiationException; |
||||
|
|
||||
|
import java.lang.reflect.ParameterizedType; |
||||
|
import java.lang.reflect.Type; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/05/10 |
||||
|
* @description :反射工具 |
||||
|
*/ |
||||
|
public class ReflectUtils { |
||||
|
|
||||
|
/** |
||||
|
* 得到传入类中当前指定得泛型 |
||||
|
* |
||||
|
* @param cls 待解析得类 |
||||
|
* @return 显示指定的泛型 |
||||
|
*/ |
||||
|
@SuppressWarnings("unchecked") |
||||
|
public static <T> Class<T> getParameterizedType(Class cls) { |
||||
|
Type genType = cls.getGenericSuperclass(); |
||||
|
Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); |
||||
|
return (Class<T>) params[0]; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 实例化class 对象 |
||||
|
* |
||||
|
* @param cls 待实例化类 |
||||
|
* @param <T> 类类型 |
||||
|
* @return 实例化对象 |
||||
|
*/ |
||||
|
public static <T> T newInstance(Class<T> cls) { |
||||
|
try { |
||||
|
return cls.newInstance(); |
||||
|
} catch (Exception e) { |
||||
|
throw new BeanInstantiationException(cls, e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.bnyer.img.controller; |
||||
|
|
||||
|
import com.bnyer.common.core.domain.R; |
||||
|
import com.bnyer.img.query.UserVipQuery; |
||||
|
import com.bnyer.img.service.UserVipService; |
||||
|
import com.bnyer.img.vo.UserVipVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/05/10 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Api(value = "会员相关接口",tags = "会员相关接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/img/mini/vip") |
||||
|
@Slf4j |
||||
|
public class UserVipController { |
||||
|
|
||||
|
@Resource |
||||
|
private UserVipService userVipService; |
||||
|
|
||||
|
@Operation(summary="获取会员列表",description = "获取会员列表") |
||||
|
@PostMapping(value = "/queryUserVipList") |
||||
|
public R<List<UserVipVo>> queryUserVipList(@RequestBody UserVipQuery query){ |
||||
|
return R.ok(userVipService.queryUserVipList(query)); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary="获取会员信息",description = "获取会员信息") |
||||
|
@GetMapping(value = "/queryUserVip/{id}") |
||||
|
public R<UserVipVo> queryUserVip(@PathVariable(value = "id") Long id){ |
||||
|
return R.ok(userVipService.queryUserVip(id)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
package com.bnyer.img.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.bnyer.common.core.domain.UserVip; |
||||
|
import com.bnyer.common.core.domain.VipType; |
||||
|
import com.bnyer.img.query.UserVipQuery; |
||||
|
import com.bnyer.img.vo.UserVipVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface VipTypeMapper extends BaseMapper<VipType> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.bnyer.img.query; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/03/31 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("会员查询类") |
||||
|
public class UserVipQuery { |
||||
|
|
||||
|
} |
||||
@ -1,16 +1,25 @@ |
|||||
package com.bnyer.img.service; |
package com.bnyer.img.service; |
||||
|
|
||||
import com.bnyer.common.core.dto.QueryUserVipDto; |
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.bnyer.common.core.domain.UserVip; |
||||
|
import com.bnyer.img.query.UserVipQuery; |
||||
import com.bnyer.img.vo.UserVipVo; |
import com.bnyer.img.vo.UserVipVo; |
||||
|
|
||||
import java.util.List; |
import java.util.List; |
||||
|
|
||||
public interface UserVipService { |
public interface UserVipService extends IService<UserVip> { |
||||
|
|
||||
/** |
/** |
||||
* 获取小程序端会员vip列表 |
* 获取用户会员列表 |
||||
* @return - |
* @param query |
||||
|
* @return |
||||
*/ |
*/ |
||||
List<UserVipVo> queryFront(QueryUserVipDto dto); |
List<UserVipVo> queryUserVipList(UserVipQuery query); |
||||
|
|
||||
|
/** |
||||
|
* 获取会员详细信息 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
UserVipVo queryUserVip(Long id); |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.bnyer.img.mapper.VipTypeMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.bnyer.common.core.domain.VipType"> |
||||
|
<!--@mbg.generated--> |
||||
|
<!--@Table img_vip_type--> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="type_code" jdbcType="VARCHAR" property="typeCode" /> |
||||
|
<result column="type_name" jdbcType="VARCHAR" property="typeName" /> |
||||
|
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
</resultMap> |
||||
|
</mapper> |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.bnyer.order.bean.query; |
||||
|
|
||||
|
import com.bnyer.common.core.exception.ServiceException; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/03/27 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@NoArgsConstructor |
||||
|
public class VipOrderExtQuery implements Serializable { |
||||
|
|
||||
|
@ApiModelProperty(value = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
@ApiModelProperty(value="订单号") |
||||
|
private String orderNo; |
||||
|
|
||||
|
|
||||
|
public void valid() { |
||||
|
if (this.id == null && StringUtils.isBlank(this.orderNo)){ |
||||
|
throw new ServiceException("id 和 订单号不能同时为空"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -1,7 +1,5 @@ |
|||||
package com.bnyer.order.vo; |
package com.bnyer.order.bean.vo; |
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
|
||||
import com.baomidou.mybatisplus.annotation.TableId; |
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Getter; |
import lombok.Getter; |
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.bnyer.pay.bean.bo; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/05/08 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@NoArgsConstructor |
||||
|
public class RefundBo { |
||||
|
|
||||
|
} |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.dto; |
package com.bnyer.pay.bean.dto; |
||||
|
|
||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||
import lombok.Getter; |
import lombok.Getter; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.dto; |
package com.bnyer.pay.bean.dto; |
||||
|
|
||||
import lombok.Getter; |
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
import lombok.NoArgsConstructor; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.dto; |
package com.bnyer.pay.bean.dto; |
||||
|
|
||||
import com.bnyer.common.core.enums.EnumPayType; |
import com.bnyer.common.core.enums.EnumPayType; |
||||
import lombok.Getter; |
import lombok.Getter; |
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.bnyer.pay.bean.dto; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/05/08 |
||||
|
* @description : |
||||
|
*/ |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@NoArgsConstructor |
||||
|
public class RefundDto { |
||||
|
|
||||
|
} |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.vo; |
package com.bnyer.pay.bean.vo; |
||||
|
|
||||
import lombok.Getter; |
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
import lombok.NoArgsConstructor; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.vo; |
package com.bnyer.pay.bean.vo; |
||||
|
|
||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.vo; |
package com.bnyer.pay.bean.vo; |
||||
|
|
||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Getter; |
import lombok.Getter; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.bnyer.pay.vo; |
package com.bnyer.pay.bean.vo; |
||||
|
|
||||
import lombok.Getter; |
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
import lombok.NoArgsConstructor; |
||||
@ -0,0 +1,10 @@ |
|||||
|
package com.bnyer.pay.bean.vo; |
||||
|
|
||||
|
/** |
||||
|
* @author :WXC |
||||
|
* @Date :2023/05/08 |
||||
|
* @description : |
||||
|
*/ |
||||
|
public class ThirdRefundVo { |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue