|
@@ -5,12 +5,15 @@ import com.caimei365.user.model.po.CmProviders;
|
|
import com.caimei365.user.model.vo.CmProvidersVO;
|
|
import com.caimei365.user.model.vo.CmProvidersVO;
|
|
import com.caimei365.user.service.CmProvidersService;
|
|
import com.caimei365.user.service.CmProvidersService;
|
|
import com.caimei365.user.utils.BeanUtil;
|
|
import com.caimei365.user.utils.BeanUtil;
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 服务商入驻Controller
|
|
* 服务商入驻Controller
|
|
@@ -29,11 +32,12 @@ public class ProvidersController {
|
|
* 服务商入驻信息查询
|
|
* 服务商入驻信息查询
|
|
*/
|
|
*/
|
|
@GetMapping("/from")
|
|
@GetMapping("/from")
|
|
- public ResponseJson getProvidersFrom(String providersId,String providersName) {
|
|
|
|
- if (StringUtils.isBlank(providersId)&&StringUtils.isBlank(providersName)) {
|
|
|
|
- return ResponseJson.error("参数异常!");
|
|
|
|
- }
|
|
|
|
- CmProviders cmProviders = cmProvidersService.getByCmProviders(new CmProviders().setId(providersId).setName(providersName).setStatus(90));
|
|
|
|
- return ResponseJson.success(BeanUtil.setValue(cmProviders, CmProvidersVO.class));
|
|
|
|
|
|
+ public ResponseJson getProvidersFrom(String providersId,String providersName,
|
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") int pageSize
|
|
|
|
+ ) {
|
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
|
+ List<CmProviders> cmProviders = cmProvidersService.getByCmProviders(new CmProviders().setId(providersId).setName(providersName).setStatus(90));
|
|
|
|
+ return ResponseJson.success(new PageInfo<>(BeanUtil.setValues(cmProviders, CmProvidersVO.class)));
|
|
}
|
|
}
|
|
}
|
|
}
|