|
|
|
@ -5,6 +5,7 @@ import com.bsd.cases.service.CaseCategoryService;
|
|
|
|
|
import com.bsd.cases.util.AjaxRequest;
|
|
|
|
|
import com.bsd.cases.util.AjaxResult;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
@CrossOrigin
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/case-category")
|
|
|
|
|
public class CaseCategoryController {
|
|
|
|
@ -53,31 +55,4 @@ public class CaseCategoryController {
|
|
|
|
|
}
|
|
|
|
|
return ajaxResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/search")
|
|
|
|
|
public AjaxResult search(@RequestBody AjaxRequest ajaxRequest,HttpServletRequest request) {
|
|
|
|
|
AjaxResult ajaxResult = new AjaxResult();
|
|
|
|
|
JSONObject data = ajaxRequest.getData();
|
|
|
|
|
if (null == data){
|
|
|
|
|
ajaxResult.setRetcode(AjaxResult.FAILED);
|
|
|
|
|
ajaxResult.setRetmsg("data missing");
|
|
|
|
|
}else {
|
|
|
|
|
Integer pageNum = data.getInteger("pageNum");
|
|
|
|
|
Integer pageSize = data.getInteger("pageSize");
|
|
|
|
|
if (null==pageNum|| null == pageSize){
|
|
|
|
|
ajaxResult.setRetcode(AjaxResult.FAILED);
|
|
|
|
|
ajaxResult.setRetmsg("分页参数不可为空");
|
|
|
|
|
}else {
|
|
|
|
|
String name = data.getString("name");
|
|
|
|
|
if(StringUtils.isBlank(name)){
|
|
|
|
|
ajaxResult.setRetcode(AjaxResult.FAILED);
|
|
|
|
|
ajaxResult.setRetmsg("查询参数不可为空");
|
|
|
|
|
}else {
|
|
|
|
|
ajaxResult.setRetcode(AjaxResult.SUCCESS);
|
|
|
|
|
ajaxResult.setData(caseCategoryService.search(name,pageNum,pageSize));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ajaxResult;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|