XMTT 7 年 前
コミット
f4f10d0344

+ 0 - 6
src/main/java/com/ekexiu/console/system/dao/ArticleDao.java

74
    @From(Article.class)
74
    @From(Article.class)
75
    int updateSubject(Connection con, String articleId, @Set String subject) throws SQLException;
75
    int updateSubject(Connection con, String articleId, @Set String subject) throws SQLException;
76
76
77
    @Nullable
78
    @QueryVal
79
    @Column(handlerClass = StringHandler.class, value = "article_img")
80
    @From(Article.class)
81
    String queryImagePath(Connection con, String articleId) throws SQLException;
82
83
    @Nullable
77
    @Nullable
84
    @QueryOne
78
    @QueryOne
85
    ArticleInfo queryInfo(Connection con, String articleId) throws SQLException;
79
    ArticleInfo queryInfo(Connection con, String articleId) throws SQLException;

+ 29 - 7
src/main/java/com/ekexiu/console/system/service/DiscoverBannerService.java

3
3
4
import com.ekexiu.console.system.dao.ArticleDao;
4
import com.ekexiu.console.system.dao.ArticleDao;
5
import com.ekexiu.console.system.dao.DiscoverBannerDao;
5
import com.ekexiu.console.system.dao.DiscoverBannerDao;
6
import com.ekexiu.console.system.po.Article;
6
import com.ekexiu.console.system.po.DiscoverBanner;
7
import com.ekexiu.console.system.po.DiscoverBanner;
7
import com.ekexiu.console.system.vo.ConsoleAuthUser;
8
import com.ekexiu.console.system.vo.ConsoleAuthUser;
8
import freemarker.cache.StringTemplateLoader;
9
import freemarker.cache.StringTemplateLoader;
42
43
43
    private String templatePc = "<ul id=\"slide-list\" class=\"slide-list floatL\">\n" +
44
    private String templatePc = "<ul id=\"slide-list\" class=\"slide-list floatL\">\n" +
44
            "    <li class=\"slide-item slide-item-active\" data-id=\"${banner[0].articleId}\" data-col=\"${banner[0].bannerId}\">\n" +
45
            "    <li class=\"slide-item slide-item-active\" data-id=\"${banner[0].articleId}\" data-col=\"${banner[0].bannerId}\">\n" +
45
            "        <a href=\"articalShow.html?articleId=${banner[0].articleId}\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[0].image}');\">\n" +
46
            "        <a href=\"/shtml/a/${banner[0].time}/${banner[0].shareId}.html\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[0].image}');\">\n" +
46
            "            <p class=\"title\">${banner[0].title}</p>\n" +
47
            "            <p class=\"title\">${banner[0].title}</p>\n" +
47
            "        </a>\n" +
48
            "        </a>\n" +
48
            "    </li>\n" +
49
            "    </li>\n" +
49
            "    <li class=\"slide-item\" data-id=\"${banner[1].articleId}\" data-col=\"${banner[1].bannerId}\">\n" +
50
            "    <li class=\"slide-item\" data-id=\"${banner[1].articleId}\" data-col=\"${banner[1].bannerId}\">\n" +
50
            "        <a href=\"articalShow.html?articleId=${banner[1].articleId}\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[1].image}');\">\n" +
51
            "        <a href=\"/shtml/a/${banner[1].time}/${banner[1].shareId}.html\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[1].image}');\">\n" +
51
            "            <p class=\"title\">${banner[1].title}</p>\n" +
52
            "            <p class=\"title\">${banner[1].title}</p>\n" +
52
            "        </a>\n" +
53
            "        </a>\n" +
53
            "    </li>\n" +
54
            "    </li>\n" +
54
            "    <li class=\"slide-item\" data-id=\"${banner[2].articleId}\" data-col=\"${banner[2].bannerId}\">\n" +
55
            "    <li class=\"slide-item\" data-id=\"${banner[2].articleId}\" data-col=\"${banner[2].bannerId}\">\n" +
55
            "        <a href=\"articalShow.html?articleId=${banner[2].articleId}\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[2].image}');\">\n" +
56
            "        <a href=\"/shtml/a/${banner[2].time}/${banner[2].shareId}.html\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[2].image}');\">\n" +
