package com.leyou.search.controller;
import com.leyou.common.pojo.pageresult;
import com.leyou.search.pojo.goods;
import com.leyou.search.pojo.searchrequest;
import com.leyou.search.service.searchservice;
import org.springframework.beans.factory.annotation.autowired;
import org.springframework.http.responseentity;
import org.springframework.stereotype.controller;
import org.springframework.util.collectionutils;
import org.springframework.web.bind.annotation.postmapping;
import org.springframework.web.bind.annotation.requestbody;
@controller
public class searchcontroller {
@autowired
private searchservice searchservice;
@postmapping("page")
public responseentity<pageresult<goods>> search(@requestbody searchrequest request){
pageresult<goods> result = this.searchservice.search(request);
if (result == null || collectionutils.isempty(result.getitems())) {
return responseentity.notfound().build();
}
return responseentity.ok(result);
}
}
如对本文有疑问, 点击进行留言回复!!
Mybatis PersistenceException异常:Error building SqlSession The error may exist in SQL Mapper Configur
MyBatis——动态SQL语句——if标签和where标签复合使用
网友评论