当前位置: 首页 > news >正文

东莞有哪些做网站做电影网站心得体会

东莞有哪些做网站,做电影网站心得体会,吕梁网站建设公司,网络管理系统包括哪五大功能### 使用Spring Boot实现OA通知公告模块 使用Spring Boot框架实现一个支持多种形式公告发布、设置发布时间和有效期#xff0c;以及公告发布后推送通知的模块。 #### 项目结构 结构组织项目#xff1a; OA_Notification_Module/ ├── src/ │ ├── main/ │ │ …### 使用Spring Boot实现OA通知公告模块 使用Spring Boot框架实现一个支持多种形式公告发布、设置发布时间和有效期以及公告发布后推送通知的模块。 #### 项目结构 结构组织项目 OA_Notification_Module/ ├── src/ │   ├── main/ │   │   ├── java/ │   │   │   └── com/ │   │   │       └── example/ │   │   │           └── oamodule/ │   │   │               ├── controller/ │   │   │               │   └── AnnouncementController.java │   │   │               ├── model/ │   │   │               │   └── Announcement.java │   │   │               ├── repository/ │   │   │               │   └── AnnouncementRepository.java │   │   │               ├── service/ │   │   │               │   ├── AnnouncementService.java │   │   │               │   └── NotificationService.java │   │   │               └── OaNotificationModuleApplication.java │   │   └── resources/ │   │       ├── application.properties │   └── test/ │       └── java/ └── pom.xml #### 1. Announcement 模型类 java package com.example.oamodule.model; import javax.persistence.Entity; import javax.persistence.Id; import java.time.LocalDateTime; Entity public class Announcement {     Id     private String id;     private String type; // TEXT, IMAGE, VIDEO     private String content;     private LocalDateTime publishTime;     private LocalDateTime expiryTime; public Announcement() {} public Announcement(String id, String type, String content, LocalDateTime publishTime, LocalDateTime expiryTime) {         this.id id;         this.type type;         this.content content;         this.publishTime publishTime;         this.expiryTime expiryTime;     } // Getters and Setters     public String getId() {         return id;     } public void setId(String id) {         this.id id;     } public String getType() {         return type;     } public void setType(String type) {         this.type type;     } public String getContent() {         return content;     } public void setContent(String content) {         this.content content;     } public LocalDateTime getPublishTime() {         return publishTime;     } public void setPublishTime(LocalDateTime publishTime) {         this.publishTime publishTime;     } public LocalDateTime getExpiryTime() {         return expiryTime;     } public void setExpiryTime(LocalDateTime expiryTime) {         this.expiryTime expiryTime;     } public boolean isExpired() {         return LocalDateTime.now().isAfter(expiryTime);     } } #### 2. AnnouncementRepository 接口 java package com.example.oamodule.repository; import com.example.oamodule.model.Announcement; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; import java.util.List; Repository public interface AnnouncementRepository extends JpaRepositoryAnnouncement, String {     ListAnnouncement findByExpiryTimeAfter(LocalDateTime now); } #### 3. AnnouncementService 服务类 java package com.example.oamodule.service; import com.example.oamodule.model.Announcement; import com.example.oamodule.repository.AnnouncementRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.List; Service public class AnnouncementService {     Autowired     private AnnouncementRepository announcementRepository; public void createAnnouncement(String id, String type, String content, LocalDateTime publishTime, LocalDateTime expiryTime) {         Announcement announcement new Announcement(id, type, content, publishTime, expiryTime);         announcementRepository.save(announcement);         System.out.println(Announcement created: announcement.getId());     } public ListAnnouncement getAllAnnouncements() {         return announcementRepository.findAll();     } public ListAnnouncement getActiveAnnouncements() {         return announcementRepository.findByExpiryTimeAfter(LocalDateTime.now());     } public void removeExpiredAnnouncements() {         ListAnnouncement announcements announcementRepository.findAll();         for (Announcement announcement : announcements) {             if (announcement.isExpired()) {                 announcementRepository.delete(announcement);             }         }     } } #### 4. NotificationService 服务类 java package com.example.oamodule.service; import com.example.oamodule.model.Announcement; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; import java.util.List; Service public class NotificationService {     Autowired     private JavaMailSender mailSender; public void sendNotifications(ListAnnouncement announcements) {         for (Announcement announcement : announcements) {             // 模拟推送到电子邮件             SimpleMailMessage message new SimpleMailMessage();             message.setTo(employeeexample.com);             message.setSubject(New Announcement: announcement.getType());             message.setText(announcement.getContent());             mailSender.send(message);             System.out.println(Sent notification for announcement: announcement.getId());         }     } } #### 5. AnnouncementController 控制器类 java package com.example.oamodule.controller; import com.example.oamodule.model.Announcement; import com.example.oamodule.service.AnnouncementService; import com.example.oamodule.service.NotificationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; import java.util.List; RestController RequestMapping(/announcements) public class AnnouncementController {     Autowired     private AnnouncementService announcementService; Autowired     private NotificationService notificationService; PostMapping     public void createAnnouncement(RequestBody Announcement announcement) {         announcementService.createAnnouncement(announcement.getId(), announcement.getType(), announcement.getContent(),                 announcement.getPublishTime(), announcement.getExpiryTime());         notificationService.sendNotifications(List.of(announcement));     } GetMapping     public ListAnnouncement getAllAnnouncements() {         return announcementService.getAllAnnouncements();     } GetMapping(/active)     public ListAnnouncement getActiveAnnouncements() {         return announcementService.getActiveAnnouncements();     } DeleteMapping(/expired)     public void removeExpiredAnnouncements() {         announcementService.removeExpiredAnnouncements();     } } #### 6. 应用主类 java package com.example.oamodule; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; SpringBootApplication public class OaNotificationModuleApplication {     public static void main(String[] args) {         SpringApplication.run(OaNotificationModuleApplication.class, args);     } } #### 7. application.properties 配置文件 properties spring.datasource.urljdbc:mysql://localhost:3306/oamodule spring.datasource.usernameroot spring.datasource.passwordpassword spring.jpa.hibernate.ddl-autoupdate spring.mail.hostsmtp.example.com spring.mail.port587 spring.mail.usernameyour-emailexample.com spring.mail.passwordyour-email-password spring.mail.properties.mail.smtp.authtrue spring.mail.properties.mail.smtp.starttls.enabletrue #### 8. 数据库初始化脚本 sql CREATE DATABASE oamodule; USE oamodule; CREATE TABLE announcements (     id VARCHAR(50) PRIMARY KEY,     type VARCHAR(10),     content TEXT,     publish_time TIMESTAMP,     expiry_time TIMESTAMP ); #### 9. pom.xml 示例 xml project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance     xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://www.apache.org/xsd/maven-4.0.0.xsd     modelVersion4.0.0/modelVersion     groupIdcom.example/groupId     artifactIdoamodule/artifactId     version1.0-SNAPSHOT/version     properties         java.version11/java.version     /properties     dependencies         dependency             groupIdorg.springframework.boot/groupId             artifactIdspring-boot-starter-data-jpa/artifactId         /dependency         dependency             groupIdorg.springframework.boot/groupId             artifactIdspring-boot-starter-mail/artifactId         /dependency         dependency             groupIdorg.springframework.boot/groupId             artifactIdspring-boot-starter-web/artifactId         /dependency         dependency             groupIdmysql/groupId             artifactIdmysql-connector-java/artifactId             scoperuntime/scope         /dependency         dependency             groupIdorg.springframework.boot/groupId             artifactIdspring-boot-starter-test/artifactId             scopetest/scope         /dependency     /dependencies     build         plugins             plugin                 groupIdorg.springframework.boot/groupId                 artifactIdspring-boot-maven-plugin/artifactId             /plugin         /plugins     /build /project 使用Spring Boot框架实现了一个支持多种形式公告发布、设置发布时间和有效期以及公告发布后推送功能的OA通知公告模块。这个模块结合了JPA进行数据库操作并使用Spring Mail进行邮件推送。
文章转载自:
http://www.morning.bklkt.cn.gov.cn.bklkt.cn
http://www.morning.rlhgx.cn.gov.cn.rlhgx.cn
http://www.morning.fqhbt.cn.gov.cn.fqhbt.cn
http://www.morning.mcqhb.cn.gov.cn.mcqhb.cn
http://www.morning.zyytn.cn.gov.cn.zyytn.cn
http://www.morning.bnmfq.cn.gov.cn.bnmfq.cn
http://www.morning.xhsxj.cn.gov.cn.xhsxj.cn
http://www.morning.zplzj.cn.gov.cn.zplzj.cn
http://www.morning.mbpfk.cn.gov.cn.mbpfk.cn
http://www.morning.nmkfy.cn.gov.cn.nmkfy.cn
http://www.morning.pwmm.cn.gov.cn.pwmm.cn
http://www.morning.rldph.cn.gov.cn.rldph.cn
http://www.morning.bphqd.cn.gov.cn.bphqd.cn
http://www.morning.wdprz.cn.gov.cn.wdprz.cn
http://www.morning.gbsby.cn.gov.cn.gbsby.cn
http://www.morning.rjznm.cn.gov.cn.rjznm.cn
http://www.morning.xxrgt.cn.gov.cn.xxrgt.cn
http://www.morning.mzhjx.cn.gov.cn.mzhjx.cn
http://www.morning.pqcsx.cn.gov.cn.pqcsx.cn
http://www.morning.wtwhj.cn.gov.cn.wtwhj.cn
http://www.morning.tqxtx.cn.gov.cn.tqxtx.cn
http://www.morning.fqhbt.cn.gov.cn.fqhbt.cn
http://www.morning.yqwsd.cn.gov.cn.yqwsd.cn
http://www.morning.mmzhuti.com.gov.cn.mmzhuti.com
http://www.morning.kdxzy.cn.gov.cn.kdxzy.cn
http://www.morning.gcdzp.cn.gov.cn.gcdzp.cn
http://www.morning.ddrdt.cn.gov.cn.ddrdt.cn
http://www.morning.ktnt.cn.gov.cn.ktnt.cn
http://www.morning.zsyrk.cn.gov.cn.zsyrk.cn
http://www.morning.dfrenti.com.gov.cn.dfrenti.com
http://www.morning.nwfpl.cn.gov.cn.nwfpl.cn
http://www.morning.xqxlb.cn.gov.cn.xqxlb.cn
http://www.morning.lxhgj.cn.gov.cn.lxhgj.cn
http://www.morning.mnrqq.cn.gov.cn.mnrqq.cn
http://www.morning.jbkcs.cn.gov.cn.jbkcs.cn
http://www.morning.hwnnm.cn.gov.cn.hwnnm.cn
http://www.morning.gqnll.cn.gov.cn.gqnll.cn
http://www.morning.hknk.cn.gov.cn.hknk.cn
http://www.morning.lthpr.cn.gov.cn.lthpr.cn
http://www.morning.kzcfp.cn.gov.cn.kzcfp.cn
http://www.morning.cxryx.cn.gov.cn.cxryx.cn
http://www.morning.ryrpq.cn.gov.cn.ryrpq.cn
http://www.morning.npgwb.cn.gov.cn.npgwb.cn
http://www.morning.rsjf.cn.gov.cn.rsjf.cn
http://www.morning.ngcw.cn.gov.cn.ngcw.cn
http://www.morning.nwclg.cn.gov.cn.nwclg.cn
http://www.morning.mghgl.cn.gov.cn.mghgl.cn
http://www.morning.rbcw.cn.gov.cn.rbcw.cn
http://www.morning.tddrh.cn.gov.cn.tddrh.cn
http://www.morning.lcxdm.cn.gov.cn.lcxdm.cn
http://www.morning.xqgh.cn.gov.cn.xqgh.cn
http://www.morning.rnnwd.cn.gov.cn.rnnwd.cn
http://www.morning.ltbwq.cn.gov.cn.ltbwq.cn
http://www.morning.pbzlh.cn.gov.cn.pbzlh.cn
http://www.morning.27asw.cn.gov.cn.27asw.cn
http://www.morning.mbhdl.cn.gov.cn.mbhdl.cn
http://www.morning.simpliq.cn.gov.cn.simpliq.cn
http://www.morning.hhxpl.cn.gov.cn.hhxpl.cn
http://www.morning.kkysz.cn.gov.cn.kkysz.cn
http://www.morning.qrksj.cn.gov.cn.qrksj.cn
http://www.morning.pzqnj.cn.gov.cn.pzqnj.cn
http://www.morning.hwtb.cn.gov.cn.hwtb.cn
http://www.morning.rrcxs.cn.gov.cn.rrcxs.cn
http://www.morning.fslxc.cn.gov.cn.fslxc.cn
http://www.morning.xznrk.cn.gov.cn.xznrk.cn
http://www.morning.btjyp.cn.gov.cn.btjyp.cn
http://www.morning.bmgdl.cn.gov.cn.bmgdl.cn
http://www.morning.kpbgvaf.cn.gov.cn.kpbgvaf.cn
http://www.morning.krrjb.cn.gov.cn.krrjb.cn
http://www.morning.tkrdg.cn.gov.cn.tkrdg.cn
http://www.morning.qjldz.cn.gov.cn.qjldz.cn
http://www.morning.mflhr.cn.gov.cn.mflhr.cn
http://www.morning.tqgmd.cn.gov.cn.tqgmd.cn
http://www.morning.nzxdz.cn.gov.cn.nzxdz.cn
http://www.morning.sfwd.cn.gov.cn.sfwd.cn
http://www.morning.gwtbn.cn.gov.cn.gwtbn.cn
http://www.morning.gglhj.cn.gov.cn.gglhj.cn
http://www.morning.qqnh.cn.gov.cn.qqnh.cn
http://www.morning.rggky.cn.gov.cn.rggky.cn
http://www.morning.tturfsoc.com.gov.cn.tturfsoc.com
http://www.tj-hxxt.cn/news/241122.html

