浏览代码

fix:热门搜索

liujunchi 3 年之前
父节点
当前提交
84dc44cf43
共有 15 个文件被更改,包括 500 次插入35 次删除
  1. 1 1
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/NewsController.java
  2. 14 6
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/NewsInformationQueryInfo.java
  3. 5 5
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsInformation.java
  4. 6 7
      cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  5. 118 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/HotSearchController.java
  6. 23 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/HotSearchDao.java
  7. 40 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/HotSearchSearch.java
  8. 128 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/HotSearch.java
  9. 40 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/HotSearchService.java
  10. 55 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/HotSearchServiceImpl.java
  11. 26 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/HotSearchVo.java
  12. 21 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/HotSearchMapper.xml
  13. 2 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml
  14. 0 11
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/MusicAlbumController.java
  15. 21 4
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/open/OpenMusicSheetController.java

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

@@ -110,7 +110,7 @@ public class NewsController extends BaseController {
 			}
 		}
 		if(newsInfo.getType() == 4) {
-			if (StringUtil.isEmpty(newsInfo.getPlatformType() )) {
+			if (StringUtil.isEmpty(newsInfo.getClientType() )) {
 				return failed("平台不能为空");
 			}
 		}

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

@@ -1,15 +1,12 @@
 package com.yonge.cooleshow.cms.controller.queryinfo;
 
-import io.swagger.annotations.ApiModelProperty;
-
-import java.util.Date;
-import java.util.List;
-
-import com.yonge.cooleshow.cms.dal.entity.NewsStatusEnum;
 import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.List;
 
 public class NewsInformationQueryInfo extends QueryInfo {
 
@@ -21,6 +18,9 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@NotBlank(message = "平台类型不能为空")
 	private String platformType;
 
+	@ApiModelProperty("轮播图客户端类型 STUDENT:学生端 WEBSITE:官网 ")
+	private String clientType;
+
 	@ApiModelProperty(value = "子类型  章节id", required = false)
 	private String subType;
 
@@ -48,6 +48,14 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	private Date date;
 
 
+	public String getClientType() {
+		return clientType;
+	}
+
+	public void setClientType(String clientType) {
+		this.clientType = clientType;
+	}
+
 	public String getAttribute2() {
 		return attribute2;
 	}

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

@@ -96,14 +96,14 @@ public class SysNewsInformation {
 
 	// 平台类型  ADMIN:平台端  STUDENT:学生端  TEACHER:老师端 WEBSITE:官网
 	@ApiModelProperty(value = "平台类型    STUDENT:学生端  WEBSITE:官网")
-	private String platformType;
+	private String clientType;
 
-	public String getPlatformType() {
-		return platformType;
+	public String getClientType() {
+		return clientType;
 	}
 
-	public void setPlatformType(String platformType) {
-		this.platformType = platformType;
+	public void setClientType(String clientType) {
+		this.clientType = clientType;
 	}
 
 	public Integer getShowTime() {

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

@@ -30,7 +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" />
+		<result column="client_type_" property="clientType" />
 	</resultMap>
 	
 	<resultMap type="com.yonge.cooleshow.cms.dto.SysNewsInformationDto" id="SysNewsInformationDto" extends="SysNewsInformation">
@@ -72,15 +72,14 @@
 				<if test="type == 4">
 					<choose>
 						<when test="platformType == 'WEBSITE'">
-							and sni.platform_type_ = #{platformType}
+							and sni.client_type_ = #{platformType}
 						</when>
 						<when test="platformType == 'STUDENT'">
-							and sni.platform_type_ = #{platformType}
+							and sni.client_type_ = #{platformType}
 						</when>
 					</choose>
 				</if>
 
-
 			</if>
 			<if test="excludeIds!=null and excludeIds.size()>0">
 				AND sni.id_ NOT IN
@@ -109,8 +108,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_,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 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_,client_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},#{clientType})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -139,7 +138,7 @@
 				subject_id_list_ = #{subjectIdList},
 				update_by_ = #{updateBy},
 				link_type_ = #{linkType},
-				platform_type_ = #{platformType},
+				client_type_ = #{clientType},
 				show_time_ = #{showTime}
 		</set>
 		WHERE id_ = #{id}

+ 118 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/HotSearchController.java

@@ -0,0 +1,118 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.search.HotSearchSearch;
+import com.yonge.cooleshow.biz.dal.entity.HotSearch;
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+import com.yonge.cooleshow.biz.dal.service.HotSearchService;
+import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.HotSearchVo;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Date;
+
+@RestController
+@RequestMapping("/hotSearch")
+@Api(value = "热门搜索表", tags = "热门搜索表")
+public class HotSearchController extends BaseController {
+
+    @Autowired
+    private HotSearchService hotSearchService;
+
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+	/**
+     * 查询单条
+     */
+    @GetMapping("/detail/{id}")
+    @ApiOperation(value = "详情", notes = "传入id")
+    public HttpResponseResult<HotSearch> detail(@PathVariable("id") Long id) {
+		HotSearch hotSearch = hotSearchService.getById(id);
+		if (hotSearch == null) {
+			return failed("未找到对应信息");
+		}
+		return succeed(hotSearch);
+	}
+    
+    /**
+     * 查询分页
+     */
+    @PostMapping("/page")
+    @ApiOperation(value = "查询分页", notes = "传入hotSearchSearch")
+    public HttpResponseResult<PageInfo<HotSearchVo>> page(@RequestBody HotSearchSearch query) {
+		IPage<HotSearchVo> pages = hotSearchService.selectPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+	}
+    
+    /**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperation(value = "新增", notes = "传入hotSearch")
+	public HttpResponseResult save(@Valid @RequestBody HotSearch hotSearch) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || user.getId() == null) {
+			return failed("用户信息不存在");
+		}
+
+		hotSearch.setCreateOn(new Date());
+		hotSearch.setModifyOn(new Date());
+		hotSearch.setCreateBy(user.getId());
+		hotSearch.setUpdateBy(user.getId());
+		hotSearch.setStatus(YesOrNoEnum.NO);
+
+		return status(hotSearchService.save(hotSearch));
+	}
+    
+    /**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperation(value = "修改", notes = "传入hotSearch")
+	public HttpResponseResult update(@Valid @RequestBody HotSearch hotSearch) {
+		if (hotSearch.getId() == null) {
+			return failed("热门搜索id不能为空");
+		}
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || user.getId() == null) {
+			return failed("用户信息不存在");
+		}
+		hotSearch.setModifyOn(new Date());
+		hotSearch.setUpdateBy(user.getId());
+
+		return status(hotSearchService.update(hotSearch));
+	}
+
+ 	/**
+	 * 删除
+	 */
+	@PostMapping("/remove/{id}")
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public HttpResponseResult remove(@PathVariable Long id) {
+
+		if (id == null) {
+			return failed("参数错误");
+		}
+		return status(hotSearchService.removeById(id));
+	}
+
+
+	@PostMapping("/status/{id}")
+	@ApiOperation(value = "修改状态", notes = "传入ids")
+	public HttpResponseResult status(@PathVariable Long id) {
+
+		if (id == null) {
+			return failed("参数错误");
+		}
+		return status(hotSearchService.status(id));
+	}
+}

+ 23 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/HotSearchDao.java

@@ -0,0 +1,23 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.HotSearchSearch;
+import com.yonge.cooleshow.biz.dal.entity.HotSearch;
+import com.yonge.cooleshow.biz.dal.vo.HotSearchVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+public interface HotSearchDao extends BaseMapper<HotSearch> {
+
+    /**
+     * 分页
+     *
+     * @param page
+     * @param query
+     * @return
+     */
+    List<HotSearchVo> selectPage(@Param("page") IPage<HotSearchVo> page, @Param("query") HotSearchSearch query);
+}

+ 40 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/HotSearchSearch.java

@@ -0,0 +1,40 @@
+package com.yonge.cooleshow.biz.dal.dto.search;
+
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+import com.yonge.toolset.base.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-06-15
+ */
+@ApiModel("热门搜索查询条件")
+public class HotSearchSearch extends QueryInfo {
+
+    @ApiModelProperty("编号/关键词")
+    private String search;
+
+    @ApiModelProperty(value = "状态  0:停用,1:启用",dataType = "int")
+    private YesOrNoEnum status;
+
+    @Override
+    public String getSearch() {
+        return search;
+    }
+
+    @Override
+    public void setSearch(String search) {
+        this.search = search;
+    }
+
+    public YesOrNoEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(YesOrNoEnum status) {
+        this.status = status;
+    }
+}

+ 128 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/HotSearch.java

@@ -0,0 +1,128 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 热门搜索表
+ */
+@TableName("hot_search")
+@ApiModel(value = "HotSearch对象", description = "热门搜索表")
+public class HotSearch implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("关键词 ")
+    @TableField(value = "key_")
+    @NotBlank(message = "关键词不能为空")
+    private String key;
+
+    @ApiModelProperty("状态 1启用 0禁用 ")
+    @TableField(value = "status_")
+    private YesOrNoEnum status;
+
+    @ApiModelProperty("排序 ")
+    @TableField(value = "order_")
+    @NotNull(message = "排序值不能为空")
+    private Integer order;
+
+    @ApiModelProperty("创建时间 ")
+    @TableField(value = "create_on_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createOn;
+
+    @ApiModelProperty("修改时间 ")
+    @TableField(value = "modify_on_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date modifyOn;
+
+    @ApiModelProperty("创建人id ")
+    @TableField(value = "create_by_")
+    private Long createBy;
+
+    @ApiModelProperty("修改人id ")
+    @TableField(value = "update_by_")
+    private Long updateBy;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public YesOrNoEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(YesOrNoEnum status) {
+        this.status = status;
+    }
+
+    public Integer getOrder() {
+        return order;
+    }
+
+    public void setOrder(Integer order) {
+        this.order = order;
+    }
+
+    public Date getCreateOn() {
+        return createOn;
+    }
+
+    public void setCreateOn(Date createOn) {
+        this.createOn = createOn;
+    }
+
+    public Date getModifyOn() {
+        return modifyOn;
+    }
+
+    public void setModifyOn(Date modifyOn) {
+        this.modifyOn = modifyOn;
+    }
+
+    public Long getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(Long createBy) {
+        this.createBy = createBy;
+    }
+
+    public Long getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(Long updateBy) {
+        this.updateBy = updateBy;
+    }
+
+}

+ 40 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/HotSearchService.java

@@ -0,0 +1,40 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.dto.search.HotSearchSearch;
+import com.yonge.cooleshow.biz.dal.entity.HotSearch;
+import com.yonge.cooleshow.biz.dal.vo.HotSearchVo;
+
+/**
+ * 热门搜索表 服务类
+ * @author liweifan
+ * @date 2022-06-15
+ */
+public interface HotSearchService extends IService<HotSearch>  {
+
+    /**
+     * 修改热门搜索
+     *
+     * @param hotSearch
+     * @return
+     */
+    boolean update(HotSearch hotSearch);
+
+    /**
+     * 修改热门搜索的状态
+     *
+     * @param hotSearchId 热门词id
+     * @return
+     */
+    boolean status(Long hotSearchId);
+
+    /**
+     * 分页查询
+     *
+     * @param page
+     * @param query
+     * @return
+     */
+    IPage<HotSearchVo> selectPage(IPage<HotSearchVo> page, HotSearchSearch query);
+}

+ 55 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/HotSearchServiceImpl.java

@@ -0,0 +1,55 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.dao.HotSearchDao;
+import com.yonge.cooleshow.biz.dal.dto.search.HotSearchSearch;
+import com.yonge.cooleshow.biz.dal.entity.HotSearch;
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+import com.yonge.cooleshow.biz.dal.service.HotSearchService;
+import com.yonge.cooleshow.biz.dal.vo.HotSearchVo;
+import com.yonge.toolset.base.exception.BizException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+
+@Service
+public class HotSearchServiceImpl extends ServiceImpl<HotSearchDao, HotSearch> implements HotSearchService {
+    private final static Logger log = LoggerFactory.getLogger(HotSearchServiceImpl.class);
+
+
+    @Override
+    public boolean update(HotSearch hotSearch) {
+        HotSearch search = this.getById(hotSearch.getId());
+        if (search == null) {
+            throw  new BizException("热门搜索信息不存在");
+        }
+        if (YesOrNoEnum.YES.getCode().equals(search.getStatus().getCode())) {
+            throw new BizException("启用状态下不能修改");
+        }
+
+        return this.updateById(hotSearch);
+
+    }
+
+    @Override
+    public boolean status(Long hotSearchId) {
+        HotSearch search = this.getById(hotSearchId);
+        if (search == null) {
+            throw  new BizException("热门搜索信息不存在");
+        }
+
+        if (YesOrNoEnum.YES.getCode().equals(search.getStatus().getCode())) {
+            search.setStatus(YesOrNoEnum.NO);
+        } else {
+            search.setStatus(YesOrNoEnum.YES);
+        }
+        return this.updateById(search);
+    }
+
+    @Override
+    public IPage<HotSearchVo> selectPage(IPage<HotSearchVo> page, HotSearchSearch query) {
+        return page.setRecords(baseMapper.selectPage(page,query));
+    }
+}

+ 26 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/HotSearchVo.java

@@ -0,0 +1,26 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.HotSearch;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-06-15
+ */
+@ApiModel("热门搜索列表展示")
+public class HotSearchVo extends HotSearch {
+
+    @ApiModelProperty("操作人")
+    private String updateName;
+
+    public String getUpdateName() {
+        return updateName;
+    }
+
+    public void setUpdateName(String updateName) {
+        this.updateName = updateName;
+    }
+}

+ 21 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/HotSearchMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.HotSearchDao">
+
+<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.HotSearchVo">
+    select
+    hs.* ,
+        su.username_ as updateName
+    from hot_search hs
+    left join sys_user su on hs.update_by_ = su.id_
+        <where>
+            <if test="query.status != null">
+                and hs.status_ = #{query.status}
+            </if>
+            <if test="query.search != null and query.search != ''">
+                and (hs.key_ like concat('%',#{query.search},'%') or hs.id_ like concat('%',#{query.search},'%'))
+            </if>
+        </where>
+    order by  hs.order_ ,hs.id_ desc
+    </select>
+</mapper>

+ 2 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -81,7 +81,8 @@
     <sql id="QueryInfo">
         <if test="param.idAndName != null and param.idAndName != ''">
             and (t.id_ like concat('%',#{param.idAndName},'%') or
-            t.music_sheet_name_ like concat('%',#{param.idAndName},'%'))
+            t.music_sheet_name_ like concat('%',#{param.idAndName},'%') or
+            t.composer_ like concat ('%',#{param.idAndName},'%'))
         </if>
         <if test="param.musicTagIds != null and param.musicTagIds != ''">
             and

+ 0 - 11
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/MusicAlbumController.java

@@ -67,15 +67,4 @@ public class MusicAlbumController extends BaseController {
         IPage<MusicAlbumVo> albumVoIPage = musicAlbumService.favoriteAlbum(PageUtil.getPage(query), search);
         return succeed(PageUtil.pageInfo(albumVoIPage));
     }
-
-
-
-    public static void main(String[] args) {
-
-        String base64ClientCredentials = Base64.getEncoder().encodeToString((1 + ":" + 123123).getBytes());
-
-        System.out.println(base64ClientCredentials);
-        byte[] decode = Base64.getDecoder().decode(base64ClientCredentials.getBytes());
-        System.out.println(new String(decode));
-    }
 }

+ 21 - 4
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/open/OpenMusicSheetController.java

@@ -3,17 +3,16 @@ package com.yonge.cooleshow.website.controller.open;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.search.HotSearchSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.MusicAlbumSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicSheetSearch;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+import com.yonge.cooleshow.biz.dal.service.HotSearchService;
 import com.yonge.cooleshow.biz.dal.service.MusicAlbumService;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
-import com.yonge.cooleshow.biz.dal.vo.AlbumAndSheetVo;
-import com.yonge.cooleshow.biz.dal.vo.MusicAlbumVo;
-import com.yonge.cooleshow.biz.dal.vo.MusicSheetVo;
-import com.yonge.cooleshow.biz.dal.vo.MusicSheetWebsiteDetailVo;
+import com.yonge.cooleshow.biz.dal.vo.*;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.toolset.base.page.PageInfo;
@@ -23,6 +22,8 @@ import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * 曲谱表 web 控制层
  * @author yzp
@@ -42,6 +43,9 @@ public class OpenMusicSheetController extends BaseController {
     @Autowired
     private MusicAlbumService musicAlbumService;
 
+    @Autowired
+    private HotSearchService hotSearchService;
+
     /**
      * 查询单条
      */
@@ -104,4 +108,17 @@ public class OpenMusicSheetController extends BaseController {
         albumAndSheetVo.setMusicAlbumList(PageUtil.pageInfo(musicAlbumVoIPage));
         return succeed(albumAndSheetVo);
     }
+
+    @ApiOperation(value = "热门标签")
+    @GetMapping(value="/hotTag")
+    public HttpResponseResult<List<HotSearchVo>> hotTag() {
+        HotSearchSearch query = new HotSearchSearch();
+        query.setPage(1);
+        query.setRows(10);
+        query.setStatus(YesOrNoEnum.YES);
+        IPage<HotSearchVo> pages = hotSearchService.selectPage(PageUtil.getPage(query), query);
+
+        return succeed(pages.getRecords());
+    }
+
 }