Antiloveg hace 8 años
padre
commit
e948099c6f

+ 1 - 1
schema/201707012-lecture.sql

@@ -1,7 +1,7 @@
 CREATE TABLE `lecture` (
   `id` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL,
   `uid` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '开展讲座人ID',
-  `lecture_time` VARCHAR(45) NOT NULL COMMENT '讲座开展时间',
+  `lecture_time` DATETIME NOT NULL COMMENT '讲座开展时间',
   `create_time` DATETIME NULL COMMENT '记录创建时间',
   `last_update_time` DATETIME NULL COMMENT '记录最后更新时间',
   `name` VARCHAR(45) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '名称',

+ 2 - 0
src/main/java/com/goafanti/common/dao/LectureMapper.java

@@ -30,4 +30,6 @@ public interface LectureMapper {
 	List<LectureListBo> listDynamic();
 
 	List<BigShotLectureListBo> listBigShotLecture();
+
+	List<LectureListBo> findLectureList();
 }

+ 21 - 0
src/main/java/com/goafanti/common/mapper/LectureMapper.xml

@@ -312,4 +312,25 @@
 	  		l.deleted_sign = 0
 	  	and l.hot = 1
   </select>
+  
+  <select id="findLectureList" resultType="com.goafanti.lecture.bo.LectureListBo">
+  		select 
+	  		l.id,
+	  		l.uid,
+	  		l.name,
+	  		l.lecture_time as lectureTime,
+	  		l.summary,
+	  		l.lecture_url as lectureUrl,
+	  		ui.username,
+	  		l.hot,
+	  		l.dynamic,
+	  		l.end_time as endTime
+	  	from lecture l
+	  	left join  user_identity ui on ui.uid = l.uid
+	  	where 
+	  		l.deleted_sign = 0
+	  	and lecture_time > now()
+	  	order by lecture_time 
+	  	limit 0 , 5
+  </select>
 </mapper>

+ 7 - 7
src/main/java/com/goafanti/lecture/bo/InputLecture.java

@@ -17,15 +17,15 @@ public class InputLecture {
 	private String	name;
 
 	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	describe;
+	private String	summary;
 
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	lectureUrl;
-	
+
 	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	hot;
-	
+
 	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	dynamic;
@@ -54,12 +54,12 @@ public class InputLecture {
 		this.name = name;
 	}
 
-	public String getDescribe() {
-		return describe;
+	public String getSummary() {
+		return summary;
 	}
 
-	public void setDescribe(String describe) {
-		this.describe = describe;
+	public void setSummary(String summary) {
+		this.summary = summary;
 	}
 
 	public String getLectureUrl() {

+ 2 - 0
src/main/java/com/goafanti/lecture/service/LectureService.java

@@ -28,4 +28,6 @@ public interface LectureService {
 
 	List<BigShotLectureListBo> listBigShotLecture();
 
+	List<LectureListBo> findLectureList();
+
 }

+ 5 - 0
src/main/java/com/goafanti/lecture/service/impl/LectureServiceImpl.java

@@ -123,4 +123,9 @@ public class LectureServiceImpl extends BaseMybatisDao<LectureMapper> implements
 		return lectureMapper.listBigShotLecture();
 	}
 
+	@Override
+	public List<LectureListBo> findLectureList() {
+		return lectureMapper.findLectureList();
+	}
+
 }

+ 47 - 0
src/main/java/com/goafanti/portal/controller/PortalLectureController.java

@@ -0,0 +1,47 @@
+package com.goafanti.portal.controller;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.lecture.bo.LectureListBo;
+import com.goafanti.lecture.service.LectureService;
+
+/**
+ * 科技讲堂
+ */
+@RestController
+public class PortalLectureController extends BaseApiController {
+	@Resource
+	private LectureService lectureService;
+	
+	//@RequestMapping(value = "/portal/scienceTechnology/lecture", method = RequestMethod.GET)
+	public ModelAndView lecture(){
+		ModelAndView mv = new ModelAndView();
+		List<LectureListBo> lectureList = lectureService.findLectureList();
+		mv.addObject("lectureList", lectureList);
+		mv.setViewName("/portal/scienceTechnology/lecture");
+		return mv;
+	}
+	
+	/**
+	 * 查看更多
+	 */
+	@RequestMapping(value = "/portal/scienceTechnology/lecture/loadMore", method = RequestMethod.POST)
+	public Result loadMore(String pageSize, String pageNo, String id){
+		Result res = new Result();
+		if (StringUtils.isNotBlank(id)){
+			List<String> ids = Arrays.asList(id.trim().split(",|,"));
+		}
+		return res;
+	}
+}