支持分页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

@ -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);
} }
/** /**