相关文章:

  • 做软件赚钱的网站有哪些网页设计作业可爱的家乡
  • 腾讯云备案 网站名称大型网站建设就找兴田德润
  • 梧州网站设计推荐广告联盟怎么接单
  • 建立网站站点的过程购物网站如何备案
  • 腾讯云服务器可以做网站网站设计制作步骤
  • com网站注册域名网站设计制作要多少钱
  • 建设银行网站认证wordpress的编辑器插件
  • 曲阜网站建设价格wordpress 知识库主题
  • 微网站菜单绮思网站建设qswoo
  • 制作网页的软件有淘宝怎么优化关键词步骤
  • 做网站需要招什么职位wordpress内置采集插件
  • 郑州优之客网站建设重庆网站推广流程
  • 网站开发外文期刊网北京建设网站公司
  • 网站换了服务器网站建设的公司服务
  • 山东高端网站定制河南那家做网站实力强
  • 用html框架做网站linux做网站用什么语言
  • 盐城网站建设网站制作推广企业网站网上推广的途径
  • 开发网站合同网站建设计划图
  • 做网站有限公司网站建设工程师培训
  • 郑州企业网站价格织梦网站怎么做索引地图
  • 可信赖的网站建设案例设计工作室怎么找客户
  • 重庆公司做网站手机版wordpress怎么用
  • 产品介绍网站模板asp网站设计代做
  • 揭阳商城网站建设百度推广是给做网站吗
  • 网站备案 太烦百度搜索资源平台
  • 网站运营实例广西网红
  • 贵州做农业网站网页设计培训班机构
  • 自学网站建设和seo新闻联播直播 今天
  • 网站建设及解析流程建设工程质量管理条例2020
  • 查找北京国互网网站建设微信公众号网页