diff --git a/w8-巫秋雨-202506050320/Article.java b/w8-巫秋雨-202506050320/Article.java new file mode 100644 index 0000000..15f1e90 --- /dev/null +++ b/w8-巫秋雨-202506050320/Article.java @@ -0,0 +1,77 @@ +package com.example.datacollect.model; + +import java.time.LocalDate; + +public class Article { + private String title; + private String url; + private String content; + + private String author; + private LocalDate publishDate; + + public Article(String title, String url, String content, String author, LocalDate publishDate) { + this.title = title; + this.url = url; + this.content = content; + this.author = author; + this.publishDate = publishDate; + } + + public Article(String title, String url, String content) { + this(title, url, content, "未知作者", LocalDate.now()); + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public LocalDate getPublishDate() { + return publishDate; + } + + public void setPublishDate(LocalDate publishDate) { + this.publishDate = publishDate; + } + + + @Override + public String toString() { + return "Article{" + + "title='" + title + '\'' + + ", url='" + url + '\'' + + ", author='" + author + '\'' + + ", publishDate=" + publishDate + + ", content='" + content + '\'' + + '}'; + } +} diff --git a/w8-巫秋雨-202506050320/屏幕截图 2026-05-08 175314.png b/w8-巫秋雨-202506050320/屏幕截图 2026-05-08 175314.png new file mode 100644 index 0000000..a7f0f07 Binary files /dev/null and b/w8-巫秋雨-202506050320/屏幕截图 2026-05-08 175314.png differ