Commit fb0d7dd5 by 朱亚洁

1002971小程序优化

parent eda1133d
......@@ -70,4 +70,12 @@ public interface AppletGroupSearchRecordBiz {
* * @param null
*/
public List<String> getHeadUrlList(Integer userNum, Long groupQrcodeId);
/**
* 用户搜索记录id
* @author:zhuyajie
* @date:2020/5/29 13:06
* * @param null
*/
List<Long> getRecordIdListByUser(Long wechatUserId);
}
\ No newline at end of file
......@@ -77,4 +77,12 @@ public interface AppletUserBookcaseBiz {
* * @param null
*/
void randomChangeBook(Long wechatUserId);
/**
* 书架id
* @author:zhuyajie
* @date:2020/5/29 13:11
* * @param null
*/
List<Long> getBookcaseIdListByUser(Long wechatUserId);
}
......@@ -236,4 +236,9 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
return statementDTOS;
}
@Override
public List<Long> getRecordIdListByUser(Long wechatUserId) {
return appletGroupSearchRecordDao.getRecordIdListByUser(wechatUserId);
}
}
\ No newline at end of file
......@@ -253,4 +253,9 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
});
}
@Override
public List<Long> getBookcaseIdListByUser(Long wechatUserId) {
return appletUserBookcaseDao.getBookcaseIdListByUser(wechatUserId);
}
}
......@@ -13,4 +13,12 @@ import java.util.List;
public interface AppletGroupSearchRecordDao extends BaseDao<AppletGroupSearchRecord> {
void deleteByIds(List<Long> ids);
/**
* 用户搜索记录id
* @author:zhuyajie
* @date:2020/5/29 13:06
* * @param null
*/
List<Long> getRecordIdListByUser(Long wechatUserId);
}
\ No newline at end of file
......@@ -67,4 +67,12 @@ public interface AppletUserBookcaseDao extends BaseDao<AppletUserBookcase> {
* * @param null
*/
List<AppletUserBookcase> getListByUserId(Long wechatUserId);
/**
* 书架id
* @author:zhuyajie
* @date:2020/5/29 13:11
* * @param null
*/
List<Long> getBookcaseIdListByUser(Long wechatUserId);
}
package com.pcloud.book.applet.dao.impl;
import com.pcloud.book.applet.entity.AppletGroupSearchRecord;
import com.pcloud.book.applet.dao.AppletGroupSearchRecordDao;
import com.pcloud.book.applet.entity.AppletGroupSearchRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
......@@ -20,4 +21,9 @@ public class AppletGroupSearchRecordDaoImpl extends BaseDaoImpl<AppletGroupSearc
public void deleteByIds(List<Long> list) {
super.sqlSessionTemplate.delete(getStatement("deleteByIds"), list);
}
@Override
public List<Long> getRecordIdListByUser(Long wechatUserId) {
return getSessionTemplate().selectList(getStatement("getRecordIdListByUser"), wechatUserId);
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.UserLastBookReDTO;
import com.pcloud.book.applet.entity.AppletUserBookcase;
import com.pcloud.book.applet.entity.AppletUserClickRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
......@@ -86,4 +87,9 @@ public class AppletUserBookcaseDaoImpl extends BaseDaoImpl<AppletUserBookcase> i
public List<AppletUserBookcase> getListByUserId(Long wechatUserId) {
return getSessionTemplate().selectList(getStatement("getListByUserId"), wechatUserId);
}
@Override
public List<Long> getBookcaseIdListByUser(Long wechatUserId) {
return getSessionTemplate().selectList(getStatement("getBookcaseIdListByUser"), wechatUserId);
}
}
......@@ -136,4 +136,14 @@ public class AppletGroupManageFacade {
}
return new ResponseDto<>(appletGroupSearchRecordBiz.getTishBookSchoolList(bookGroupId));
}
@ApiOperation("用户社群书记录id列表")
@GetMapping("getRecordIdListByUser")
public ResponseDto<?> getRecordIdListByUser(@CookieValue("userInfo") String userInfo){
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
if(!NumberUtil.isNumber(wechatUserId)){
throw BookBizException.PARAM_DELETION;
}
return new ResponseDto<>(appletGroupSearchRecordBiz.getRecordIdListByUser(wechatUserId));
}
}
\ No newline at end of file
......@@ -30,6 +30,7 @@ import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.string.StringUtil;
......@@ -809,6 +810,16 @@ public class AppletHomeFacade {
appletNewsBiz.batchUpdateNewsClassify(appletNewsClassifyVO);
return new ResponseDto<>();
}
@ApiOperation("用户已读书刊记录id列表")
@GetMapping("getBookcaseIdListByUser")
public ResponseDto<?> getBookcaseIdListByUser(@CookieValue("userInfo") String userInfo){
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
if(!NumberUtil.isNumber(wechatUserId)){
throw BookBizException.PARAM_DELETION;
}
return new ResponseDto<>(appletUserBookcaseBiz.getBookcaseIdListByUser(wechatUserId));
}
}
......
......@@ -138,9 +138,6 @@ public class SearchBizImpl implements SearchBiz {
if (StringUtil.isEmpty(searchRecord.getContent())){
throw new BookBizException(BookBizException.PARAM_IS_ERROR,"内容不能为空!");
}
if (searchRecord.getContent().length()>50){
throw new BookBizException(BookBizException.PARAM_IS_ERROR,"内容长度不能超过!");
}
searchRecordDao.insert(searchRecord);
createSearchRecordDis(searchRecord);
}
......
......@@ -128,4 +128,10 @@
</foreach>
</delete>
<select id="getRecordIdListByUser" parameterType="long" resultType="long">
SELECT DISTINCT id
FROM applet_group_search_record
WHERE wechat_user_id = #{wechatUserId}
</select>
</mapper>
\ No newline at end of file
......@@ -178,4 +178,10 @@
create_time DESC
</select>
<select id="getBookcaseIdListByUser" resultType="long" parameterType="long">
SELECT DISTINCT id
FROM applet_user_bookcase
WHERE wechat_user_id = #{wechatUserId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment