用户消息通知
This commit is contained in:
57
doc/sql/prod_update/20260209_increase.sql
Normal file
57
doc/sql/prod_update/20260209_increase.sql
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
DROP TABLE IF EXISTS user_notice;
|
||||
CREATE TABLE user_notice
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY, -- 主键
|
||||
user_id int8 DEFAULT 0 NOT NULL, -- 用户id
|
||||
notice_type int4 DEFAULT 0 NOT NULL, -- 通知类型 0-系统通知 1-app通知 2-market通知
|
||||
has_read int4 DEFAULT 0 NOT NULL, -- 是否已读 0-否 1-是
|
||||
release_time timestamp(6) NULL, -- 阅读时间
|
||||
title VARCHAR(100) NULL, -- 标题
|
||||
content TEXT NULL, -- 内容
|
||||
remarks varchar(200) NULL, -- 备注
|
||||
create_user int8 NULL, -- 创建人
|
||||
create_dept int8 NULL, -- 创建部门
|
||||
create_time timestamp(6) NULL, -- 创建时间
|
||||
update_user int8 NULL, -- 修改人
|
||||
update_time timestamp(6) NULL, -- 修改时间
|
||||
status int4 NULL, -- 状态
|
||||
is_deleted int4 DEFAULT 0 NULL -- 是否已删除
|
||||
);
|
||||
|
||||
COMMENT ON TABLE user_notice IS '用户通知';
|
||||
COMMENT ON COLUMN user_notice.id IS '主键';
|
||||
COMMENT ON COLUMN user_notice.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_notice.notice_type IS '通知类型 0-系统通知 1-app通知 2-market通知';
|
||||
COMMENT ON COLUMN user_notice.has_read IS '是否已读 0-否 1-是';
|
||||
COMMENT ON COLUMN user_notice.release_time IS '阅读时间';
|
||||
COMMENT ON COLUMN user_notice.title IS '标题';
|
||||
COMMENT ON COLUMN user_notice.content IS '内容';
|
||||
COMMENT ON COLUMN user_notice.remarks IS '备注';
|
||||
COMMENT ON COLUMN user_notice.create_user IS '创建人';
|
||||
COMMENT ON COLUMN user_notice.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN user_notice.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN user_notice.update_user IS '修改人';
|
||||
COMMENT ON COLUMN user_notice.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN user_notice.status IS '状态';
|
||||
COMMENT ON COLUMN user_notice.is_deleted IS '是否已删除';
|
||||
|
||||
CREATE INDEX CONCURRENTLY idx_user_notice_opt ON user_notice (user_id, has_read ASC, create_time DESC, notice_type) WHERE is_deleted = 0;
|
||||
|
||||
CREATE INDEX CONCURRENTLY idx_user_notice_count ON user_notice (user_id, notice_type, has_read) WHERE is_deleted = 0;
|
||||
|
||||
alter table user_notice owner to yicha1lu;
|
||||
|
||||
---- 后台页面菜单
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2016444412729917441, 0, 'customer', '用户配置', 'menu', '/customer', 'iconfont iconicon_subordinate', 9, 1, -1, 1, '', '', 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787265, 2016444412729917441, 'userNotice', '用户通知', 'menu', '/customer/userNotice', null, 1, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787266, 2020763647899787265, 'userNotice_add', '新增', 'add', '/customer/userNotice/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787267, 2020763647899787265, 'userNotice_edit', '修改', 'edit', '/customer/userNotice/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787268, 2020763647899787265, 'userNotice_delete', '删除', 'delete', '/api/blade-usernotice/userNotice/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787269, 2020763647899787265, 'userNotice_view', '查看', 'view', '/customer/userNotice/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
|
||||
--- 后台系统参数-字典
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766458167353346, 0, 'app_notice_type', '-1', 'app通知类型', 28, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766503033823233, 2020766458167353346, 'app_notice_type', '0', '系统通知', 0, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766543760515074, 2020766458167353346, 'app_notice_type', '1', 'app通知', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766604569534466, 2020766458167353346, 'app_notice_type', '2', 'market通知', 2, '', 0, 1, 0);
|
||||
@@ -10,13 +10,16 @@ import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.request.AppUserNoticeRequest;
|
||||
import org.springblade.modules.api.request.CreateOrderRequest;
|
||||
import org.springblade.modules.api.request.PaymentRequest;
|
||||
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||
import org.springblade.modules.api.response.PaymentResponse;
|
||||
import org.springblade.modules.api.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderApiVO;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserAddressVO;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
import org.springblade.modules.customer.service.IUserNoticeService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -33,6 +36,8 @@ public class APPUserController {
|
||||
|
||||
private final ICommonUserOrderService orderService;
|
||||
|
||||
private final IUserNoticeService userNoticeService;
|
||||
|
||||
|
||||
/**
|
||||
* 是否修改过密码
|
||||
@@ -95,4 +100,31 @@ public class APPUserController {
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/app-notice-page")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户消息列表", description = "传入userNoticeVO")
|
||||
public R<IPage<AppUserNoticeVO>> appUserNoticeList(Query query) {
|
||||
IPage<AppUserNoticeVO> pages = userNoticeService.selectAppUserNoticeApiPage(Condition.getPage(query));
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
@GetMapping("/app-notread-notice-num")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户未读消息数量")
|
||||
public R<Integer> appNotReadNoticeNum() {
|
||||
return R.data(userNoticeService.appNotReadNoticeNum());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/app-read-notice")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户读取消息", description = "传入request")
|
||||
public R<Boolean> appUserReadNotice(@RequestBody AppUserNoticeRequest request) {
|
||||
return R.status(userNoticeService.appUserReadNotice(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,13 +11,14 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.api.request.AppUserNoticeRequest;
|
||||
import org.springblade.modules.api.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.customer.service.IUserNoticeService;
|
||||
import org.springblade.modules.market.manager.MarketUserManager;
|
||||
import org.springblade.modules.api.vo.MarketBenefitPackageVO;
|
||||
import org.springblade.modules.api.vo.MarketDirectInfoVO;
|
||||
import org.springblade.modules.userPackage.service.IUserMarketBenefitPackageService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,6 +31,7 @@ public class MarketUserController {
|
||||
|
||||
private final IUserMarketBenefitPackageService userMarketBenefitPackageService;
|
||||
private final MarketUserManager marketUserManager;
|
||||
private final IUserNoticeService userNoticeService;
|
||||
|
||||
|
||||
@GetMapping("/find-user-benefit-pack-list")
|
||||
@@ -58,6 +60,29 @@ public class MarketUserController {
|
||||
|
||||
|
||||
|
||||
@GetMapping("/market-notice-page")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户消息列表", description = "传入userNoticeVO")
|
||||
public R<IPage<AppUserNoticeVO>> marketUserNoticeList( Query query) {
|
||||
IPage<AppUserNoticeVO> pages = userNoticeService.selectMarketUserNoticeApiPage(Condition.getPage(query));
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
@GetMapping("/market-notread-notice-num")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户未读消息数量")
|
||||
public R<Integer> marketNotReadNoticeNum() {
|
||||
return R.data(userNoticeService.marketNotReadNoticeNum());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/market-read-notice")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "用户读取消息", description = "传入request")
|
||||
public R<Boolean> marketUserReadNotice(@RequestBody AppUserNoticeRequest request) {
|
||||
return R.status(userNoticeService.marketUserReadNotice(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
|
||||
@Accessors(chain = true)
|
||||
public class AppUserNoticeRequest implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
|
||||
@Accessors(chain = true)
|
||||
public class AppUserNoticeVO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 通知类型 0-系统通知 1-app通知 2-market通知
|
||||
*/
|
||||
private Integer noticeType;
|
||||
/**
|
||||
* 是否已读 0-否 1-是
|
||||
*/
|
||||
private Integer hasRead;
|
||||
/**
|
||||
* 阅读时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date releaseTime;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
|
||||
import org.springblade.modules.customer.wrapper.UserNoticeWrapper;
|
||||
import org.springblade.modules.customer.service.IUserNoticeService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 用户通知 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-usernotice/userNotice")
|
||||
@Tag(name = "用户通知", description = "用户通知接口")
|
||||
public class UserNoticeController extends BladeController {
|
||||
|
||||
private final IUserNoticeService userNoticeService;
|
||||
|
||||
/**
|
||||
* 用户通知 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入userNotice")
|
||||
public R<UserNoticeVO> detail(UserNoticeEntity userNotice) {
|
||||
UserNoticeEntity detail = userNoticeService.getOne(Condition.getQueryWrapper(userNotice));
|
||||
return R.data(UserNoticeWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户通知 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入userNotice")
|
||||
public R<IPage<UserNoticeVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> userNotice, Query query) {
|
||||
IPage<UserNoticeEntity> pages = userNoticeService.page(Condition.getPage(query), Condition.getQueryWrapper(userNotice, UserNoticeEntity.class));
|
||||
return R.data(UserNoticeWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入userNotice")
|
||||
public R<IPage<UserNoticeVO>> page(UserNoticeVO userNotice, Query query) {
|
||||
IPage<UserNoticeVO> pages = userNoticeService.selectUserNoticePage(Condition.getPage(query), userNotice);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入userNotice")
|
||||
public R save(@Valid @RequestBody UserNoticeVO userNotice) {
|
||||
return R.status(userNoticeService.saveUserNotice(userNotice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入userNotice")
|
||||
public R update(@Valid @RequestBody UserNoticeEntity userNotice) {
|
||||
return R.status(userNoticeService.updateById(userNotice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入userNotice")
|
||||
public R submit(@Valid @RequestBody UserNoticeEntity userNotice) {
|
||||
return R.status(userNoticeService.saveOrUpdate(userNotice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户通知 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(userNoticeService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.springblade.modules.customer.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.api.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface AppUserNoticeConvert {
|
||||
|
||||
AppUserNoticeConvert INSTANCE = Mappers.getMapper(AppUserNoticeConvert.class);
|
||||
|
||||
|
||||
AppUserNoticeVO convertNoticeEntityToVO(UserNoticeEntity userNoticeEntity);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.mapper;
|
||||
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户通知 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
public interface UserNoticeMapper extends BaseMapper<UserNoticeEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userNotice 查询参数
|
||||
* @return List<UserNoticeVO>
|
||||
*/
|
||||
List<UserNoticeVO> selectUserNoticePage(IPage page, UserNoticeVO userNotice);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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="org.springblade.modules.customer.mapper.UserNoticeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="userNoticeResultMap" type="org.springblade.modules.customer.pojo.entity.UserNoticeEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="notice_type" property="noticeType"/>
|
||||
<result column="has_read" property="hasRead"/>
|
||||
<result column="release_time" property="releaseTime"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectUserNoticePage" resultMap="userNoticeResultMap">
|
||||
select * from user_notice where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.pojo.dto;
|
||||
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户通知 数据传输对象实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserNoticeDTO extends UserNoticeEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import org.springblade.core.tenant.mp.TenantEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户通知 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_notice")
|
||||
@Schema(description = "UserNotice对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class UserNoticeEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 通知类型 0-系统通知 1-app通知 2-market通知
|
||||
*/
|
||||
@Schema(description = "通知类型 0-系统通知 1-app通知 2-market通知")
|
||||
private Integer noticeType;
|
||||
/**
|
||||
* 是否已读 0-否 1-是
|
||||
*/
|
||||
@Schema(description = "是否已读 0-否 1-是")
|
||||
private Integer hasRead;
|
||||
/**
|
||||
* 阅读时间
|
||||
*/
|
||||
@Schema(description = "阅读时间")
|
||||
private Date releaseTime;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.pojo.vo;
|
||||
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户通知 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserNoticeVO extends UserNoticeEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer noticeRange;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.service;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springblade.modules.api.request.AppUserNoticeRequest;
|
||||
import org.springblade.modules.api.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户通知 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
public interface IUserNoticeService extends BaseService<UserNoticeEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param userNotice 查询参数
|
||||
* @return IPage<UserNoticeVO>
|
||||
*/
|
||||
IPage<UserNoticeVO> selectUserNoticePage(IPage<UserNoticeVO> page, UserNoticeVO userNotice);
|
||||
|
||||
|
||||
boolean saveUserNotice(@Valid UserNoticeVO userNotice);
|
||||
|
||||
IPage<AppUserNoticeVO> selectAppUserNoticeApiPage(IPage<UserNoticeEntity> page);
|
||||
|
||||
Integer appNotReadNoticeNum();
|
||||
|
||||
boolean appUserReadNotice(AppUserNoticeRequest request);
|
||||
|
||||
|
||||
|
||||
IPage<AppUserNoticeVO> selectMarketUserNoticeApiPage(IPage<UserNoticeEntity> page);
|
||||
|
||||
|
||||
|
||||
Integer marketNotReadNoticeNum();
|
||||
|
||||
boolean marketUserReadNotice(AppUserNoticeRequest request);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.api.request.AppUserNoticeRequest;
|
||||
import org.springblade.modules.api.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.customer.convert.AppUserNoticeConvert;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
|
||||
import org.springblade.modules.customer.mapper.UserNoticeMapper;
|
||||
import org.springblade.modules.customer.service.IUserNoticeService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户通知 服务实现类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, UserNoticeEntity> implements IUserNoticeService {
|
||||
private final IUserService userService;
|
||||
private final static long PAGE_SIZE = 1000L;
|
||||
|
||||
@Override
|
||||
public IPage<UserNoticeVO> selectUserNoticePage(IPage<UserNoticeVO> page, UserNoticeVO userNotice) {
|
||||
return page.setRecords(baseMapper.selectUserNoticePage(page, userNotice));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
@Override
|
||||
public boolean saveUserNotice(UserNoticeVO userNotice) {
|
||||
Assert.notNull(userNotice.getNoticeType(), "通知类型不能为空");
|
||||
Assert.notNull(userNotice.getTitle(), "标题不能为空");
|
||||
Assert.notNull(userNotice.getContent(), "内容不能为空");
|
||||
if (userNotice.getNoticeRange() == 0){
|
||||
|
||||
User user = userService.getById(userNotice.getUserId());
|
||||
Assert.notNull(user , "用户不存在");
|
||||
return save(
|
||||
new UserNoticeEntity()
|
||||
.setUserId(userNotice.getUserId())
|
||||
.setTitle(userNotice.getTitle())
|
||||
.setContent(userNotice.getContent())
|
||||
.setNoticeType(userNotice.getNoticeType())
|
||||
.setHasRead(0)
|
||||
);
|
||||
}else if (userNotice.getNoticeRange() == 1){
|
||||
|
||||
long count = userService.count(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getUserType, 2)
|
||||
);
|
||||
|
||||
// 向上取整
|
||||
long pageNun = (count + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
|
||||
List<UserNoticeEntity> noticeList = new ArrayList<>();
|
||||
for (int i = 0; i < pageNun; i++) {
|
||||
List<Long> userIdList = userService.list(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getUserType, 2)
|
||||
.last("limit " + PAGE_SIZE + " offset " + i * PAGE_SIZE)
|
||||
).stream().map(User::getId).toList();
|
||||
|
||||
|
||||
userIdList.forEach(userId -> {
|
||||
noticeList.add(
|
||||
new UserNoticeEntity()
|
||||
.setUserId(userId)
|
||||
.setTitle(userNotice.getTitle())
|
||||
.setContent(userNotice.getContent())
|
||||
.setNoticeType(userNotice.getNoticeType())
|
||||
.setHasRead(0)
|
||||
);
|
||||
});
|
||||
if (!saveBatch(noticeList)){
|
||||
throw new RuntimeException("批量保存用户通知失败");
|
||||
}else {
|
||||
noticeList.clear();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
throw new RuntimeException("通知范围错误");
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<AppUserNoticeVO> selectAppUserNoticeApiPage(IPage<UserNoticeEntity> page) {
|
||||
IPage<UserNoticeEntity> noticeEntityIPage = page(
|
||||
page,
|
||||
Wrappers.lambdaQuery(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getUserId, AuthUtil.getUserId())
|
||||
.in(UserNoticeEntity::getNoticeType, List.of(0, 1))
|
||||
.orderByAsc(UserNoticeEntity::getHasRead)
|
||||
.orderByDesc(UserNoticeEntity::getCreateTime)
|
||||
|
||||
);
|
||||
return noticeEntityIPage.convert(AppUserNoticeConvert.INSTANCE::convertNoticeEntityToVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer appNotReadNoticeNum() {
|
||||
long count = count(
|
||||
Wrappers.lambdaQuery(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getUserId, AuthUtil.getUserId())
|
||||
.eq(UserNoticeEntity::getHasRead, 0)
|
||||
.in(UserNoticeEntity::getNoticeType, List.of(0, 1))
|
||||
|
||||
);
|
||||
return Math.toIntExact(count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appUserReadNotice(AppUserNoticeRequest request) {
|
||||
|
||||
UserNoticeEntity userNotice = getById(request.getId());
|
||||
Assert.notNull(userNotice, "通知不存在");
|
||||
Assert.isTrue(Objects.equals(userNotice.getUserId(), AuthUtil.getUserId()), "无权限阅读其他用户消息");
|
||||
Assert.isTrue(Objects.equals(userNotice.getNoticeType(), 0) || Objects.equals(userNotice.getNoticeType(), 1), "无效消息类型");
|
||||
Assert.isTrue(Objects.equals(userNotice.getHasRead(), 0), "消息已读");
|
||||
return update(
|
||||
Wrappers.lambdaUpdate(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getId, request.getId())
|
||||
.set(UserNoticeEntity::getHasRead, 1)
|
||||
.set(UserNoticeEntity::getReleaseTime, new Date())
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<AppUserNoticeVO> selectMarketUserNoticeApiPage(IPage<UserNoticeEntity> page) {
|
||||
IPage<UserNoticeEntity> noticeEntityIPage = page(
|
||||
page,
|
||||
Wrappers.lambdaQuery(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getUserId, AuthUtil.getUserId())
|
||||
.in(UserNoticeEntity::getNoticeType, List.of(1 , 2))
|
||||
.orderByAsc(UserNoticeEntity::getHasRead)
|
||||
.orderByDesc(UserNoticeEntity::getCreateTime)
|
||||
|
||||
);
|
||||
return noticeEntityIPage.convert(AppUserNoticeConvert.INSTANCE::convertNoticeEntityToVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer marketNotReadNoticeNum() {
|
||||
long count = count(
|
||||
Wrappers.lambdaQuery(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getUserId, AuthUtil.getUserId())
|
||||
.eq(UserNoticeEntity::getHasRead, 0)
|
||||
.in(UserNoticeEntity::getNoticeType, List.of(1 ,2))
|
||||
|
||||
);
|
||||
return Math.toIntExact(count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean marketUserReadNotice(AppUserNoticeRequest request) {
|
||||
UserNoticeEntity userNotice = getById(request.getId());
|
||||
Assert.notNull(userNotice, "通知不存在");
|
||||
Assert.isTrue(Objects.equals(userNotice.getUserId(), AuthUtil.getUserId()), "无权限阅读其他用户消息");
|
||||
Assert.isTrue(Objects.equals(userNotice.getNoticeType(), 1) || Objects.equals(userNotice.getNoticeType(), 2), "无效消息类型");
|
||||
Assert.isTrue(Objects.equals(userNotice.getHasRead(), 0), "消息已读");
|
||||
return update(
|
||||
Wrappers.lambdaUpdate(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getId, request.getId())
|
||||
.set(UserNoticeEntity::getHasRead, 1)
|
||||
.set(UserNoticeEntity::getReleaseTime, new Date())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.customer.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.customer.pojo.vo.UserNoticeVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户通知 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-02-09
|
||||
*/
|
||||
public class UserNoticeWrapper extends BaseEntityWrapper<UserNoticeEntity, UserNoticeVO> {
|
||||
|
||||
public static UserNoticeWrapper build() {
|
||||
return new UserNoticeWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserNoticeVO entityVO(UserNoticeEntity userNotice) {
|
||||
UserNoticeVO userNoticeVO = Objects.requireNonNull(BeanUtil.copyProperties(userNotice, UserNoticeVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(userNotice.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(userNotice.getUpdateUser());
|
||||
//userNoticeVO.setCreateUserName(createUser.getName());
|
||||
//userNoticeVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return userNoticeVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user