支持分页header参数+小程序端商城list

This commit is contained in:
yangdanqi 2022-05-10 23:06:04 +08:00
parent dc94c472cb
commit b84cc19a3c
3 changed files with 16 additions and 12 deletions

View File

@ -8,7 +8,6 @@ import com.ghy.common.core.page.TableDataInfo;
import com.ghy.common.enums.BusinessType; import com.ghy.common.enums.BusinessType;
import com.ghy.common.utils.ShiroUtils; import com.ghy.common.utils.ShiroUtils;
import com.ghy.common.utils.poi.ExcelUtil; import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.goods.domain.DeptGoodsCategory;
import com.ghy.goods.domain.Goods; import com.ghy.goods.domain.Goods;
import com.ghy.goods.service.DeptGoodsCategoryService; import com.ghy.goods.service.DeptGoodsCategoryService;
import com.ghy.goods.service.GoodsService; import com.ghy.goods.service.GoodsService;
@ -38,7 +37,7 @@ public class GoodsController extends BaseController {
return PREFIX + "/goods"; return PREFIX + "/goods";
} }
@RequiresPermissions("goods:goods:list") // @RequiresPermissions("goods:goods:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(Goods goods) { public TableDataInfo list(Goods goods) {

View File

@ -11,7 +11,7 @@ import com.ghy.common.core.text.Convert;
/** /**
* 客户端工具类 * 客户端工具类
* *
* @author clunt * @author clunt
*/ */
public class ServletUtils public class ServletUtils
@ -26,7 +26,7 @@ public class ServletUtils
*/ */
public static String getParameter(String name) public static String getParameter(String name)
{ {
return getRequest().getParameter(name); return StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name);
} }
/** /**
@ -34,7 +34,8 @@ public class ServletUtils
*/ */
public static String getParameter(String name, String defaultValue) public static String getParameter(String name, String defaultValue)
{ {
return Convert.toStr(getRequest().getParameter(name), defaultValue); String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name);
return Convert.toStr(value, defaultValue);
} }
/** /**
@ -42,7 +43,8 @@ public class ServletUtils
*/ */
public static Integer getParameterToInt(String name) public static Integer getParameterToInt(String name)
{ {
return Convert.toInt(getRequest().getParameter(name)); String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name);
return Convert.toInt(value);
} }
/** /**
@ -50,7 +52,8 @@ public class ServletUtils
*/ */
public static Integer getParameterToInt(String name, Integer defaultValue) public static Integer getParameterToInt(String name, Integer defaultValue)
{ {
return Convert.toInt(getRequest().getParameter(name), defaultValue); String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name);
return Convert.toInt(value, defaultValue);
} }
/** /**
@ -58,7 +61,8 @@ public class ServletUtils
*/ */
public static Boolean getParameterToBool(String name) public static Boolean getParameterToBool(String name)
{ {
return Convert.toBool(getRequest().getParameter(name)); String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name);
return Convert.toBool(value);
} }
/** /**
@ -66,7 +70,8 @@ public class ServletUtils
*/ */
public static Boolean getParameterToBool(String name, Boolean defaultValue) public static Boolean getParameterToBool(String name, Boolean defaultValue)
{ {
return Convert.toBool(getRequest().getParameter(name), defaultValue); String value = StringUtils.isNotEmpty(getRequest().getHeader(name)) ? getRequest().getHeader(name):getRequest().getParameter(name);
return Convert.toBool(value, defaultValue);
} }
/** /**
@ -101,7 +106,7 @@ public class ServletUtils
/** /**
* 将字符串渲染到客户端 * 将字符串渲染到客户端
* *
* @param response 渲染对象 * @param response 渲染对象
* @param string 待渲染的字符串 * @param string 待渲染的字符串
* @return null * @return null
@ -123,7 +128,7 @@ public class ServletUtils
/** /**
* 是否是Ajax异步请求 * 是否是Ajax异步请求
* *
* @param request * @param request
*/ */
public static boolean isAjaxRequest(HttpServletRequest request) public static boolean isAjaxRequest(HttpServletRequest request)

View File

@ -39,7 +39,7 @@ import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
/** /**
* 权限配置加载 * 权限配置加载
* *
* @author clunt * @author clunt
*/ */
@Configuration @Configuration