[fix]修改登录日志和账户
This commit is contained in:
parent
3ec075544d
commit
7212f67023
@ -92,7 +92,7 @@ spring:
|
||||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||
maxLifetime: 1800000
|
||||
# 多久检查一次连接的活性
|
||||
keepaliveTime: 30000
|
||||
keepaliveTime: 300000
|
||||
|
||||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring.data:
|
||||
|
@ -141,9 +141,11 @@ tenant:
|
||||
- ums_member
|
||||
- ums_member_address
|
||||
- ums_feedback
|
||||
- ums_member_account
|
||||
- ums_member_login_info
|
||||
- ums_member_cart
|
||||
- ums_cart
|
||||
- ums_account
|
||||
- ums_account_change_record
|
||||
- ums_fans
|
||||
- oms_aftersale
|
||||
- oms_aftersale_item
|
||||
- oms_order
|
||||
@ -158,6 +160,7 @@ tenant:
|
||||
- pms_sku
|
||||
- pms_sku_snapshot
|
||||
|
||||
|
||||
# MyBatisPlus配置
|
||||
# https://baomidou.com/config/
|
||||
mybatis-plus:
|
||||
|
@ -3,12 +3,26 @@ package org.dromara.common.core.domain;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
|
||||
import java.sql.Wrapper;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class BaseBO <T> {
|
||||
|
||||
|
||||
|
||||
protected LocalDateTime beginTime;
|
||||
|
||||
protected LocalDateTime endTime;
|
||||
|
||||
|
||||
protected Map<String,String> orderBy = new HashMap<>();
|
||||
|
||||
/**
|
||||
* bo转换成queryWrapper
|
||||
*
|
||||
|
@ -228,4 +228,6 @@ public class RedisCache
|
||||
{
|
||||
return redisTemplate.keys(pattern);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class SecurityConfig implements WebMvcConfigurer {
|
||||
HttpServletRequest request = ServletUtils.getRequest();
|
||||
// 检查是否登录 是否有token
|
||||
try {
|
||||
StpUtil.checkLogin();
|
||||
// StpUtil.checkLogin();
|
||||
} catch (NotLoginException e) {
|
||||
if (request.getRequestURI().contains("sse")) {
|
||||
throw new SseException(e.getMessage(), e.getCode());
|
||||
|
@ -1,12 +1,19 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.member.domain.vo.FansVO;
|
||||
import com.wzj.soopin.member.service.IFansService;
|
||||
import com.wzj.soopin.member.service.IMemberService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Slf4j
|
||||
@RequestMapping("/ums/fans")
|
||||
@RestController
|
||||
@ -82,31 +89,31 @@ public class FansController {
|
||||
////
|
||||
// return GraceJSONResult.ok();
|
||||
// }
|
||||
|
||||
// @PostMapping("cancel")
|
||||
// public GraceJSONResult cancel(@RequestParam String myId,
|
||||
// @RequestParam String vlogerId) {
|
||||
// // 判断两个id不能为空
|
||||
// if (StringUtils.isBlank(myId) || StringUtils.isBlank(vlogerId)) {
|
||||
// return GraceJSONResult.errorCustom(ResponseStatusEnum.SYSTEM_ERROR);
|
||||
// }
|
||||
// // 是否已经存在关系
|
||||
// Boolean flow = fansService.queryDoIFollowVloger(myId,vlogerId);
|
||||
// if(!flow){
|
||||
// return GraceJSONResult.errorCustom(ResponseStatusEnum.FANS_INFO_UPDATED_ISFLOW_EXIST_ERROR);
|
||||
// }
|
||||
// // 删除业务的执行
|
||||
// fansService.doCancel(myId, vlogerId);
|
||||
//
|
||||
//// @PostMapping("cancel")
|
||||
//// public GraceJSONResult cancel(@RequestParam String myId,
|
||||
//// @RequestParam String vlogerId) {
|
||||
//// // 判断两个id不能为空
|
||||
//// if (StringUtils.isBlank(myId) || StringUtils.isBlank(vlogerId)) {
|
||||
//// return GraceJSONResult.errorCustom(ResponseStatusEnum.SYSTEM_ERROR);
|
||||
//// }
|
||||
//// // 是否已经存在关系
|
||||
//// Boolean flow = fansService.queryDoIFollowVloger(myId,vlogerId);
|
||||
//// if(!flow){
|
||||
//// return GraceJSONResult.errorCustom(ResponseStatusEnum.FANS_INFO_UPDATED_ISFLOW_EXIST_ERROR);
|
||||
//// }
|
||||
//// // 删除业务的执行
|
||||
//// fansService.doCancel(myId, vlogerId);
|
||||
////
|
||||
//// // 博主的粉丝-1,我的关注-1
|
||||
//// redis.decrement(BaseInfoProperties.REDIS_MY_FOLLOWS_COUNTS + ":" + myId, 1);
|
||||
//// redis.decrement(BaseInfoProperties.REDIS_MY_FANS_COUNTS + ":" + vlogerId, 1);
|
||||
////
|
||||
//// // 我和博主的关联关系,依赖redis,不要存储数据库,避免db的性能瓶颈
|
||||
//// redis.del(BaseInfoProperties.REDIS_FANS_AND_VLOGGER_RELATIONSHIP + ":" + myId + ":" + vlogerId);
|
||||
////
|
||||
//// return GraceJSONResult.ok();
|
||||
//// }
|
||||
// // 博主的粉丝-1,我的关注-1
|
||||
// redis.decrement(BaseInfoProperties.REDIS_MY_FOLLOWS_COUNTS + ":" + myId, 1);
|
||||
// redis.decrement(BaseInfoProperties.REDIS_MY_FANS_COUNTS + ":" + vlogerId, 1);
|
||||
//
|
||||
// // 我和博主的关联关系,依赖redis,不要存储数据库,避免db的性能瓶颈
|
||||
// redis.del(BaseInfoProperties.REDIS_FANS_AND_VLOGGER_RELATIONSHIP + ":" + myId + ":" + vlogerId);
|
||||
//
|
||||
// return GraceJSONResult.ok();
|
||||
// }
|
||||
//
|
||||
// @GetMapping("queryBlockVloger")
|
||||
// public GraceJSONResult queryBlockVloger(@RequestParam String myId,
|
||||
@ -268,15 +275,6 @@ public class FansController {
|
||||
// page,
|
||||
// pageSize));
|
||||
// }
|
||||
//
|
||||
// @GetMapping("queryMyFans")
|
||||
// public GraceJSONResult queryMyFans(@RequestParam String myId,
|
||||
// @RequestParam Integer page,
|
||||
// @RequestParam Integer pageSize) {
|
||||
// return GraceJSONResult.ok(
|
||||
// fansService.queryMyFans(
|
||||
// myId,
|
||||
// page,
|
||||
// pageSize));
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.wzj.soopin.member.convert.FeedbackConvert;
|
||||
import com.wzj.soopin.member.domain.bo.FeedbackBO;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.vo.FeedbackVO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import com.wzj.soopin.member.service.IFeedbackService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -34,7 +35,7 @@ public class FeedbackController {
|
||||
|
||||
@Tag(name ="查询意见反馈列表")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<FeedbackVO>> list(@RequestBody FeedbackBO query, Page page) {
|
||||
public R<IPage<FeedbackVO>> list(@RequestBody FeedbackBO query, @RequestBody Page page) {
|
||||
Page<Feedback> feedBackPage= service.page(page,query.toWrapper());
|
||||
return R.ok(convert.toVO( feedBackPage));
|
||||
}
|
||||
@ -54,6 +55,11 @@ public class FeedbackController {
|
||||
return R.ok(service.save(convert.toPo(feedback)));
|
||||
}
|
||||
|
||||
@Tag(name ="获取详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R<FeedbackVO> getInfo(@PathVariable("id") Long id) {
|
||||
return R.ok( service.selectById(id));
|
||||
}
|
||||
|
||||
@Tag(name =("修改状态"))
|
||||
@Log(title = "意见反馈", businessType = BusinessType.UPDATE)
|
||||
@ -66,7 +72,7 @@ public class FeedbackController {
|
||||
@Tag(name ="删除意见反馈")
|
||||
@Log(title = "意见反馈", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Object> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.removeById(id));
|
||||
public R<Object> remove(@PathVariable Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,100 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.member.convert.MemberAccountChangeRecordConvert;
|
||||
import com.wzj.soopin.member.convert.MemberConvert;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountChangeRecordBO;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccountChangeRecord;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountChangeRecordVO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberDataStatisticsVO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberVO;
|
||||
import com.wzj.soopin.member.service.IMemberAccountChangeRecordService;
|
||||
import com.wzj.soopin.member.service.IMemberService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员信息Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Tag(name = "会员账户变动接口列表")
|
||||
@RequestMapping("/ums/account/change/record")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class MemberAccountChangeRecordController extends BaseController {
|
||||
private final IMemberAccountChangeRecordService service;
|
||||
|
||||
private final MemberAccountChangeRecordConvert convert;
|
||||
|
||||
|
||||
@Tag(name = "查询账户变动列表")
|
||||
@SaCheckPermission("ums:accountchange:list")
|
||||
@PostMapping("list")
|
||||
public R<Page<MemberAccountChangeRecordVO>> list(@RequestBody MemberAccountChangeRecordBO bo,
|
||||
Page<MemberAccountChangeRecord> page) {
|
||||
Page<MemberAccountChangeRecord> memberPage = service.page(page,bo.toWrapper());
|
||||
return R.ok(convert.toVO(memberPage));
|
||||
}
|
||||
|
||||
@Tag(name ="导出变动记录")
|
||||
@SaCheckPermission("ums:accountchange:export")
|
||||
@Log(title = "会员信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("export")
|
||||
public ResponseEntity<String> export(MemberAccountChangeRecordBO query) {
|
||||
List<MemberAccountChangeRecord> list = service.list(query.toWrapper());
|
||||
ExcelUtil<MemberAccountChangeRecordVO> util = new ExcelUtil<>(MemberAccountChangeRecordVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.toVO(list), "会员变动记录"));
|
||||
}
|
||||
|
||||
@Tag(name ="获取变动记录")
|
||||
@SaCheckPermission("ums:accountchange:query")
|
||||
@GetMapping(value = "{id}")
|
||||
public R<MemberAccountChangeRecordVO> getInfo(@PathVariable("id") Long id) {
|
||||
return R.ok(convert.toVO(service.getById(id)));
|
||||
}
|
||||
|
||||
@Tag(name ="新增变动记录")
|
||||
@SaCheckPermission("'ums:accountchange:add")
|
||||
@Log(title = "新增变动记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping("add")
|
||||
public R add(@RequestBody MemberAccountChangeRecordBO member) {
|
||||
return R.ok(service.save(convert.toPo(member)));
|
||||
}
|
||||
|
||||
@Tag(name ="修改变动记录")
|
||||
@SaCheckPermission("ums:accountchange:edit")
|
||||
@Log(title = "修改变动记录", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("update")
|
||||
public R edit(@RequestBody MemberAccountChangeRecordBO member) {
|
||||
return R.ok(service.updateById(convert.toPo(member)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Tag(name ="删除变动记录")
|
||||
@SaCheckPermission("ums:accountchange:remove")
|
||||
@Log(title = "删除变动记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("{id}")
|
||||
public R remove(@PathVariable Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
@Tag(name ="会员账户表接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberAccount")
|
||||
@RequestMapping("/ums/member/account")
|
||||
@RequiredArgsConstructor
|
||||
public class MemberAccountController {
|
||||
|
||||
@ -34,8 +34,8 @@ public class MemberAccountController {
|
||||
|
||||
@Tag(name ="查询会员账户表列表")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<MemberAccountVO>> list(@RequestBody MemberAccountBO query, IPage page) {
|
||||
Page<MemberAccount> list = (Page<MemberAccount>) service.page(page,query.toWrapper() );
|
||||
public R<IPage<MemberAccountVO>> list(@RequestBody MemberAccountBO query, Page page) {
|
||||
Page<MemberAccount> list = service.page(page,query.toWrapper() );
|
||||
return R.ok(convert.toVO(list));
|
||||
}
|
||||
|
||||
@ -50,8 +50,8 @@ public class MemberAccountController {
|
||||
|
||||
@Tag(name ="获取会员账户表详细信息")
|
||||
@GetMapping(value = "/{memberId}")
|
||||
public ResponseEntity<MemberAccount> getInfo(@PathVariable("memberId") Long memberId) {
|
||||
return ResponseEntity.ok(service.getById(memberId));
|
||||
public ResponseEntity<MemberAccountVO> getInfo(@PathVariable("memberId") Long memberId) {
|
||||
return ResponseEntity.ok(convert.toVO(service.getById(memberId)));
|
||||
}
|
||||
|
||||
@Tag(name ="新增会员账户表")
|
||||
|
@ -84,8 +84,8 @@ public class MemberController extends BaseController {
|
||||
@SaCheckPermission("ums:member:edit")
|
||||
@Log(title = "会员备注信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("mark/update")
|
||||
public ResponseEntity<Integer> editMark(@RequestBody Member member) {
|
||||
return ResponseEntity.ok(service.updateMark(member));
|
||||
public R<Integer> editMark(@RequestBody MemberBO member) {
|
||||
return R.ok(service.updateMark(member));
|
||||
}
|
||||
|
||||
@Tag(name ="删除会员信息")
|
||||
@ -99,8 +99,8 @@ public class MemberController extends BaseController {
|
||||
@Tag(name =("修改会员账户状态"))
|
||||
@Log(title = "会员信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("status/change")
|
||||
public ResponseEntity<Integer> changeStatus(@RequestBody ChangeMemberStatusForm form){
|
||||
return ResponseEntity.ok(service.changeStatus(form));
|
||||
public R<Integer> changeStatus(@RequestBody MemberBO memberBO){
|
||||
return R.ok(service.changeStatus(memberBO));
|
||||
}
|
||||
|
||||
@Tag(name ="会员手机号解密")
|
||||
|
@ -51,6 +51,15 @@ public class MemberLoginInfoController extends BaseController {
|
||||
return R.ok(util.writeExcel(convert.toVO(list), "会员登录记录数据"));
|
||||
}
|
||||
|
||||
|
||||
@Tag(name ="导出会员登录记录列表")
|
||||
@SaCheckPermission("ums:memberlogininfo:export")
|
||||
@Log(title = "会员登录记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("add")
|
||||
public R<Boolean> add(@RequestBody MemberLoginInfoBO bo) {
|
||||
return R.ok(service.save(convert.toPo(bo)));
|
||||
}
|
||||
|
||||
@Tag(name ="获取会员登录记录详细信息")
|
||||
@SaCheckPermission("ums:memberlogininfo:query")
|
||||
@GetMapping(value = "{id}")
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountBO;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountChangeRecordBO;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccountChangeRecord;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountChangeRecordVO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import org.dromara.common.web.core.BaseConverter;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* 会员账户表 DO <=> DTO <=> VO / BO / Query
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = BaseConverter.class)
|
||||
public interface MemberAccountChangeRecordConvert extends BaseConverter<MemberAccountChangeRecordVO, MemberAccountChangeRecordBO, MemberAccountChangeRecord> {
|
||||
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.common.core.domain.BaseBO;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -15,31 +18,73 @@ import java.time.LocalDateTime;
|
||||
@Schema(description = "意见反馈 查询 对象")
|
||||
@Data
|
||||
public class FeedbackBO extends BaseBO {
|
||||
@Schema(description ="类型 精确匹配")
|
||||
private String type;
|
||||
@Schema(description ="ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description ="具体说明 精确匹配")
|
||||
@Schema(description ="类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description ="具体说明")
|
||||
private String content;
|
||||
|
||||
@Schema(description ="图片 精确匹配")
|
||||
@Schema(description ="图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description ="联系电话 精确匹配")
|
||||
@Schema(description ="联系电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description ="处理状态 0:未处理 1:已处理 精确匹配")
|
||||
private Integer handleStatus;
|
||||
@Schema(description ="处理状态 0:未处理 1:已处理")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description ="处理时间 精确匹配")
|
||||
@Schema(description ="备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description ="处理时间")
|
||||
private LocalDateTime handleTime;
|
||||
|
||||
private String beginTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
@Schema(description ="反馈对象ID")
|
||||
private Long aimId;
|
||||
|
||||
@Schema(description ="反馈分类")
|
||||
private Integer category;
|
||||
|
||||
@Schema(description ="会员ID")
|
||||
private String memberId;
|
||||
|
||||
@Schema(description ="处理人")
|
||||
private Long handlerId;
|
||||
|
||||
@Schema(description ="处理结果类型 0:文本 1:图片")
|
||||
private Integer resultType;
|
||||
|
||||
@Schema(description ="处理结果")
|
||||
private String resultContent;
|
||||
|
||||
@Schema(description ="反馈对象类型")
|
||||
private String aimType;
|
||||
|
||||
@Override
|
||||
public LambdaQueryWrapper toWrapper() {
|
||||
return super.toWrapper();
|
||||
return new LambdaQueryWrapper<Feedback>()
|
||||
.eq(type!=null,Feedback::getType, type)
|
||||
.eq(content!=null,Feedback::getContent, content)
|
||||
.eq(images!=null,Feedback::getImages, images)
|
||||
.eq(phone!=null,Feedback::getPhone, phone)
|
||||
.eq(status!=null,Feedback::getStatus, status)
|
||||
.eq(remark!=null,Feedback::getRemark, remark)
|
||||
.eq(handleTime!=null,Feedback::getHandleTime, handleTime)
|
||||
.eq(aimId!=null,Feedback::getAimId, aimId)
|
||||
.eq(category!=null,Feedback::getCategory, category)
|
||||
.eq(memberId!=null,Feedback::getMemberId, memberId)
|
||||
.eq(handlerId!=null,Feedback::getHandlerId, handlerId)
|
||||
.eq(resultType!=null,Feedback::getResultType, resultType)
|
||||
.eq(resultContent!=null,Feedback::getResultContent, resultContent)
|
||||
.ge(beginTime!=null,Feedback::getCreateTime, beginTime)
|
||||
.lt(endTime!=null,Feedback::getCreateTime, endTime)
|
||||
.eq(aimType!=null,Feedback::getAimType, aimType)
|
||||
.orderByDesc(Feedback::getId)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.BaseBO;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ -26,14 +27,25 @@ public class MemberAccountBO extends BaseBO {
|
||||
|
||||
|
||||
@Schema(description ="MEMBER_ID")
|
||||
@TableId(value="member_id", type = IdType.ASSIGN_ID)
|
||||
private Long memberId;
|
||||
|
||||
|
||||
@Schema(description ="钱包")
|
||||
private BigDecimal wallet;
|
||||
|
||||
@Schema(description ="营收")
|
||||
private BigDecimal revenue;
|
||||
|
||||
|
||||
|
||||
@Schema(description ="余额")
|
||||
private BigDecimal moneyBalance;
|
||||
public LambdaQueryWrapper<MemberAccount> toWrapper() {
|
||||
LambdaQueryWrapper<MemberAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MemberAccount::getIntegralBalance, integralBalance);
|
||||
queryWrapper.eq(MemberAccount::getTotalIntegralBalance, totalIntegralBalance);
|
||||
queryWrapper.eq(MemberAccount::getMemberId, memberId);
|
||||
queryWrapper.eq(getIntegralBalance() != null,MemberAccount::getIntegralBalance, integralBalance);
|
||||
queryWrapper.eq(getTotalIntegralBalance() != null,MemberAccount::getTotalIntegralBalance, totalIntegralBalance);
|
||||
queryWrapper.eq(getMemberId() != null,MemberAccount::getMemberId, memberId)
|
||||
;
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccountChangeRecord;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.BaseBO;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员账户表对象 ums_member_account
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Schema(description="会员账户变动记录")
|
||||
@Data
|
||||
public class MemberAccountChangeRecordBO extends BaseBO<MemberAccountChangeRecord> {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description ="MEMBER_ID")
|
||||
private Long memberId;
|
||||
|
||||
|
||||
@Schema(description ="余额")
|
||||
private BigDecimal moneyBalance;
|
||||
|
||||
|
||||
@Schema(description ="变动前余额")
|
||||
private BigDecimal beforeBalance;
|
||||
|
||||
@Schema(description ="变动后余额")
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
|
||||
@Schema(description ="变动金额")
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
@Schema(description ="变动类型")
|
||||
private Integer changeType;
|
||||
|
||||
@Schema(description ="变动描述")
|
||||
private String changeDesc;
|
||||
|
||||
@Schema(description ="来源")
|
||||
private Integer source;
|
||||
|
||||
@Override
|
||||
public LambdaQueryWrapper<MemberAccountChangeRecord> toWrapper() {
|
||||
return new LambdaQueryWrapper<MemberAccountChangeRecord>()
|
||||
.eq(getMemberId() != null,MemberAccountChangeRecord::getMemberId,memberId)
|
||||
.eq(getChangeType() != null,MemberAccountChangeRecord::getChangeType,changeType)
|
||||
.eq(getSource() != null,MemberAccountChangeRecord::getSource,source);
|
||||
}
|
||||
}
|
@ -19,6 +19,12 @@ import java.time.LocalDateTime;
|
||||
@Schema(description="会员信息 查询 对象")
|
||||
@Data
|
||||
public class MemberBO extends BaseBO {
|
||||
|
||||
|
||||
@Schema(description ="id")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description ="昵称 精确匹配")
|
||||
private String nickname;
|
||||
|
||||
@ -67,22 +73,17 @@ public class MemberBO extends BaseBO {
|
||||
@Schema(description ="用户剩余积分 精确匹配")
|
||||
private BigDecimal integral;
|
||||
|
||||
private String beginTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
public QueryWrapper<Member> toWapper(){
|
||||
QueryWrapper<Member> qw = new QueryWrapper<>();
|
||||
qw.lambda().like(!StringUtils.isEmpty(this.getNickname()),Member::getNickname, this.getNickname());
|
||||
|
||||
String phone = this.getPhone();
|
||||
if (!StringUtils.isEmpty(phone)) {
|
||||
qw.eq("phone_encrypted", phone);
|
||||
}
|
||||
if (!StringUtils.isEmpty(this.getBeginTime()) && !StringUtils.isEmpty(this.getEndTime())){
|
||||
qw.ge("create_time", this.getBeginTime());
|
||||
qw.lt("create_time", this.getEndTime());
|
||||
}
|
||||
qw.lambda()
|
||||
.like(!StringUtils.isEmpty(this.getNickname()),Member::getNickname, this.getNickname())
|
||||
.eq(getId() != null,Member::getId, this.getId())
|
||||
.eq(status != null,Member::getStatus,status)
|
||||
.eq(!getPhone().isEmpty(), Member::getPhoneEncrypted, phone);
|
||||
qw.ge(getBeginTime() != null,"create_time", this.getBeginTime());
|
||||
qw.lt(getEndTime() != null,"create_time", this.getEndTime());
|
||||
if (this.getHasMark() != null) {
|
||||
switch (this.getHasMark()) {
|
||||
case 0:
|
||||
@ -95,9 +96,6 @@ public class MemberBO extends BaseBO {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.getStatus() != null){
|
||||
qw.eq("status", this.getStatus());
|
||||
}
|
||||
return qw;
|
||||
}
|
||||
}
|
||||
|
@ -37,10 +37,6 @@ public class MemberLoginInfoBO extends BaseBO<MemberLoginInfo> {
|
||||
@Schema(description ="登陆时间 精确匹配")
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
private String beginTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
@Override
|
||||
public LambdaQueryWrapper<MemberLoginInfo> toWrapper() {
|
||||
return super.toWrapper();
|
||||
|
@ -20,21 +20,14 @@ public class Address extends BaseAudit {
|
||||
private Integer id;
|
||||
|
||||
@Schema(description ="地区邮编")
|
||||
@Excel(name = "地区邮编")
|
||||
private Long code;
|
||||
|
||||
@Schema(description ="父地区邮编")
|
||||
@Excel(name = "父地区邮编")
|
||||
private Long parentCode;
|
||||
|
||||
@Schema(description ="地区名")
|
||||
@Excel(name = "地区名")
|
||||
private String name;
|
||||
|
||||
@Schema(description ="地区层级")
|
||||
@Excel(name = "地区层级")
|
||||
private Integer level;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -15,6 +16,7 @@ public class Fans extends BaseAudit {
|
||||
|
||||
|
||||
@Schema(description ="ID")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@ -30,19 +32,16 @@ public class Fans extends BaseAudit {
|
||||
* 粉丝用户id
|
||||
*/
|
||||
@Schema(description ="粉丝id")
|
||||
@Excel(name = "粉丝id")
|
||||
private String fanId;
|
||||
|
||||
/**
|
||||
* 粉丝是否是vloger的朋友,如果成为朋友,则本表的双方此字段都需要设置为1,如果有一人取关,则两边都需要设置为0
|
||||
*/
|
||||
@Schema(description ="是否是好友")
|
||||
@Excel(name = "是否是好友")
|
||||
private Integer friendFlag;
|
||||
|
||||
|
||||
@Schema(description ="是否互相关注")
|
||||
@Excel(name = "是否互相关注")
|
||||
private Integer bothFriend;
|
||||
|
||||
|
||||
|
@ -22,56 +22,47 @@ public class Feedback extends BaseAudit {
|
||||
private Long id;
|
||||
|
||||
@Schema(description ="类型")
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
private Integer type;
|
||||
|
||||
@Schema(description ="具体说明")
|
||||
@Excel(name = "具体说明")
|
||||
private String content;
|
||||
|
||||
@Schema(description ="图片")
|
||||
@Excel(name = "图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description ="联系电话")
|
||||
@Excel(name = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description ="处理状态 0:未处理 1:已处理")
|
||||
@Excel(name = "处理状态 0:未处理 1:已处理")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description ="备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description ="处理时间")
|
||||
@Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime handleTime;
|
||||
|
||||
|
||||
|
||||
@Schema(description ="反馈对象ID")
|
||||
@Excel(name = "反馈对象ID")
|
||||
private Long aimId;
|
||||
|
||||
@Schema(description ="反馈对象类型 0 会员 1 群组 2 评论 3 视频 4 聊天" )
|
||||
private Integer aimType;
|
||||
|
||||
@Schema(description ="反馈分类")
|
||||
private Long categroy;
|
||||
private Integer category;
|
||||
|
||||
@Schema(description ="会员ID")
|
||||
@Excel(name = "会员ID")
|
||||
private String memberId;
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description ="处理人")
|
||||
@Excel(name = "处理人")
|
||||
private Long handlerId;
|
||||
|
||||
@Schema(description ="处理结果类型 0:文本 1:图片")
|
||||
@Excel(name = "处理结果类型 0:不予处理 1:已处理")
|
||||
private Integer resultType;
|
||||
|
||||
@Schema(description ="处理结果")
|
||||
@Excel(name = "处理结果")
|
||||
private String resultContent;
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
@ -20,24 +21,17 @@ import java.time.LocalDateTime;
|
||||
@Builder
|
||||
@TableName("ums_member")
|
||||
public class Member extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "会员id")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description ="昵称")
|
||||
@Excel(name = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description ="密码")
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description ="加密手机号")
|
||||
@ -47,77 +41,58 @@ public class Member extends BaseAudit {
|
||||
private String phoneHidden;
|
||||
|
||||
@Schema(description ="用户备注")
|
||||
@Excel(name = "用户备注")
|
||||
private String mark;
|
||||
|
||||
@Schema(description ="帐号启用状态:0->禁用;1->启用")
|
||||
@Excel(name = "帐号启用状态:0->禁用;1->启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description ="头像")
|
||||
@Excel(name = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description ="性别:0->未知;1->男;2->女")
|
||||
@Excel(name = "性别:0->未知;1->男;2->女")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description ="用户所在城市")
|
||||
@Excel(name = "用户所在城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description ="用户所在省份")
|
||||
@Excel(name = "用户所在省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description ="用户所在国家")
|
||||
@Excel(name = "用户所在国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description ="公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注")
|
||||
@Excel(name = "公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description ="生日")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description ="推广员id")
|
||||
@Excel(name = "推广员id")
|
||||
private Long spreadUid;
|
||||
|
||||
@Schema(description ="推广员关联时间")
|
||||
@Excel(name = "推广员关联时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime spreadTime;
|
||||
|
||||
@Schema(description ="等级")
|
||||
@Excel(name = "等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description ="用户剩余积分")
|
||||
@Excel(name = "用户剩余积分")
|
||||
private BigDecimal integral;
|
||||
|
||||
@Schema(description ="im签名")
|
||||
@Excel(name = "im签名")
|
||||
private String userSig; // 添加 UserSig 属性
|
||||
|
||||
@Schema(description ="发布视频")
|
||||
@Excel(name = "发布视频")
|
||||
private Integer vlogCount;
|
||||
@Schema(description ="粉丝数")
|
||||
@Excel(name = "粉丝数")
|
||||
private Integer fansCount;
|
||||
@Schema(description ="关注数")
|
||||
@Excel(name = "关注数")
|
||||
private Integer followCount;
|
||||
|
||||
@Schema(description ="好友数")
|
||||
@Excel(name = "好友数")
|
||||
private Integer friendsCount;
|
||||
|
||||
@Schema(description ="微信openId")
|
||||
@Excel(name = "微信openId")
|
||||
private Long openId;
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
@ -17,29 +18,29 @@ import java.math.BigDecimal;
|
||||
@Schema(description="会员账户表对象")
|
||||
@Data
|
||||
@TableName("ums_account")
|
||||
@Builder(toBuilder = true)
|
||||
public class MemberAccount extends BaseAudit {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description ="MEMBER_ID")
|
||||
@TableId(value="member_id", type = IdType.ASSIGN_ID)
|
||||
@TableId(value="member_id")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description ="积分余额")
|
||||
@Excel(name = "积分余额")
|
||||
private BigDecimal integralBalance;
|
||||
|
||||
@Schema(description ="历史总共积分")
|
||||
@Excel(name = "历史总共积分")
|
||||
private BigDecimal totalIntegralBalance;
|
||||
|
||||
|
||||
@Schema(description ="余额")
|
||||
@Excel(name = "余额")
|
||||
private BigDecimal moneyBalance;
|
||||
|
||||
|
||||
@Schema(description ="钱包")
|
||||
private BigDecimal wallet;
|
||||
|
||||
@Schema(description ="营收")
|
||||
private BigDecimal revenue;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员账户表对象 ums_member_account
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Schema(description="会员账户变动记录")
|
||||
@Data
|
||||
@TableName("ums_account_change_record")
|
||||
public class MemberAccountChangeRecord extends BaseAudit {
|
||||
|
||||
@Schema(description ="主键")
|
||||
@TableId(value="id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description ="会员id")
|
||||
private Long memberId;
|
||||
|
||||
|
||||
@Schema(description ="余额")
|
||||
private BigDecimal moneyBalance;
|
||||
|
||||
|
||||
@Schema(description ="变动前余额")
|
||||
private BigDecimal beforeBalance;
|
||||
|
||||
@Schema(description ="变动后余额")
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
|
||||
@Schema(description ="变动金额")
|
||||
|
||||
@Excel(name = "变动金额")
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
@Schema(description ="变动类型")
|
||||
private Integer changeType;
|
||||
|
||||
@Schema(description ="变动描述")
|
||||
private String changeDesc;
|
||||
|
||||
@Schema(description ="来源")
|
||||
private Integer source;
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -18,6 +19,7 @@ public class MemberCart extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description ="购物车表ID")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
@Schema(description ="0->失效;1->有效")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -18,6 +19,7 @@ public class MemberLoginInfo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description ="ID")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
@Schema(description ="会员手机号")
|
||||
|
@ -18,7 +18,7 @@ public class FeedbackVO {
|
||||
private Long id;
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
private Integer type;
|
||||
/** 具体说明 */
|
||||
@Excel(name = "具体说明")
|
||||
private String content;
|
||||
@ -47,12 +47,21 @@ public class FeedbackVO {
|
||||
@Excel(name = "反馈对象ID")
|
||||
private Long aimId;
|
||||
|
||||
@Schema(description ="反馈对象类型 0 会员 1 群组 2 评论 3 视频 4 聊天" )
|
||||
private Integer aimType;
|
||||
|
||||
|
||||
@Schema(description ="反馈对象")
|
||||
private Object aimObject;
|
||||
|
||||
@Schema(description ="反馈分类")
|
||||
private Long categroy;
|
||||
private Integer category;
|
||||
|
||||
@Schema(description ="会员ID")
|
||||
@Excel(name = "会员ID")
|
||||
private String memberId;
|
||||
private Long memberId;
|
||||
|
||||
private MemberVO member;
|
||||
|
||||
@Schema(description ="处理人")
|
||||
@Excel(name = "处理人")
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员账户表对象 ums_member_account
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Schema(description="会员账户变动记录")
|
||||
@Data
|
||||
public class MemberAccountChangeRecordVO extends BaseAudit {
|
||||
|
||||
private Long id;
|
||||
|
||||
@Schema(description ="MEMBER_ID")
|
||||
@TableId(value="member_id", type = IdType.ASSIGN_ID)
|
||||
private Long memberId;
|
||||
|
||||
|
||||
@Schema(description ="余额")
|
||||
@Excel(name = "余额")
|
||||
private BigDecimal moneyBalance;
|
||||
|
||||
|
||||
@Schema(description ="变动前余额")
|
||||
@Excel(name = "变动前余额")
|
||||
private BigDecimal beforeBalance;
|
||||
|
||||
@Schema(description ="变动后余额")
|
||||
@Excel(name = "变动后余额")
|
||||
private BigDecimal afterBalance;
|
||||
|
||||
|
||||
@Schema(description ="变动金额")
|
||||
|
||||
@Excel(name = "变动金额")
|
||||
private BigDecimal changeAmount;
|
||||
|
||||
@Schema(description ="变动类型")
|
||||
@Excel(name = "变动类型")
|
||||
private String changeType;
|
||||
|
||||
@Schema(description ="变动描述")
|
||||
@Excel(name = "变动描述")
|
||||
private String changeDesc;
|
||||
|
||||
@Schema(description ="来源")
|
||||
@Excel(name = "来源")
|
||||
private Integer source;
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
@ -20,8 +21,18 @@ public class MemberAccountVO {
|
||||
/** 历史总共积分 */
|
||||
@Excel(name = "历史总共积分")
|
||||
private BigDecimal totalIntegralBalance;
|
||||
/** 修改时间 */
|
||||
private LocalDateTime updateTime;
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(description ="余额")
|
||||
@Excel(name = "余额")
|
||||
private BigDecimal moneyBalance;
|
||||
|
||||
|
||||
@Schema(description ="钱包")
|
||||
@Excel(name = "钱包")
|
||||
private BigDecimal wallet;
|
||||
|
||||
@Schema(description ="营收")
|
||||
@Excel(name = "营收")
|
||||
private BigDecimal revenue;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import org.dromara.common.excel.annotation.Excel;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 会员信息 数据视图对象
|
||||
*
|
||||
@ -16,78 +17,124 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@Schema(description = "会员信息")
|
||||
public class MemberVO {
|
||||
/** ID */
|
||||
/** 会员唯一标识 ID */
|
||||
@Schema(description = "会员唯一标识 ID")
|
||||
private Long id;
|
||||
/** 昵称 */
|
||||
|
||||
/** 会员昵称 */
|
||||
@Excel(name = "昵称")
|
||||
@Schema(description = "会员昵称")
|
||||
private String nickname;
|
||||
/** 手机号 */
|
||||
|
||||
/** 会员手机号 */
|
||||
@Schema(description = "会员手机号")
|
||||
private String phone;
|
||||
/** 隐藏前三位后四位的手机号 */
|
||||
|
||||
/** 隐藏部分信息后的手机号(如:138****1234) */
|
||||
@Schema(description = "隐藏前三位后四位的手机号")
|
||||
private String phoneHidden;
|
||||
/** 用户备注 */
|
||||
|
||||
/** 用户备注信息 */
|
||||
@Excel(name = "用户备注")
|
||||
@Schema(description = "用户备注信息")
|
||||
private String mark;
|
||||
/** 帐号启用状态:0->禁用;1->启用 */
|
||||
|
||||
/** 帐号启用状态:0->禁用;1->启用 */
|
||||
@Excel(name = "帐号启用状态:0->禁用;1->启用")
|
||||
@Schema(description = "帐号启用状态:0->禁用;1->启用")
|
||||
private Integer status;
|
||||
/** 头像 */
|
||||
|
||||
/** 头像地址 */
|
||||
@Excel(name = "头像")
|
||||
@Schema(description = "头像地址")
|
||||
private String avatar;
|
||||
|
||||
/** 性别:0->未知;1->男;2->女 */
|
||||
@Excel(name = "性别:0->未知;1->男;2->女")
|
||||
@Schema(description = "性别:0->未知;1->男;2->女")
|
||||
private Integer gender;
|
||||
/** 用户所在城市 */
|
||||
|
||||
/** 用户所在城市名称 */
|
||||
@Excel(name = "用户所在城市")
|
||||
@Schema(description = "用户所在城市名称")
|
||||
private String city;
|
||||
/** 用户所在省份 */
|
||||
|
||||
/** 用户所在省份名称 */
|
||||
@Excel(name = "用户所在省份")
|
||||
@Schema(description = "用户所在省份名称")
|
||||
private String province;
|
||||
/** 用户所在国家 */
|
||||
|
||||
/** 用户所在国家名称 */
|
||||
@Excel(name = "用户所在国家")
|
||||
@Schema(description = "用户所在国家名称")
|
||||
private String country;
|
||||
/** 公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注 */
|
||||
|
||||
/** 公众号运营者对粉丝的备注 */
|
||||
@Excel(name = "公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注")
|
||||
@Schema(description = "公众号运营者对粉丝的备注")
|
||||
private String remark;
|
||||
/** 生日 */
|
||||
|
||||
/** 生日日期(格式:yyyy-MM-dd) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Schema(description = "生日日期(格式:yyyy-MM-dd)")
|
||||
private LocalDate birthday;
|
||||
/** 推广员id */
|
||||
|
||||
/** 推广员用户 ID */
|
||||
@Excel(name = "推广员id")
|
||||
@Schema(description = "推广员用户 ID")
|
||||
private Long spreadUid;
|
||||
/** 推广员关联时间 */
|
||||
|
||||
|
||||
@Excel(name = "推广员二维码")
|
||||
@Schema(description = "推广员二维码")
|
||||
private String spreadCode;
|
||||
|
||||
/** 推广员关联时间(格式:yyyy-MM-dd HH:mm:ss) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "推广员关联时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "推广员关联时间(格式:yyyy-MM-dd HH:mm:ss)")
|
||||
private LocalDateTime spreadTime;
|
||||
/** 等级 */
|
||||
|
||||
/** 会员等级 */
|
||||
@Excel(name = "等级")
|
||||
@Schema(description = "会员等级")
|
||||
private Integer level;
|
||||
|
||||
/** 用户剩余积分 */
|
||||
@Excel(name = "用户剩余积分")
|
||||
@Schema(description = "用户剩余积分")
|
||||
private BigDecimal integral;
|
||||
/** openId */
|
||||
|
||||
/** 微信 OpenID */
|
||||
@Excel(name = "openId")
|
||||
@Schema(description = "微信 OpenID")
|
||||
private String openId;
|
||||
|
||||
/** openId */
|
||||
/** 用户名 */
|
||||
@Excel(name = "userName")
|
||||
@Schema(description = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 视频数量 */
|
||||
@Schema(description = "视频数")
|
||||
@Excel(name = "视频数")
|
||||
private Integer vlogCount;
|
||||
|
||||
/** 粉丝数量 */
|
||||
@Schema(description = "粉丝数")
|
||||
@Excel(name = "粉丝数")
|
||||
private Integer fansCount;
|
||||
|
||||
/** 关注数量 */
|
||||
@Schema(description = "关注数")
|
||||
@Excel(name = "关注数")
|
||||
private Integer followCount;
|
||||
|
||||
/** 好友数量 */
|
||||
@Schema(description = "好友数")
|
||||
@Excel(name = "好友数")
|
||||
private Integer friendsCount;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.wzj.soopin.member.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 反馈对象类型枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum FeedbackAimTypeEnums {
|
||||
MEMBER(0, "会员"),
|
||||
GROUP(1, "群组"),
|
||||
COMMENT(2, "评论"),
|
||||
VIDEO(3, "视频"),
|
||||
CHAT(4, "聊天");
|
||||
private final int code;
|
||||
private final String message;
|
||||
FeedbackAimTypeEnums(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.wzj.soopin.member.enums;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 举报原因枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum FeedbackReasonEnums {
|
||||
|
||||
OTHER(0, "其他"),
|
||||
|
||||
ABUSE(1, "辱骂"),
|
||||
|
||||
VIOLATION(2, "违反社区 Guidelines"),
|
||||
|
||||
SPAM(3, "垃圾信息"),
|
||||
|
||||
HARASSMENT(4, "骚扰"),
|
||||
|
||||
INAPPROPRIATE_CONTENT(5, "不恰当内容"),
|
||||
|
||||
INAPPROPRIATE_USERNAME(6, "不恰当用户名"),
|
||||
|
||||
INAPPROPRIATE_PROFILE_PICTURE(7, "不恰当头像"),
|
||||
|
||||
INAPPROPRIATE_BACKGROUND_PICTURE(8, "不恰当背景");
|
||||
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
FeedbackReasonEnums(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccountChangeRecord;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员账户表Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface MemberAccountChangeRecordMapper extends BaseMapper<MemberAccountChangeRecord> {
|
||||
|
||||
}
|
@ -2,6 +2,11 @@ package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.vo.FeedbackVO;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface IFeedbackService extends IService<Feedback> {
|
||||
|
||||
FeedbackVO selectById(Serializable id);
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccountChangeRecord;
|
||||
|
||||
public interface IMemberAccountChangeRecordService extends IService<MemberAccountChangeRecord> {
|
||||
|
||||
}
|
@ -2,6 +2,9 @@ package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
|
||||
public interface IMemberAccountService extends IService<MemberAccount> {
|
||||
|
||||
MemberAccount getMemberAccount(Long memberId);
|
||||
}
|
||||
|
@ -1,16 +1,23 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.domain.form.ChangeMemberStatusForm;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.vo.MemberVO;
|
||||
import org.dromara.common.core.constant.ResultCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IMemberService extends IService<Member> {
|
||||
Integer changeStatus(ChangeMemberStatusForm dto);
|
||||
|
||||
int updateMark(Member member);
|
||||
|
||||
|
||||
|
||||
|
||||
Integer changeStatus(MemberBO dto);
|
||||
|
||||
int updateMark(MemberBO member);
|
||||
|
||||
boolean usernameExists(String username); // 确保这个方法在接口中定义
|
||||
|
||||
|
@ -4,25 +4,44 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.convert.FeedbackConvert;
|
||||
import com.wzj.soopin.member.convert.MemberConvert;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.bo.FeedbackBO;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.vo.FeedbackVO;
|
||||
import com.wzj.soopin.member.mapper.FeedbackMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import com.wzj.soopin.member.service.IFeedbackService;
|
||||
import com.wzj.soopin.member.util.MemberCacheHelper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.common.redis.redis.RedisCache;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 意见反馈Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService {
|
||||
|
||||
|
||||
private final MemberMapper memberMapper;
|
||||
|
||||
private final MemberConvert memberConvert;
|
||||
|
||||
private final FeedbackConvert feedbackConvert;
|
||||
|
||||
private final MemberCacheHelper memberCacheHelper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询意见反馈列表
|
||||
@ -33,40 +52,38 @@ public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> i
|
||||
*/
|
||||
public IPage<Feedback> selectList(FeedbackBO query, IPage page) {
|
||||
|
||||
QueryWrapper<Feedback> qw = new QueryWrapper<>();
|
||||
String type = query.getType();
|
||||
if (!StringUtils.isEmpty(type)) {
|
||||
qw.eq("type", type);
|
||||
}
|
||||
String content = query.getContent();
|
||||
if (!StringUtils.isEmpty(content)) {
|
||||
qw.eq("content", content);
|
||||
}
|
||||
String images = query.getImages();
|
||||
if (!StringUtils.isEmpty(images)) {
|
||||
qw.eq("images", images);
|
||||
}
|
||||
String phone = query.getPhone();
|
||||
if (!StringUtils.isEmpty(phone)) {
|
||||
qw.eq("phone", phone);
|
||||
}
|
||||
Integer handleStatus = query.getHandleStatus();
|
||||
if (handleStatus != null) {
|
||||
qw.eq("handle_status", handleStatus);
|
||||
}
|
||||
LocalDateTime handleTime = query.getHandleTime();
|
||||
if (handleTime != null) {
|
||||
qw.eq("handle_time", handleTime);
|
||||
}
|
||||
if (!StringUtils.isEmpty(query.getBeginTime()) && !StringUtils.isEmpty(query.getEndTime())){
|
||||
qw.ge("create_time", query.getBeginTime());
|
||||
qw.lt("create_time", query.getEndTime());
|
||||
}
|
||||
qw.orderByDesc("id");
|
||||
return baseMapper.selectPage(page,qw);
|
||||
return baseMapper.selectPage(page, query.toWrapper());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FeedbackVO selectById(Serializable id) {
|
||||
Feedback feedback = super.getById(id);
|
||||
|
||||
if (feedback == null) {
|
||||
return null;
|
||||
}
|
||||
FeedbackVO vo = feedbackConvert.toVO(feedback);
|
||||
//判断是投诉对象是什么类型
|
||||
if (feedback.getAimType() != null) {
|
||||
// 如果是人员,则取人员信息
|
||||
// 0 会员 1 群组 2 评论 3 视频 4 聊天
|
||||
switch (feedback.getAimType()) {
|
||||
case 0:
|
||||
Member member = memberMapper.selectById(feedback.getAimId());
|
||||
vo.setAimObject(memberConvert.toVO(member));
|
||||
break;
|
||||
}
|
||||
// 如果是订单,则取订单信息
|
||||
// 如果是视频,则取视频信息
|
||||
}
|
||||
|
||||
|
||||
//从redis中获取用户信息
|
||||
Member memberInfo = memberCacheHelper.getMemberInfo(feedback.getMemberId());
|
||||
vo.setMember(memberConvert.toVO(memberInfo));
|
||||
return vo;
|
||||
}
|
||||
|
||||
public Integer updateMark(Feedback feedback) {
|
||||
UpdateWrapper<Feedback> updateWrapper = new UpdateWrapper<>();
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountBO;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccountChangeRecord;
|
||||
import com.wzj.soopin.member.mapper.MemberAccountChangeRecordMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberAccountMapper;
|
||||
import com.wzj.soopin.member.service.IMemberAccountChangeRecordService;
|
||||
import com.wzj.soopin.member.service.IMemberAccountService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员账户表Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberAccountChangeRecordServiceImpl extends
|
||||
ServiceImpl<MemberAccountChangeRecordMapper, MemberAccountChangeRecord> implements IMemberAccountChangeRecordService {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountBO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import com.wzj.soopin.member.mapper.MemberAccountMapper;
|
||||
import com.wzj.soopin.member.service.IMemberAccountService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -20,14 +21,10 @@ import java.math.BigDecimal;
|
||||
@Service
|
||||
public class MemberAccountServiceImpl extends ServiceImpl<MemberAccountMapper,MemberAccount> implements IMemberAccountService {
|
||||
|
||||
/**
|
||||
* 查询会员账户表
|
||||
*
|
||||
* @param memberId 会员账户表主键
|
||||
* @return 会员账户表
|
||||
*/
|
||||
public MemberAccount selectByMemberId(Long memberId) {
|
||||
return baseMapper.selectById(memberId);
|
||||
|
||||
@Override
|
||||
public MemberAccount getMemberAccount(Long memberId) {
|
||||
return baseMapper.selectOne(new QueryWrapper<MemberAccount>().lambda().eq(MemberAccount::getMemberId,memberId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,8 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.domain.form.ChangeMemberStatusForm;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.mapper.MemberAccountMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberCartMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import com.wzj.soopin.member.service.IMemberService;
|
||||
@ -45,11 +48,24 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper,Member> implemen
|
||||
|
||||
private final RedisCache redisCache;
|
||||
|
||||
private final MemberAccountMapper memberAccountMapper;
|
||||
|
||||
@Override
|
||||
public boolean usernameExists(String username) {
|
||||
return baseMapper.countByUsername(username) > 0; // 确保实现
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean save(Member entity) {
|
||||
super.save(entity);
|
||||
|
||||
MemberAccount account=MemberAccount.builder().memberId(entity.getId()).build();
|
||||
memberAccountMapper.insert(account);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Member findByUsername(String userName) {
|
||||
QueryWrapper<Member> queryWrapper = new QueryWrapper<>();
|
||||
@ -69,7 +85,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper,Member> implemen
|
||||
return true;
|
||||
}
|
||||
|
||||
public int updateMark(Member member) {
|
||||
public int updateMark(MemberBO member) {
|
||||
UpdateWrapper<Member> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("mark",member.getMark())
|
||||
.set("update_time",LocalDateTime.now())
|
||||
@ -79,10 +95,10 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper,Member> implemen
|
||||
|
||||
|
||||
|
||||
public Integer changeStatus(ChangeMemberStatusForm dto) {
|
||||
public Integer changeStatus(MemberBO bo) {
|
||||
UpdateWrapper<Member> wrapper = new UpdateWrapper<>();
|
||||
wrapper.eq("id", dto.getMemberId());
|
||||
wrapper.set("status", dto.getStatus());
|
||||
wrapper.eq("id", bo.getId());
|
||||
wrapper.set("status", bo.getStatus());
|
||||
return baseMapper.update(null, wrapper);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.wzj.soopin.member.util;
|
||||
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.redis.redis.RedisCache;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class MemberCacheHelper {
|
||||
|
||||
public static final String MEMBER_INFO_CACHE = "member:info:";
|
||||
|
||||
public static final String MEMBER_ACCOUNT_CACHE = "member:account:";
|
||||
|
||||
private final RedisCache redisCache;
|
||||
|
||||
private final MemberMapper memberMapper;
|
||||
|
||||
|
||||
public Member getMemberInfo(Long memberId) {
|
||||
Member member= redisCache.getCacheObject(MEMBER_INFO_CACHE + memberId);
|
||||
if(member==null){
|
||||
member=memberMapper.selectById(memberId);
|
||||
redisCache.setCacheObject(MEMBER_INFO_CACHE + memberId,member);
|
||||
}
|
||||
return member;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user