Commit c9736f7f by 杨林龙

完成基本开发

1 parent 4482576a
......@@ -3,7 +3,7 @@ package com.glsx.controller;
import cn.com.glsx.openplatform.model.PlatformAd;
import cn.com.glsx.openplatform.service.AdMgrService;
import cn.com.glsx.openplatform.vo.R;
import com.github.pagehelper.Page;
import cn.hutool.db.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
......@@ -30,13 +30,8 @@ public class AdMgrController {
@RequestMapping(value = "/getAdMgrList", method = RequestMethod.GET)
@ResponseBody
public R getAdMgrList(Pagination pagination) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformAd> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformAd> adMgrList = adMgrService.getAdMgrList();
return R.ok().putPageData(page, adMgrList);
public R getAdMgrList(Page page) {
return adMgrService.getAdMgrList(page);
}
@RequestMapping(value = "/insertAd", method = RequestMethod.POST)
......
......@@ -4,7 +4,7 @@ import cn.com.glsx.openplatform.model.PlatformApiCall;
import cn.com.glsx.openplatform.service.ApiCallMgrService;
import cn.com.glsx.openplatform.vo.ApiCallVo;
import cn.com.glsx.openplatform.vo.R;
import com.github.pagehelper.Page;
import cn.hutool.db.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
......@@ -31,12 +31,7 @@ public class ApiCallMgrController {
@RequestMapping(value = "/getApiCallMgrList", method = RequestMethod.GET)
@ResponseBody
public R getApiCallMgrList(Pagination pagination, ApiCallVo apiCallVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformApiCall> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformApiCall> apiMgrList = apiCallMgrService.getApiCallMgrList(apiCallVo);
return R.ok().putPageData(page, apiMgrList);
public R getApiCallMgrList(Page page, ApiCallVo apiCallVo) {
return apiCallMgrService.getApiCallMgrList(page,apiCallVo);
}
}
......@@ -3,9 +3,8 @@ package com.glsx.controller;
import cn.com.glsx.openplatform.model.PlatformApi;
import cn.com.glsx.openplatform.service.ApiMgrService;
import cn.com.glsx.openplatform.vo.R;
import com.github.pagehelper.Page;
import cn.hutool.db.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,13 +29,8 @@ public class ApiMgrController {
@RequestMapping(value = "/getApiMgrList", method = RequestMethod.GET)
@ResponseBody
public R getApiMgrList(Pagination pagination) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformApi> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformApi> apiMgrList = apiMgrService.getApiMgrList();
return R.ok().putPageData(page, apiMgrList);
public R getApiMgrList(Page page) {
return apiMgrService.getApiMgrList(page);
}
@RequestMapping(value = "/startandstop", method = RequestMethod.GET)
......
......@@ -3,9 +3,8 @@ package com.glsx.controller;
import cn.com.glsx.openplatform.model.PlatformCustomer;
import cn.com.glsx.openplatform.service.CustomerMgrService;
import cn.com.glsx.openplatform.vo.R;
import com.github.pagehelper.Page;
import cn.hutool.db.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,13 +29,8 @@ public class CustomerMgrController {
@RequestMapping(value = "/getCustomerMgrList", method = RequestMethod.GET)
@ResponseBody
public R getCustomerMgrList(Pagination pagination) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformCustomer> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformCustomer> customerMgrList = customerMgrService.getCustomerMgrList();
return R.ok().putPageData(page, customerMgrList);
public R getCustomerMgrList(Page page) {
return customerMgrService.getCustomerMgrList(page);
}
@RequestMapping(value = "/reset", method = RequestMethod.GET)
......
......@@ -3,13 +3,11 @@ package com.glsx.controller;
import java.util.HashMap;
import java.util.List;
import cn.com.glsx.openplatform.model.PlatformDevice;
import cn.com.glsx.openplatform.service.DeviceMgrService;
import cn.com.glsx.openplatform.vo.DeviceVo;
import cn.com.glsx.openplatform.vo.R;
import com.github.pagehelper.Page;
import cn.hutool.db.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -32,14 +30,8 @@ public class DeviceMgrController {
@RequestMapping(value = "/getDeviceMgrList", method = RequestMethod.GET)
@ResponseBody
public R getDeviceMgrList(Pagination pagination, DeviceVo deviceVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformDevice> page = PageHelper.startPage(pagination.getCurrentPage(),
pagination.getPageSize(), true);
List<PlatformDevice> deviceMgrList = deviceMgrService.getDeviceMgrList(deviceVo);
return R.ok().putPageData(page, deviceMgrList);
public R getDeviceMgrList(Page page, DeviceVo deviceVo) {
return deviceMgrService.getDeviceMgrList(page,deviceVo);
}
@RequestMapping(value = "/getDropDownOptions", method = RequestMethod.GET)
......
......@@ -6,9 +6,8 @@ import cn.com.glsx.openplatform.model.PlatformUser;
import cn.com.glsx.openplatform.service.UserMgrService;
import cn.com.glsx.openplatform.vo.R;
import cn.com.glsx.openplatform.vo.UserVo;
import com.github.pagehelper.Page;
import cn.hutool.db.Page;
import com.github.pagehelper.PageHelper;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -31,14 +30,8 @@ public class UserMgrController {
@RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET)
@ResponseBody
public R getUserMgrList(Pagination pagination, UserVo userVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformUser> page = PageHelper.startPage(pagination.getCurrentPage(),
pagination.getPageSize(), true);
List<PlatformUser> userMgrList = userMgrService.getUserMgrList(userVo);
return R.ok().putPageData(page, userMgrList);
public R getUserMgrList(Page page, UserVo userVo) {
return userMgrService.getUserMgrList(page, userVo);
}
@RequestMapping(value = "/getDropDownOptions", method = RequestMethod.GET)
......
......@@ -26,7 +26,7 @@ public class CORSFilter implements Filter {
LOGGER.info("当前访问来源是:{}", httpServletRequest.getHeader("Content-Type"));
// 从列表中获取,可以将数据放入缓存
// String corsOriginList = PropertyConfigurer.getString("cors.origin.list.urls");
String corsOriginList = "http://192.168.2.68:8081/";
String corsOriginList = "http://192.168.2.68:8081/ http://192.168.2.106:8081/";
LOGGER.info("配置的来源:{}", corsOriginList);
if (StringUtils.isNotBlank(curOrigin) && corsOriginList.contains(curOrigin)) {
httpServletResponse.setHeader("Access-Control-Allow-Origin", curOrigin);
......
......@@ -7,8 +7,8 @@ server.servlet.application-display-name=open-platform-admin
logging.config=classpath:logback.xml
logging.path=/data/java_log/jetty/open-platform-admin/open-platform-admin.log
#logging.level.com.glsx=DEBUG
logging.level.com.glsx=INFO
logging.level.com.glsx=DEBUG
#logging.level.com.glsx=INFO
ore.starter.class-name=Main
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!