Explorar o código

update:banner add platform type

liujunchi %!s(int64=2) %!d(string=hai) anos
pai
achega
21b86296de

+ 5 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/NewsController.java

@@ -109,6 +109,11 @@ public class NewsController extends BaseController {
 				}
 			}
 		}
+		if(newsInfo.getType() == 4) {
+			if (StringUtil.isEmpty(newsInfo.getPlatformType() )) {
+				return failed("平台不能为空");
+			}
+		}
 
 		// 1 4 6
 		if (newsInfo.getType() == 1 ||newsInfo.getType() == 4 || newsInfo.getType() == 6) {

+ 1 - 1
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -17,7 +17,7 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@NotNull(message = "类型不能为空")
 	private Integer type;
 
-	@ApiModelProperty(value = "平台类型  ADMIN:平台端  STUDENT:学生端  TEACHER:老师端",required = true)
+	@ApiModelProperty(value = "平台类型  ADMIN:平台端  STUDENT:学生端  TEACHER:老师端 WEBSITE:官网",required = true)
 	@NotBlank(message = "平台类型不能为空")
 	private String platformType;
 

+ 12 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsInformation.java

@@ -94,6 +94,18 @@ public class SysNewsInformation {
 	@ApiModelProperty("链接方式 IN :内部链接   OUT:外部链接")
 	private String linkType;
 
+	// 平台类型  ADMIN:平台端  STUDENT:学生端  TEACHER:老师端 WEBSITE:官网
+	@ApiModelProperty(value = "平台类型    STUDENT:学生端  WEBSITE:官网")
+	private String platformType;
+
+	public String getPlatformType() {
+		return platformType;
+	}
+
+	public void setPlatformType(String platformType) {
+		this.platformType = platformType;
+	}
+
 	public Integer getShowTime() {
 		return showTime;
 	}

+ 7 - 2
cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -30,6 +30,7 @@
 		<result column="update_by_" property="updateBy" />
 		<result column="link_type_" property="linkType" />
 		<result column="create_by_" property="createBy" />
+		<result column="platform_type_" property="platformType" />
 	</resultMap>
 	
 	<resultMap type="com.yonge.cooleshow.cms.dto.SysNewsInformationDto" id="SysNewsInformationDto" extends="SysNewsInformation">
@@ -68,6 +69,9 @@
 						and if(sni.offline_time_ is not null,sni.offline_time_ &gt;= now(),1=1)
 					</if>
 				</if>
+				<if test="platformType == 'WEBSITE'">
+					and sni.platform_type_ = #{platformType}
+				</if>
 			</if>
 			<if test="excludeIds!=null and excludeIds.size()>0">
 				AND sni.id_ NOT IN
@@ -96,8 +100,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.SysNewsInformation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,attribute1_,attribute2_,subject_id_list_,create_by_,update_by_,show_time_,link_type_)
-		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.yonge.toolset.mybatis.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{attribute1},#{attribute2},#{subjectIdList},#{createBy},#{updateBy},#{showTime},#{linkType})
+		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,attribute1_,attribute2_,subject_id_list_,create_by_,update_by_,show_time_,link_type_,platform_type_)
+		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.yonge.toolset.mybatis.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{attribute1},#{attribute2},#{subjectIdList},#{createBy},#{updateBy},#{showTime},#{linkType},#{platformType})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -126,6 +130,7 @@
 				subject_id_list_ = #{subjectIdList},
 				update_by_ = #{updateBy},
 				link_type_ = #{linkType},
+				platform_type_ = #{platformType},
 				show_time_ = #{showTime}
 		</set>
 		WHERE id_ = #{id}