Browse Source

add notice title

Mr.qian 2 weeks ago
parent
commit
3cd4c1c9da

+ 1 - 3
mall-service/src/main/java/com/txz/mall/controller/NoticeController.java

@@ -12,7 +12,6 @@ import com.txz.mall.service.OtherNoticeService;
 import com.txz.mall.web.param.BasePageParam;
 import com.txz.mall.web.param.BasePageParam;
 import com.txz.mall.web.ro.OtherNoticeRO;
 import com.txz.mall.web.ro.OtherNoticeRO;
 import com.txz.mall.web.ro.SendNoticeRO;
 import com.txz.mall.web.ro.SendNoticeRO;
-import dto.NoticeDTO;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -107,8 +106,7 @@ public class NoticeController {
         if (ObjectUtil.isEmpty(info)) {
         if (ObjectUtil.isEmpty(info)) {
             return Result.fail("数据不存在");
             return Result.fail("数据不存在");
         }
         }
-        NoticeDTO dto = BeanUtil.copyProperties(info, NoticeDTO.class);
-        noticeService.addNotice(dto, ro.getUids().stream().toArray(Long[]::new));
+        noticeService.addOtherNotice(info.getId(), info.getTitle(), info.getMessage(), info.getPages(), ro.getUids().stream().toArray(Long[]::new));
         return Result.success();
         return Result.success();
     }
     }
     
     

+ 5 - 0
mall-service/src/main/java/com/txz/mall/model/Notice.java

@@ -42,6 +42,11 @@ public class Notice extends Model<Notice> {
      */
      */
     private Long otherId;
     private Long otherId;
     
     
+    /**
+     * 通知标题
+     */
+    private String noticeTitle;
+    
     /**
     /**
      * 通知内容 模板类型是订单号,其他类型完整展示内容
      * 通知内容 模板类型是订单号,其他类型完整展示内容
      */
      */

+ 1 - 1
mall-service/src/main/java/com/txz/mall/service/NoticeService.java

@@ -20,7 +20,7 @@ public interface NoticeService extends IService<Notice> {
     /**
     /**
      * 添加自定义消息
      * 添加自定义消息
      */
      */
-    void addOtherNotice(Long otherId, String noticeMessage, String pages, Long... uids);
+    void addOtherNotice(Long otherId, String noticeTitle, String noticeMessage, String pages, Long... uids);
     
     
     /**
     /**
      * 添加订单通知
      * 添加订单通知

+ 2 - 1
mall-service/src/main/java/com/txz/mall/service/impl/NoticeServiceImpl.java

@@ -40,10 +40,11 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
     }
     }
     
     
     @Override
     @Override
-    public void addOtherNotice(Long otherId, String noticeMessage, String pages, Long... uids) {
+    public void addOtherNotice(Long otherId, String noticeTitle, String noticeMessage, String pages, Long... uids) {
         this.addNotice(NoticeDTO.builder()
         this.addNotice(NoticeDTO.builder()
                         .noticeType(NoticeEnum.OTHER)
                         .noticeType(NoticeEnum.OTHER)
                         .otherId(otherId)
                         .otherId(otherId)
+                        .noticeTitle(noticeTitle)
                         .noticeMessage(noticeMessage)
                         .noticeMessage(noticeMessage)
                         .pages(pages)
                         .pages(pages)
                         .build()
                         .build()

+ 7 - 0
mall-service/src/main/java/dto/NoticeDTO.java

@@ -22,6 +22,13 @@ public class NoticeDTO {
      */
      */
     private Long otherId;
     private Long otherId;
     
     
+    /**
+     * 通知内容
+     * 订单相关的传订单号
+     * 自定义传 自定义字符串
+     */
+    private String noticeTitle;
+    
     /**
     /**
      * 通知内容
      * 通知内容
      * 订单相关的传订单号
      * 订单相关的传订单号