Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e48abd9

Browse files
committed
feed 避免重复
1 parent b5d46c7 commit e48abd9

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

config/solr_schema.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<field name="lastreplyuid" type="int" indexed="false" stored="true" />
146146
<field name="lastreplytime" type="string" indexed="false" stored="true" />
147147
<field name="top" type="int" indexed="true" stored="true" />
148+
<field name="created_at" type="string" indexed="false" stored="true" />
148149
<field name="updated_at" type="string" indexed="false" stored="true" />
149150
<field name="sort_time" type="string" indexed="true" stored="true" />
150151

src/http/controller/feed.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ func (self FeedController) List(ctx echo.Context) error {
7979
Link: &feeds.Link{Href: url},
8080
Author: &feeds.Author{Name: doc.Author},
8181
Description: doc.Content,
82-
Created: time.Time(doc.SortTime),
83-
Updated: time.Time(doc.SortTime),
82+
Created: time.Time(doc.CreatedAt),
83+
Updated: time.Time(doc.CreatedAt),
8484
}
8585
}
8686

src/model/document.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type Document struct {
3232
Lastreplyuid int `json:"lastreplyuid"`
3333
Lastreplytime OftenTime `json:"lastreplytime"`
3434

35+
CreatedAt OftenTime `json:"created_at"`
3536
UpdatedAt OftenTime `json:"updated_at"`
3637

3738
// 排序用的时间
@@ -88,6 +89,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
8889
Top: objdoc.Top,
8990
Lastreplyuid: objdoc.Lastreplyuid,
9091
Lastreplytime: objdoc.Lastreplytime,
92+
CreatedAt: objdoc.Ctime,
9193
UpdatedAt: objdoc.Mtime,
9294
SortTime: sortTime,
9395
}
@@ -123,6 +125,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
123125
Top: objdoc.Top,
124126
Lastreplyuid: objdoc.Lastreplyuid,
125127
Lastreplytime: objdoc.Lastreplytime,
128+
CreatedAt: objdoc.Ctime,
126129
UpdatedAt: objdoc.Mtime,
127130
SortTime: sortTime,
128131
}
@@ -162,6 +165,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
162165
Top: 0,
163166
Lastreplyuid: objdoc.Lastreplyuid,
164167
Lastreplytime: objdoc.Lastreplytime,
168+
CreatedAt: objdoc.Ctime,
165169
UpdatedAt: objdoc.Mtime,
166170
SortTime: sortTime,
167171
}
@@ -193,6 +197,7 @@ func NewDocument(object interface{}, objectExt interface{}) *Document {
193197
Top: 0,
194198
Lastreplyuid: objdoc.Lastreplyuid,
195199
Lastreplytime: objdoc.Lastreplytime,
200+
CreatedAt: objdoc.Ctime,
196201
UpdatedAt: objdoc.Mtime,
197202
SortTime: sortTime,
198203
}

template/common/layout.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
1616
<link rel="stylesheet" href="{{.static_domain}}/static/dist/css/sg_libs.min.css?v=20180305"/>
1717
<link rel="stylesheet" href="{{.static_domain}}/static/dist/css/sg_styles.min.css?v=20180305"/>
18-
18+
1919
{{template "css" .}}
2020

2121
<!--[if lt IE 9]-->
@@ -137,18 +137,18 @@
137137
<footer id="bottom">
138138
<div class="container nav-content">
139139
<div class="inner_content">
140-
<div class="sep10"></div>
140+
<div class="sep10"></div>
141141
<strong>
142142
{{range $i, $el := .setting.FooterNavs}}
143-
<a href="{{.Url}}" class="dark">{{.Name}}</a> &nbsp; <span class="snow"></span> &nbsp;
143+
<a href="{{.Url}}" class="dark">{{.Name}}</a> &nbsp; <span class="snow"></span> &nbsp;
144144
{{end}}
145145
<span id="onlineusers">{{.online_users.online}}</span> 人在线
146146
</strong>
147147
&nbsp;<span class="cc">最高记录 <span id="maxonline">{{.online_users.maxonline}}</span></span>
148148
<div class="sep20"></div>
149149
&copy;{{.app.Copyright}} {{.setting.Slogan}}
150150
<div class="sep5"></div>
151-
Powered by <a href="https://github.com/studygolang/studygolang">StudyGolang(Golang + MySQL)</a> &nbsp;<span class="snow"></span>&nbsp;服务器由 <a href="http://www.ucai.cn" class="dark" target="_blank">优才学院</a> 赞助 &nbsp;<span class="snow">·</span>&nbsp;CDN <a href="https://portal.qiniu.com/signup?code=3lfz4at7pxfma" title="七牛云" class="dark" target="_blank">七牛云</a> 赞助
151+
Powered by <a href="https://github.com/studygolang/studygolang">StudyGolang(Golang + MySQL)</a> &nbsp;<span class="snow"></span>&nbsp;<span class="snow">·</span>&nbsp;CDN 采用 <a href="https://portal.qiniu.com/signup?code=3lfz4at7pxfma" title="七牛云" class="dark" target="_blank">七牛云</a>
152152
<div class="sep20"></div>
153153
<span class="small cc">VERSION: {{.app.Version}}&nbsp;<span class="snow">·</span>&nbsp;{{.resp_time}}&nbsp;<span class="snow">·</span>&nbsp;<strong>为了更好的体验,本站推荐使用 Chrome 或 Firefox 浏览器</strong></span>
154154
<div class="sep20"></div>
@@ -211,7 +211,7 @@
211211
</div>
212212
<div id="sg-overlay"></div>
213213
{{end}}
214-
214+
215215
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
216216
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
217217
<script src="https://cdn.bootcss.com/jquery-timeago/1.6.1/jquery.timeago.min.js"></script>
@@ -252,4 +252,4 @@
252252
{{end}}
253253

254254
</body>
255-
</html>
255+
</html>

template/sidebar/concern.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ <h3 class="title"><i class="glyphicon glyphicon-qrcode"></i>&nbsp;&nbsp;关注
77
<ul class="list-unstyled">
88
<li><img src="https://static.studygolang.com/img/wx_sg_qrcode.jpg?imageView2/2/w/280" alt="关注微信" class="img-responsive"></li>
99
<li class="text-center">加入我们的 QQ 群:192706294</li>
10+
<li class="text-center">也欢迎加入我们的 <a href="https://slack.studygolang.com" target="_blank">slack</a></li>
1011
</ul>
1112
</div>
1213
</div>
13-
</div>
14+
</div>

0 commit comments

Comments
 (0)