|
|
@@ -5,6 +5,7 @@ import com.miekir.shibei.bean.*;
|
|
|
import com.miekir.shibei.repository.GoodsRepository;
|
|
|
import com.miekir.shibei.repository.UserRepository;
|
|
|
import com.miekir.shibei.tool.RequestTool;
|
|
|
+import com.miekir.shibei.tool.StringTool;
|
|
|
import com.miekir.shibei.tool.TextUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
@@ -144,16 +145,7 @@ public class GoodsController {
|
|
|
@RequestMapping(value = "/api/getGoodsListByKeyword", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public String getGoodsListByKeyword(String keywords, int pageNum, int pageSize) {
|
|
|
- String keywordsUtf8 = null;
|
|
|
- if (!TextUtils.isEmpty(keywords)) {
|
|
|
- try {
|
|
|
- keywordsUtf8 = new String(keywords.getBytes("ISO8859-1"), "UTF-8");
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
- keywordsUtf8 = keywords;
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ String keywordsUtf8 = StringTool.getUtf8String(keywords);
|
|
|
|
|
|
ResponseResult<List<GoodsBean>> responseResult = new ResponseResult<List<GoodsBean>>();
|
|
|
responseResult.setMessage("获取失败");
|