增加下载数,页面跳转、展示优化
This commit is contained in:
@@ -22,6 +22,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
@Aspect
|
||||
@@ -47,7 +48,8 @@ public class AuthAspect {
|
||||
} else if (returnType.isAssignableFrom(ModelAndView.class)) {
|
||||
HttpServletRequest request = ThreadLocalUtil.getHttpServletRequest();
|
||||
StringBuffer requestURL = request.getRequestURL();
|
||||
return new ModelAndView("redirect:/static/manage/login.html?returnUrl=" + requestURL);
|
||||
String requestURLStr = URLEncoder.encode(requestURL.toString(), "utf-8");
|
||||
return new ModelAndView("redirect:/static/manage/login.html?redirect=" + requestURLStr);
|
||||
} else if (returnType.isAssignableFrom(Map.class)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
|
||||
@@ -79,6 +79,11 @@ public class WikiPageFile implements Serializable {
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 下载次数
|
||||
*/
|
||||
private Integer downloadNum;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -181,4 +186,12 @@ public class WikiPageFile implements Serializable {
|
||||
", delFlag=" + delFlag +
|
||||
"}";
|
||||
}
|
||||
|
||||
public Integer getDownloadNum() {
|
||||
return downloadNum;
|
||||
}
|
||||
|
||||
public void setDownloadNum(Integer downloadNum) {
|
||||
this.downloadNum = downloadNum;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,19 @@ package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 暮光:城中城
|
||||
* @since 2019-03-06
|
||||
*/
|
||||
public interface WikiPageFileMapper extends BaseMapper<WikiPageFile> {
|
||||
|
||||
|
||||
@Update("update wiki_page_file set download_num=download_num+1 where id=#{id}")
|
||||
void addDownloadNum(@Param("id") Long id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user