Browse Source

科技思想整体规划

Michael 8 years ago
parent
commit
86b209a644

+ 6 - 2
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -41,7 +41,9 @@
     source_url as sourceUrl, 
     summary,
     jmrh_flag as jmrhFlag,
-    province_id as provinceId
+    province_id as provinceId,
+    audit_status as auditStatus,
+    release_status as releaseStatus
     from news
     where id = #{id,jdbcType=BIGINT}
   </select>
@@ -209,7 +211,9 @@
       summary = #{summary,jdbcType=VARCHAR},
       content = #{content,jdbcType=LONGVARCHAR},
       jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
-      province_id = #{provinceId,jdbcType=INTEGER}
+      province_id = #{provinceId,jdbcType=INTEGER},
+      audit_status = #{auditStatus,jdbcType=INTEGER},
+      release_status = #{releaseStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.News">

+ 12 - 2
src/main/java/com/goafanti/common/mapper/NewsMapperExt.xml

@@ -10,9 +10,11 @@
 		<result column="hot" jdbcType="INTEGER" property="hot" />
 		<result column="summary" jdbcType="VARCHAR" property="summary" />
 		<result column="source" jdbcType="VARCHAR" property="source" />
+		<result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
+		<result column="release_status" jdbcType="INTEGER" property="releaseStatus" />
 	</resultMap>
 	<sql id="Summary_Column_List">
-		id, create_time, title, title_img, type, hot, summary, source
+		id, create_time, title, title_img, type, hot, summary, source,audit_status,release_status
 	</sql>
 	<select id="findList" resultType="com.goafanti.news.bo.NewsSummary">
 		select
@@ -63,9 +65,17 @@
   		type,
   		hot,
   		source,
-  		summary
+  		summary,
+  		audit_status as auditStatus,
+  		release_status as releaseStatus
   	from news
   	where 1 =1
+  	<if test="auditStatus != null">
+  		and audit_status = #{auditStatus,jdbcType=INTEGER}
+  	</if>
+  	<if test="releaseStatus != null">
+  		and release_status = #{releaseStatus,jdbcType=INTEGER}
+  	</if>
   	<if test="type != null">
   		and type = #{type,jdbcType=INTEGER}
   	</if>

+ 26 - 0
src/main/java/com/goafanti/common/model/News.java

@@ -85,6 +85,16 @@ public class News {
 	 */
 	private Integer provinceId;
 	
+	/**
+	 * 审核状态
+	 */
+	private Integer auditStatus;
+	
+	/**
+	 * 是否发布
+	 */
+	private Integer releaseStatus;
+	
 	@JsonFormat(shape = Shape.STRING)
 	public Long getId() {
 		return id;
@@ -94,6 +104,22 @@ public class News {
 		this.id = id;
 	}
 
+	public Integer getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(Integer auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public Integer getReleaseStatus() {
+		return releaseStatus;
+	}
+
+	public void setReleaseStatus(Integer releaseStatus) {
+		this.releaseStatus = releaseStatus;
+	}
+
 	public Date getCreateTime() {
 		return createTime;
 	}

+ 26 - 0
src/main/java/com/goafanti/news/bo/InputNews.java

@@ -45,6 +45,32 @@ public class InputNews {
 	private Integer provinceId;
 	
 	private String	content;
+	
+	/**
+	 * 审核状态
+	 */
+	private Integer auditStatus;
+	
+	/**
+	 * 是否发布
+	 */
+	private Integer releaseStatus;
+
+	public Integer getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(Integer auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public Integer getReleaseStatus() {
+		return releaseStatus;
+	}
+
+	public void setReleaseStatus(Integer releaseStatus) {
+		this.releaseStatus = releaseStatus;
+	}
 
 	public Long getId() {
 		return id;

+ 26 - 0
src/main/java/com/goafanti/news/bo/NewsSummary.java

@@ -48,6 +48,16 @@ public class NewsSummary {
 	 * 来源
 	 */
 	private String	source;
+	
+	/**
+	 * 审核状态
+	 */
+	private Integer auditStatus;
+	
+	/**
+	 * 是否发布
+	 */
+	private Integer releaseStatus;
 
 	@JsonFormat(shape = Shape.STRING)
 	public Long getId() {
@@ -58,6 +68,22 @@ public class NewsSummary {
 		this.id = id;
 	}
 
+	public Integer getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(Integer auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public Integer getReleaseStatus() {
+		return releaseStatus;
+	}
+
+	public void setReleaseStatus(Integer releaseStatus) {
+		this.releaseStatus = releaseStatus;
+	}
+
 	public Date getCreateTime() {
 		return createTime;
 	}

+ 2 - 2
src/main/java/com/goafanti/news/controller/AdminNewsApiController.java

@@ -46,7 +46,7 @@ public class AdminNewsApiController extends BaseApiController {
 	 */
 	@RequestMapping(value = "/list", method = RequestMethod.GET)
 	public Result list(Integer type, String title, String author, String startCreateTime, String endCreateTime,
-			String source, Integer hot, String pageSize, String pageNo) {
+			String source, Integer hot, String pageSize, String pageNo,String auditStatus,String releaseStatus) {
 		Result res = new Result();
 		if (null == type) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "新闻类型"));
@@ -60,7 +60,7 @@ public class AdminNewsApiController extends BaseApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(newsService.listNews(type, title, author, startCreateTime, endCreateTime, source, hot, pNo, pSize));
+		res.setData(newsService.listNews(type, title, author, startCreateTime, endCreateTime, source, hot, pNo, pSize,auditStatus,releaseStatus));
 		return res;
 	}
 

+ 9 - 1
src/main/java/com/goafanti/news/service/NewsService.java

@@ -96,8 +96,16 @@ public class NewsService extends BaseMybatisDao<NewsMapper> {
 
 	@SuppressWarnings("unchecked")
 	public Pagination<News> listNews(Integer type, String title, String author, String startCreateTime,
-			String endCreateTime, String source, Integer hot, Integer pNo, Integer pSize) {
+			String endCreateTime, String source, Integer hot, Integer pNo, Integer pSize,String auditStatus,String releaseStatus) {
 		Map<String, Object> params = new HashMap<>();
+		if (null != auditStatus) {
+			params.put("auditStatus", auditStatus);
+		}
+		
+		if (null != releaseStatus) {
+			params.put("releaseStatus", releaseStatus);
+		}
+		
 		if (null != type) {
 			params.put("type", type);
 		}