56
            "            <p class=\"title\">${banner[2].title}</p>\n" +
57
            "            <p class=\"title\">${banner[2].title}</p>\n" +
57
            "        </a>\n" +
58
            "        </a>\n" +
58
            "    </li>\n" +
59
            "    </li>\n" +
59
            "    <li class=\"slide-item\" data-id=\"${banner[3].articleId}\" data-col=\"${banner[3].bannerId}\">\n" +
60
            "    <li class=\"slide-item\" data-id=\"${banner[3].articleId}\" data-col=\"${banner[3].bannerId}\">\n" +
60
            "        <a href=\"articalShow.html?articleId=${banner[3].articleId}\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[3].image}');\">\n" +
61
            "        <a href=\"/shtml/a/${banner[3].time}/${banner[3].shareId}.html\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[3].image}');\">\n" +
61
            "            <p class=\"title\">${banner[3].title}</p>\n" +
62
            "            <p class=\"title\">${banner[3].title}</p>\n" +
62
            "        </a>\n" +
63
            "        </a>\n" +
63
            "    </li>\n" +
64
            "    </li>\n" +
64
            "    <li class=\"slide-item\" data-id=\"${banner[4].articleId}\" data-col=\"${banner[4].bannerId}\">\n" +
65
            "    <li class=\"slide-item\" data-id=\"${banner[4].articleId}\" data-col=\"${banner[4].bannerId}\">\n" +
65
            "        <a href=\"articalShow.html?articleId=${banner[4].articleId}\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[4].image}');\">\n" +
66
            "        <a href=\"/shtml/a/${banner[4].time}/${banner[4].shareId}.html\" target=\"_blank\" style=\"background-image:url('/data/article/${banner[4].image}');\">\n" +
66
            "            <p class=\"title\">${banner[4].title}</p>\n" +
67
            "            <p class=\"title\">${banner[4].title}</p>\n" +
67
            "        </a>\n" +
68
            "        </a>\n" +
68
            "    </li>\n" +
69
            "    </li>\n" +
282
        this.discoverBannerDao.update(con, discoverBanner);
283
        this.discoverBannerDao.update(con, discoverBanner);
283
        Banner b = new Banner();
284
        Banner b = new Banner();
284
        b.setArticleId(discoverBanner.getArticleId());
285
        b.setArticleId(discoverBanner.getArticleId());
285
        String image = this.articleDao.queryImagePath(con, discoverBanner.getArticleId());
286
        b.setImage(image);
286
        //String image = this.articleDao.queryImagePath(con, discoverBanner.getArticleId());
287
        Article article = this.articleDao.queryBaseInfo(con, discoverBanner.getArticleId());
288
        b.setImage(article.getArticleImg());
287
        b.setBanner(dictBanner(discoverBanner.getBanner()));
289
        b.setBanner(dictBanner(discoverBanner.getBanner()));
288
        b.setTitle(discoverBanner.getTitle());
290
        b.setTitle(discoverBanner.getTitle());
289
        b.setBannerId(id);
291
        b.setBannerId(id);
292
        b.setShareId(String.valueOf(article.getShareId()));
293
        b.setTime(article.getCreateTime().substring(0,8));
290
        banners.add(b);
294
        banners.add(b);
291
    }
295
    }
292
296
317
        private String title;
321
        private String title;
318
        private String banner;
322
        private String banner;
319
        private Long bannerId;
323
        private Long bannerId;
324
        private String shareId;
325
        private String time;
320
326
321
        public String getArticleId() {
327
        public String getArticleId() {
322
            return articleId;
328
            return articleId;
357
        public void setBannerId(Long bannerId) {
363
        public void setBannerId(Long bannerId) {
358
            this.bannerId = bannerId;
364
            this.bannerId = bannerId;
359
        }
365
        }
366
367
        public String getShareId() {
368
            return shareId;
369
        }
370
371
        public void setShareId(String shareId) {
372
            this.shareId = shareId;
373
        }
374
375
        public String getTime() {
376
            return time;
377
        }
378
379
        public void setTime(String time) {
380
            this.time = time;
381
        }
360
    }
382
    }
361
    
383
    
362
}
384
}