Explorar o código

add:老师首页按钮

liujunchi %!s(int64=3) %!d(string=hai) anos
pai
achega
45551c3369

+ 19 - 2
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/NewsController.java

@@ -109,7 +109,7 @@ public class NewsController extends BaseController {
 				}
 			}
 		}
-		if(newsInfo.getType() == 4) {
+		if(newsInfo.getType() == 4 ||newsInfo.getType() == 5) {
 			if (StringUtil.isEmpty(newsInfo.getClientType() )) {
 				return failed("平台不能为空");
 			}
@@ -215,7 +215,24 @@ public class NewsController extends BaseController {
 		return succeed(sysNewsInformationService.updateStatus(id));
 	}
 
-	@ApiOperation("app首页banner、按钮、资讯")
+	@ApiOperation("老师手机app首页按钮")
+	@GetMapping(value = "/app/home/teacher")
+	public HttpResponseResult<List<SysNewsInformationDto>> teacherMenu() {
+
+		NewsInformationQueryInfo queryInfo = new NewsInformationQueryInfo();
+		queryInfo.setStatus(NewsStatusEnum.SHOW.getCode().toString());
+		queryInfo.setPlatformType("TEACHER");
+		// 1热门资讯
+		queryInfo.setType(5);
+		queryInfo.setPage(1);
+		queryInfo.setRows(999);
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+		List<SysNewsInformationDto> rows = sysNewsInformationService.selectPage(queryInfo).getRows();
+		return succeed(rows);
+	}
+
+	@ApiOperation("学生手机app首页banner、按钮、资讯")
 	@PostMapping(value = "/app/home")
 	public HttpResponseResult<AppHomeDto> appHome(@RequestBody AppParam param) {
 

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

@@ -18,7 +18,7 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@NotBlank(message = "平台类型不能为空")
 	private String platformType;
 
-	@ApiModelProperty("轮播图客户端类型 STUDENT:学生端 WEBSITE:官网 ")
+	@ApiModelProperty("轮播图客户端类型 STUDENT:学生端 WEBSITE:官网 TEACHER :老师端")
 	private String clientType;
 
 	@ApiModelProperty(value = "子类型  章节id", required = false)

+ 4 - 1
cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -68,7 +68,7 @@
 						and if(sni.online_time_ is not null,sni.online_time_ &lt;= now(),1=1)
 						and if(sni.offline_time_ is not null,sni.offline_time_ &gt;= now(),1=1)
 					</if>
-					<if test="type == 4">
+					<if test="type == 4 or type == 5">
 						<choose>
 							<when test="platformType == 'WEBSITE'">
 								and sni.client_type_ = #{platformType}
@@ -76,6 +76,9 @@
 							<when test="platformType == 'STUDENT'">
 								and sni.client_type_ = #{platformType}
 							</when>
+							<when test="platformType == 'TEACHER'">
+								and sni.client_type_ = #{platformType}
+							</when>
 						</choose>
 					</if>
 				</if>