ArticleEntity.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /**
  2. The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  4. * this software and associated documentation files (the "Software"), to deal in
  5. * the Software without restriction, including without limitation the rights to
  6. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  7. * the Software, and to permit persons to whom the Software is furnished to do so,
  8. * subject to the following conditions:
  9. * The above copyright notice and this permission notice shall be included in all
  10. * copies or substantial portions of the Software.
  11. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  13. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  14. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  15. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. */
  18. package net.mingsoft.cms.entity;
  19. import java.io.File;
  20. import java.util.Arrays;
  21. import net.mingsoft.basic.entity.AppEntity;
  22. import net.mingsoft.basic.entity.BasicEntity;
  23. import net.mingsoft.basic.entity.ColumnEntity;
  24. import org.apache.commons.lang3.StringUtils;
  25. import cn.hutool.core.util.ArrayUtil;
  26. import net.mingsoft.base.constant.Const;
  27. import net.mingsoft.mdiy.util.ParserUtil;
  28. /**
  29. *
  30. * @ClassName: ArticleEntity
  31. * @Description:TODO(文章模块实体类 || 继承BasicEntity实体)
  32. * @author: 铭飞开发团队
  33. * @date: 2018年1月31日 下午2:55:48
  34. *
  35. * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
  36. */
  37. public class ArticleEntity extends BasicEntity{
  38. /**
  39. * 文章Id
  40. */
  41. private int articleID;
  42. /**
  43. * 文章内容
  44. */
  45. private String articleContent;
  46. /**
  47. * 文章作者
  48. */
  49. private String articleAuthor;
  50. /**
  51. * 文章属性
  52. */
  53. private String articleType ;
  54. /**
  55. * 文章的来源
  56. */
  57. private String articleSource;
  58. /**
  59. * 文章跳转链接地址
  60. */
  61. private String articleUrl;
  62. /**
  63. * 文章关键字
  64. */
  65. private String articleKeyword;
  66. /**
  67. * 文章自定义显示顺序
  68. */
  69. @Deprecated
  70. private int articleFreeOrder;
  71. /**
  72. * 站点d
  73. */
  74. private int articleWebId;
  75. /**
  76. * 文章url地址 主要是用户生成html使用
  77. */
  78. private String articleLinkURL;
  79. /**
  80. * 文章分类url地址,主要是用户生成html使用
  81. */
  82. private String articleTypeLinkURL;
  83. /**
  84. * 一对一管理栏目
  85. */
  86. private ColumnEntity column;
  87. /**
  88. * 获取文章实体所属的栏目实体
  89. * @return
  90. */
  91. public ColumnEntity getColumn() {
  92. return column;
  93. }
  94. /**
  95. * 设置文章所属的栏目实体
  96. * @param column
  97. */
  98. public void setColumn(ColumnEntity column) {
  99. this.column = column;
  100. }
  101. public String getArticleTypeLinkURL() {
  102. return articleTypeLinkURL;
  103. }
  104. public void setArticleTypeLinkURL(String articleTypeLinkURL) {
  105. this.articleTypeLinkURL = articleTypeLinkURL;
  106. }
  107. public String getArticleLinkURL() {
  108. return articleLinkURL;
  109. }
  110. public void setArticleLinkURL(String articleLinkURL) {
  111. this.articleLinkURL = articleLinkURL;
  112. }
  113. /**
  114. * 获取文章作者
  115. * @return 返回文章作者
  116. */
  117. public String getArticleAuthor() {
  118. return articleAuthor;
  119. }
  120. /**
  121. * 获取文章内容
  122. * @return 返回文章内容
  123. */
  124. public String getArticleContent() {
  125. return articleContent;
  126. }
  127. /**
  128. * 获取自定义显示顺序
  129. * @return
  130. */
  131. public int getArticleFreeOrder() {
  132. return articleFreeOrder;
  133. }
  134. /**
  135. * 获取文章Id
  136. * @return 返回文章Id
  137. */
  138. public int getArticleID() {
  139. return articleID;
  140. }
  141. /**
  142. * 获取文章关键字
  143. * @return 返回文章关键字
  144. */
  145. public String getArticleKeyword() {
  146. return articleKeyword;
  147. }
  148. /**
  149. * 获取文章的来源
  150. * @return 返回文章的来源
  151. */
  152. public String getArticleSource() {
  153. return articleSource;
  154. }
  155. /**
  156. * 获取文章属性
  157. * @return 返回文章属性
  158. */
  159. public String getArticleType() {
  160. return articleType;
  161. }
  162. /**
  163. * 获取文章跳转链接
  164. * @return 返回文章跳转链接
  165. */
  166. public String getArticleUrl() {
  167. return articleUrl;
  168. }
  169. /**
  170. * 获取文章站点id
  171. * @return
  172. */
  173. public int getArticleWebId() {
  174. return articleWebId;
  175. }
  176. /**
  177. * 设置文章作者
  178. * @param articleAuthor 传入文章作者
  179. */
  180. public void setArticleAuthor(String articleAuthor) {
  181. this.articleAuthor = articleAuthor;
  182. }
  183. /**
  184. * 设置文章内容
  185. * @param articleContent 传入文章内容
  186. */
  187. public void setArticleContent(String articleContent) {
  188. this.articleContent = articleContent;
  189. }
  190. /**
  191. * 设置文章自定义显示循序排序
  192. * @param articleFreeOrder
  193. */
  194. public void setArticleFreeOrder(int articleFreeOrder) {
  195. this.articleFreeOrder = articleFreeOrder;
  196. }
  197. /**
  198. * 设置文章Id
  199. * @param articleID 传入文章Id
  200. */
  201. public void setArticleID(int articleID) {
  202. this.articleID = articleID;
  203. }
  204. /**
  205. * 设置文章关键字
  206. * @param articleKeyword 传入文章关键字列表
  207. */
  208. public void setArticleKeyword(String articleKeyword) {
  209. this.articleKeyword = articleKeyword;
  210. }
  211. /**
  212. * 设置文章的来源
  213. * @param articleSource 传入文章的来源
  214. */
  215. public void setArticleSource(String articleSource) {
  216. this.articleSource = articleSource;
  217. }
  218. /**
  219. * 设置文章属性
  220. * @param articleType 传入文章属性
  221. */
  222. public void setArticleType(String articleType) {
  223. this.articleType = articleType;
  224. }
  225. /**
  226. * 设置文章跳转链接
  227. * @param articleUrl 传入文章跳转链接地址
  228. */
  229. public void setArticleUrl(String articleUrl) {
  230. this.articleUrl = articleUrl;
  231. }
  232. /**
  233. * 设置文章站点id
  234. * @param articleWebId
  235. */
  236. public void setArticleWebId(int articleWebId) {
  237. this.articleWebId = articleWebId;
  238. }
  239. public String getArticleUrl(AppEntity app) {
  240. if (!StringUtils.isBlank(app.getAppMobileStyle())) {
  241. return app.getAppHostUrl()+ParserUtil.HTML+Const.SEPARATOR+ParserUtil.MOBILE+Const.SEPARATOR+this.getArticleUrl();
  242. }
  243. return app.getAppHostUrl()+Const.SEPARATOR+ParserUtil.HTML+Const.SEPARATOR+this.getArticleUrl();
  244. }
  245. }