File tree Expand file tree Collapse file tree 15 files changed +35
-14
lines changed
upupor-data/src/main/java/com/upupor/data
src/main/java/com/upupor/service
src/main/resources/templates Expand file tree Collapse file tree 15 files changed +35
-14
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ public class Content extends BaseEntity {
112112 */
113113 private String keywords ;
114114
115+ private Content () {
116+ }
117+
118+
115119 public static Content init () {
116120 Content newContent = new Content ();
117121 newContent .setTagIds (CcConstant .EMPTY_STR );
@@ -123,5 +127,5 @@ public static Content init() {
123127 newContent .setLatestCommentTime (CcDateUtil .getCurrentTime ());
124128 return newContent ;
125129 }
126-
130+
127131}
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ public ContentEnhance() {
144144 }
145145
146146 public static Content empty () {
147- return new Content ();
147+ return Content . init ();
148148 }
149149
150150 private void init () {
Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ protected Boolean exists() {
5353
5454 @ Override
5555 protected void insertAd (int adIndex ) {
56- Content ad = new Content ();
56+ Content ad = Content .init ();
57+ ;
5758 ad .setContentId (CcConstant .GoogleAd .FEED_AD );
5859 getVoList ().add (adIndex , Converter .contentEnhance (ad ));
5960 }
Original file line number Diff line number Diff line change 6464 <version >8.4.1</version >
6565 <exclusions >
6666 <exclusion >
67- <groupId >com.squareup.okhttp3</groupId >
6867 <artifactId >okhttp</artifactId >
68+ <groupId >com.squareup.okhttp3</groupId >
6969 </exclusion >
7070 </exclusions >
7171 </dependency >
7676 <artifactId >okhttp</artifactId >
7777 <version >4.9.0</version >
7878 </dependency >
79+
7980 <dependency >
8081 <groupId >org.springframework.boot</groupId >
8182 <artifactId >spring-boot-configuration-processor</artifactId >
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ protected void publishContentEvent(Content content) {
192192 }
193193
194194 public static ContentEnhance create (String contentId , CreateContentReq createContentReq ) {
195- Content content = new Content ();
195+ Content content = Content . init ();
196196 content .setContentId (contentId );
197197 content .setTitle (createContentReq .getTitle ());
198198 content .setContentType (createContentReq .getContentType ());
Original file line number Diff line number Diff line change 4141import com .upupor .service .business .message .MessageSend ;
4242import com .upupor .service .business .message .model .MessageModel ;
4343import com .upupor .service .listener .event .ReplayCommentEvent ;
44- import org .jetbrains .annotations .NotNull ;
4544import org .springframework .stereotype .Component ;
4645
4746import javax .annotation .Resource ;
47+ import javax .validation .constraints .NotNull ;
4848import java .util .Objects ;
4949
5050import static com .upupor .framework .CcConstant .MsgTemplate .*;
Original file line number Diff line number Diff line change 3737import com .upupor .service .business .message .MessageSend ;
3838import com .upupor .service .business .message .model .MessageModel ;
3939import com .upupor .service .listener .event .ReplayCommentEvent ;
40- import org .jetbrains .annotations .NotNull ;
4140import org .springframework .stereotype .Component ;
4241
42+ import javax .validation .constraints .NotNull ;
4343import java .util .Objects ;
4444
4545import static com .upupor .framework .CcConstant .MsgTemplate .*;
Original file line number Diff line number Diff line change 4141import com .upupor .service .business .message .MessageSend ;
4242import com .upupor .service .business .message .model .MessageModel ;
4343import com .upupor .service .listener .event .ReplayCommentEvent ;
44- import org .jetbrains .annotations .NotNull ;
4544import org .springframework .stereotype .Component ;
4645
4746import javax .annotation .Resource ;
47+ import javax .validation .constraints .NotNull ;
4848import java .util .Objects ;
4949
5050import static com .upupor .framework .CcConstant .MsgTemplate .*;
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ public void createContent(PublishContentEvent createContentEvent) {
126126
127127 ContentEnhance contentEnhance = contentService .getContentByContentIdNoStatus (contentId );
128128 Content content = contentEnhance .getContent ();
129- if (Objects .isNull (content ) || !content . getStatus () .equals (ContentStatus . NORMAL )) {
129+ if (Objects .isNull (content ) || !ContentStatus . NORMAL .equals (content . getStatus () )) {
130130 log .warn ("文章不存在或者状态不正常,不执行后续事件" );
131131 return ;
132132 }
Original file line number Diff line number Diff line change 4444 <groupId >com.upupor.service</groupId >
4545 <artifactId >upupor-service</artifactId >
4646 <version >1.0.0</version >
47+ <exclusions >
48+ <exclusion >
49+ <artifactId >okhttp</artifactId >
50+ <groupId >com.squareup.okhttp3</groupId >
51+ </exclusion >
52+ </exclusions >
53+ </dependency >
54+ <dependency >
55+ <groupId >com.squareup.okhttp3</groupId >
56+ <artifactId >okhttp</artifactId >
57+ <version >4.9.0</version >
4758 </dependency >
4859 <!-- 添加定时任务模块-->
4960 <dependency >
You can’t perform that action at this time.
0 commit comments