当前位置: 移动技术网 > IT编程>开发语言>Java > ceshi

ceshi

2018年12月10日  | 移动技术网IT编程  | 我要评论
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);
}
}

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网