Commit 1a837179 by 杨林龙

完成基本开发

1 parent a09cea1b
Showing 50 changed files with 196 additions and 2898 deletions
......@@ -22,49 +22,49 @@
</properties>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.75</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>1.2.75</version>-->
<!-- </dependency>-->
<!--lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.projectlombok</groupId>-->
<!-- <artifactId>lombok</artifactId>-->
<!-- <version>1.18.12</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!--swagger 文档-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger2.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger2</artifactId>-->
<!-- <version>${swagger2.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger-ui</artifactId>-->
<!-- <version>${swagger2.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.2.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.pagehelper</groupId>-->
<!-- <artifactId>pagehelper</artifactId>-->
<!-- <version>5.2.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.5.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.hutool</groupId>-->
<!-- <artifactId>hutool-all</artifactId>-->
<!-- <version>5.5.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>2.4.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.data</groupId>-->
<!-- <artifactId>spring-data-commons</artifactId>-->
<!-- <version>2.4.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>cn.com.glsx.openplatform</groupId>
......
......@@ -5,7 +5,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author deployer name
......@@ -15,11 +14,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@EnableAsync
@SpringBootApplication
@ServletComponentScan
@EnableSwagger2
//@MapperScan(basePackages = {"com.glsx.mapper"})
//@EnableSwagger2
public class Main extends AbsOreBootStarter {
@Override
......
package com.glsx.config;
import cn.com.glsx.openplatform.service.*;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author deployer name
* @version V1.0
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 注册远程服务(示例)
* RpcRemote为需要调用的远程服务
* @return
*/
@Autowired
private ReferenceBuilderFactory referenceBuilderFactory;
// -------- DUBBO COMMON CONFIG ----------
private static final Integer DUBBO_SERVICE_TIMEOUT = 100000;
// -------- DUBBO VERSION CONFIG ----------
private static final String COMMON_DUBBO_VERSION = "1.0.0";
private static final String SERVICEPACKAGE_DUBBO_VERSION = "2.0.0";
private static final String ACCOUNT_SERVICE_VERSION = "2.2.0";
private static final boolean dubboUnCheck = false;
private static final boolean dubboCheck = true;
/**
* 注册远程服务(示例)
* RpcRemote为需要调用的远程服务
*
* @return
*/
/*@Bean
public RpcRemote rpcApiMethodRemote(){
return factory.builder(RpcRemote.class).check(false).timeout(30000).build();
}*/
@Bean
public AdMgrService adMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public ApiCallMgrService apiCallMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(ApiCallMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public ApiMgrService apiMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(ApiMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public AppDownloadMgrService appDownloadMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(AppDownloadMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public CustomerMgrService customerMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(CustomerMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public DeviceMgrService deviceMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(DeviceMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public IndexService indexService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(IndexService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
@Bean
public UserMgrService userMgrService() {
// return referenceBuilderFactory.builder(AdMgrService.class).check(false).timeout(30000).build();
return referenceBuilderFactory.builder(UserMgrService.class).check(false).timeout(30000).url("dubbo://localhost:20882").build();
}
}
package com.glsx.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.glsx.controller"))
.paths(PathSelectors.any())
.build()
.apiInfo(apiEndPointsInfo())
.useDefaultResponseMessages(false);
}
private ApiInfo apiEndPointsInfo() {
return new ApiInfoBuilder().title("Sys REST API")
.description("接口描述")
.contact(new Contact("Zhangln", "https://code.aliyun.com/yidingv3/kwafoo", "zhangln@zhidianfan.com"))
.license("edingyi")
.licenseUrl("http://www.edingyi.com")
.version("V1")
.build();
}
}
//package com.glsx.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.Contact;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
//@Configuration
//@EnableSwagger2
//public class SwaggerConfig {
// @Bean
// public Docket api() {
// return new Docket(DocumentationType.SWAGGER_2)
// .select()
// .apis(RequestHandlerSelectors.basePackage("com.glsx.controller"))
// .paths(PathSelectors.any())
// .build()
// .apiInfo(apiEndPointsInfo())
// .useDefaultResponseMessages(false);
// }
//
// private ApiInfo apiEndPointsInfo() {
// return new ApiInfoBuilder().title("Sys REST API")
// .description("接口描述")
// .contact(new Contact("Zhangln", "https://code.aliyun.com/yidingv3/kwafoo", "zhangln@zhidianfan.com"))
// .license("edingyi")
// .licenseUrl("http://www.edingyi.com")
// .version("V1")
// .build();
// }
//}
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 com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformAd;
import com.glsx.model.PlatformApiCall;
import com.glsx.service.AdMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
//@Api
@RestController
@RequestMapping(value = "/admgr")
public class AdMgrController {
......
package com.glsx.controller;
import java.util.List;
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 com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformApiCall;
import com.glsx.service.ApiCallMgrService;
import com.glsx.vo.ApiCallVo;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,7 +15,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Api
import java.util.List;
//@Api
@RestController
@RequestMapping(value = "/apicallmgr")
public class ApiCallMgrController {
......@@ -30,9 +31,9 @@ public class ApiCallMgrController {
@RequestMapping(value = "/getApiCallMgrList", method = RequestMethod.GET)
@ResponseBody
public R getApiCallMgrList(ApiCallVo apiCallVo) {
public R getApiCallMgrList(Pagination pagination, ApiCallVo apiCallVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformApiCall> page = PageHelper.startPage(apiCallVo.getCurrentPage(), apiCallVo.getPageSize(), true);
Page<PlatformApiCall> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformApiCall> apiMgrList = apiCallMgrService.getApiCallMgrList(apiCallVo);
......
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 com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformApi;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.ApiMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
//@Api
@RestController
@RequestMapping(value = "/apimgr")
public class ApiMgrController {
......
package com.glsx.controller;
import com.glsx.service.AppDownloadMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import cn.com.glsx.openplatform.service.AppDownloadMgrService;
import cn.com.glsx.openplatform.vo.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -13,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Api
//@Api
@RestController
@RequestMapping(value = "/appdownloadmgr")
public class AppDownloadMgrController {
......
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 com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformCustomer;
import com.glsx.model.PlatformUser;
import com.glsx.service.CustomerMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
//@Api
@RestController
@RequestMapping(value = "/customermgr")
public class CustomerMgrController {
......
......@@ -2,13 +2,14 @@ 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 com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformDevice;
import com.glsx.service.DeviceMgrService;
import com.glsx.vo.DeviceVo;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Api
//@Api
@RestController
@RequestMapping(value = "/devicemgr")
public class DeviceMgrController {
......@@ -31,10 +32,10 @@ public class DeviceMgrController {
@RequestMapping(value = "/getDeviceMgrList", method = RequestMethod.GET)
@ResponseBody
public R getDeviceMgrList(DeviceVo deviceVo) {
public R getDeviceMgrList(Pagination pagination, DeviceVo deviceVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformDevice> page = PageHelper.startPage(deviceVo.getCurrentPage(),
deviceVo.getPageSize(), true);
Page<PlatformDevice> page = PageHelper.startPage(pagination.getCurrentPage(),
pagination.getPageSize(), true);
List<PlatformDevice> deviceMgrList = deviceMgrService.getDeviceMgrList(deviceVo);
......
package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformUser;
import com.glsx.service.*;
import com.glsx.vo.R;
import com.glsx.vo.UserVo;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import cn.com.glsx.openplatform.service.*;
import cn.com.glsx.openplatform.vo.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,7 +22,7 @@ import java.util.Map;
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Api
//@Api
@RestController
@RequestMapping(value = "/index")
public class IndexController {
......
package com.glsx.controller;
import java.util.List;
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 com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformUser;
import com.glsx.service.UserMgrService;
import com.glsx.vo.R;
import com.glsx.vo.UserVo;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Api
//@Api
@RestController
@RequestMapping(value = "/usermgr")
public class UserMgrController {
......@@ -30,10 +31,10 @@ public class UserMgrController {
@RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET)
@ResponseBody
public R getUserMgrList(UserVo userVo) {
public R getUserMgrList(Pagination pagination, UserVo userVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformUser> page = PageHelper.startPage(userVo.getCurrentPage(),
userVo.getPageSize(), true);
Page<PlatformUser> page = PageHelper.startPage(pagination.getCurrentPage(),
pagination.getPageSize(), true);
List<PlatformUser> userMgrList = userMgrService.getUserMgrList(userVo);
......
package com.glsx.enums;
import com.glsx.exception.BusinessException;
/**
* <p>Description:
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
public enum ResultCodeEnum {
SUCCESS(200, "成功"),
SERVER_ERROR(500, "系统异常"),
;
private final Integer code;
private final String msg;
ResultCodeEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
public BusinessException exception() {
return new BusinessException(this.code, this.msg);
}
}
package com.glsx.exception;
/**
* <p>Description: 业务异常
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
public class BusinessException extends RuntimeException {
private Integer code;
private String message;
public BusinessException() {}
public BusinessException(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String getMessage() {
return this.message;
}
}
package com.glsx.exception;
import com.glsx.enums.ResultCodeEnum;
import com.glsx.vo.R;
import cn.com.glsx.openplatform.enums.ResultCodeEnum;
import cn.com.glsx.openplatform.exception.BusinessException;
import cn.com.glsx.openplatform.vo.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
......
package com.glsx.mapper;
import com.glsx.model.PlatformAd;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformAdMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformAd record);
int insertOrUpdate(PlatformAd record);
int insertOrUpdateSelective(PlatformAd record);
int insertSelective(PlatformAd record);
PlatformAd selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformAd record);
int updateByPrimaryKey(PlatformAd record);
int updateBatch(List<PlatformAd> list);
int updateBatchSelective(List<PlatformAd> list);
List<PlatformAd> getAdMgrList();
}
\ No newline at end of file
package com.glsx.mapper;
import com.glsx.model.PlatformApiCall;
import com.glsx.vo.ApiCallVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformApiCallMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformApiCall record);
int insertOrUpdate(PlatformApiCall record);
int insertOrUpdateSelective(PlatformApiCall record);
int insertSelective(PlatformApiCall record);
PlatformApiCall selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformApiCall record);
int updateByPrimaryKey(PlatformApiCall record);
int updateBatch(List<PlatformApiCall> list);
int updateBatchSelective(List<PlatformApiCall> list);
List<PlatformApiCall> getApiCallMgrList(ApiCallVo apiCallVo);
int getApiCallCount();
List<Map<String, Integer>> getApiCallGraphData();
List<Map<String, Integer>> getApiCallTrendList();
}
\ No newline at end of file
package com.glsx.mapper;
import java.util.List;
import com.glsx.model.PlatformApi;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformApiMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformApi record);
int insertOrUpdate(PlatformApi record);
int insertOrUpdateSelective(PlatformApi record);
int insertSelective(PlatformApi record);
PlatformApi selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformApi record);
int updateByPrimaryKey(PlatformApi record);
int updateBatch(List<PlatformApi> list);
int updateBatchSelective(List<PlatformApi> list);
List<PlatformApi> getApiMgrList();
}
\ No newline at end of file
package com.glsx.mapper;
import com.glsx.model.PlatformAppDownload;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformAppDownloadMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformAppDownload record);
int insertOrUpdate(PlatformAppDownload record);
int insertOrUpdateSelective(PlatformAppDownload record);
int insertSelective(PlatformAppDownload record);
PlatformAppDownload selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformAppDownload record);
int updateByPrimaryKey(PlatformAppDownload record);
int updateBatch(List<PlatformAppDownload> list);
int updateBatchSelective(List<PlatformAppDownload> list);
int getApiCallCountAuth(@Param("customerName") String customerName);
List<Map<String, Object>> getAppDownloadStatistic(@Param("startTime") Date startTime,
@Param("endTime") Date endTime, @Param("customerName") String customerName);
}
\ No newline at end of file
package com.glsx.mapper;
import com.glsx.model.PlatformCustomer;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformCustomerMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformCustomer record);
int insertOrUpdate(PlatformCustomer record);
int insertOrUpdateSelective(PlatformCustomer record);
int insertSelective(PlatformCustomer record);
PlatformCustomer selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformCustomer record);
int updateByPrimaryKey(PlatformCustomer record);
int updateBatch(List<PlatformCustomer> list);
int updateBatchSelective(List<PlatformCustomer> list);
List<PlatformCustomer> getCustomerMgrList();
List<String> getCustomerNameList();
int getCustomerCount();
int login(PlatformCustomer customer);
}
\ No newline at end of file
package com.glsx.mapper;
import com.glsx.model.PlatformDevice;
import com.glsx.vo.DeviceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformDeviceMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformDevice record);
int insertOrUpdate(PlatformDevice record);
int insertOrUpdateSelective(PlatformDevice record);
int insertSelective(PlatformDevice record);
PlatformDevice selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformDevice record);
int updateByPrimaryKey(PlatformDevice record);
int updateBatch(List<PlatformDevice> list);
int updateBatchSelective(List<PlatformDevice> list);
List<PlatformDevice> getDeviceMgrList(DeviceVo deviceVo);
List<String> getDeviceTypeList();
int getDeviceCount();
Map<String, Integer> getDeviceGraphData();
int getDeviceCountAuth(@Param("customerName") String customerName);
List<Map<String, Integer>> getDeviceAccessTrendList();
List<Map<String, Object>> getDeviceActivationStatistic(@Param("startTime") Date startTime,
@Param("endTime") Date endTime, @Param("customerName") String customerName);
}
\ No newline at end of file
package com.glsx.mapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.glsx.model.PlatformUser;
import com.glsx.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
@Mapper
public interface PlatformUserMapper {
int deleteByPrimaryKey(Integer id);
int insert(PlatformUser record);
int insertOrUpdate(PlatformUser record);
int insertOrUpdateSelective(PlatformUser record);
int insertSelective(PlatformUser record);
PlatformUser selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PlatformUser record);
int updateByPrimaryKey(PlatformUser record);
int updateBatch(List<PlatformUser> list);
int updateBatchSelective(List<PlatformUser> list);
List<PlatformUser> getUserMgrList(UserVo userVo);
int getUserCount();
int getUserCountAuth(@Param("customerName") String customerName);
List<Map<String, Object>> getUserActivityStatistic(@Param("startTime") Date startTime,
@Param("endTime") Date endTime, @Param("customerName") String customerName);
}
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 广告管理表
*/
public class PlatformAd implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* 标题
*/
private String title;
/**
* 图片
*/
private String image;
/**
* 位置 1 商城banner 2 智能-家 3 启动页
*/
private Byte position;
/**
* 界面类型 1 APP 2 H5
*/
private Byte interfaceType;
/**
* 界面参数
*/
private String interfaceUrl;
/**
* 是否上架 0 下架 1 上架
*/
private Integer status;
/**
* 创建时间 添加时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Byte getPosition() {
return position;
}
public void setPosition(Byte position) {
this.position = position;
}
public Byte getInterfaceType() {
return interfaceType;
}
public void setInterfaceType(Byte interfaceType) {
this.interfaceType = interfaceType;
}
public String getInterfaceUrl() {
return interfaceUrl;
}
public void setInterfaceUrl(String interfaceUrl) {
this.interfaceUrl = interfaceUrl;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", title=").append(title);
sb.append(", image=").append(image);
sb.append(", position=").append(position);
sb.append(", interfaceType=").append(interfaceType);
sb.append(", interfaceUrl=").append(interfaceUrl);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", createBy=").append(createBy);
sb.append(", updateBy=").append(updateBy);
sb.append(", remark=").append(remark);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* api管理表
*/
public class PlatformApi implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* API分类 1 授权管理 2 设备管理 3 数据服务
*/
private Integer apiClassification;
/**
* API名称
*/
private String apiName;
/**
* 请求方式 1 GET 2 POST
*/
private Integer requestMethod;
/**
* API接口
*/
private String apiInterface;
/**
* 说明
*/
private String description;
/**
* 状态 0 停用 1 可用
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getApiClassification() {
return apiClassification;
}
public void setApiClassification(Integer apiClassification) {
this.apiClassification = apiClassification;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public Integer getRequestMethod() {
return requestMethod;
}
public void setRequestMethod(Integer requestMethod) {
this.requestMethod = requestMethod;
}
public String getApiInterface() {
return apiInterface;
}
public void setApiInterface(String apiInterface) {
this.apiInterface = apiInterface;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", apiClassification=").append(apiClassification);
sb.append(", apiName=").append(apiName);
sb.append(", requestMethod=").append(requestMethod);
sb.append(", apiInterface=").append(apiInterface);
sb.append(", description=").append(description);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", createBy=").append(createBy);
sb.append(", updateBy=").append(updateBy);
sb.append(", remark=").append(remark);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* api调用表
*/
public class PlatformApiCall implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* 客户id t_platform_customer表的id
*/
private Integer customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 调用API id t_platform_api 的id
*/
private Integer apiId;
/**
* API名称
*/
private String apiName;
/**
* 调用结果 0 失败 1 成功
*/
private Integer callResult;
/**
* 创建时间 访问时间
*/
private Date createTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
public Integer getApiId() {
return apiId;
}
public void setApiId(Integer apiId) {
this.apiId = apiId;
}
public Integer getCallResult() {
return callResult;
}
public void setCallResult(Integer callResult) {
this.callResult = callResult;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
@Override
public String toString() {
return "PlatformApiCall{" +
"id=" + id +
", customerId=" + customerId +
", customerName='" + customerName + '\'' +
", apiId=" + apiId +
", apiName='" + apiName + '\'' +
", callResult=" + callResult +
", createTime=" + createTime +
", createBy=" + createBy +
", remark='" + remark + '\'' +
'}';
}
}
\ No newline at end of file
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* APP下载数量表
*/
public class PlatformAppDownload implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* 客户id t_platform_customer表的id
*/
private Integer customerId;
/**
* 创建时间 下载时间
*/
private Date createTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", customerId=").append(customerId);
sb.append(", createTime=").append(createTime);
sb.append(", createBy=").append(createBy);
sb.append(", remark=").append(remark);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 客户管理表
*/
public class PlatformCustomer implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* 客户名称
*/
private String customerName;
/**
* 联系人
*/
private String contactPerson;
/**
* 密码
*/
private String password;
/**
* 联系电话
*/
private String contactNumber;
/**
* 联系邮箱
*/
private String contactEmail;
/**
* 省份 sys_area的id
*/
private Integer province;
/**
* 城市 sys_area的id
*/
private Integer city;
/**
* 城市 sys_area的id
*/
private Integer Area;
/**
* 详细地址
*/
private String address;
/**
* 账号状态 0 停用 1 正常 2 待审核 3 审核未通过
*/
private Integer status;
/**
* 公钥
*/
private String publicKey;
/**
* 私钥
*/
private String privateKey;
/**
* 渠道号
*/
private String channelNumber;
/**
* 创建d时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getContactPerson() {
return contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
public String getContactEmail() {
return contactEmail;
}
public void setContactEmail(String contactEmail) {
this.contactEmail = contactEmail;
}
public Integer getProvince() {
return province;
}
public void setProvince(Integer province) {
this.province = province;
}
public Integer getCity() {
return city;
}
public void setCity(Integer city) {
this.city = city;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getPublicKey() {
return publicKey;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
public String getPrivateKey() {
return privateKey;
}
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
public String getChannelNumber() {
return channelNumber;
}
public void setChannelNumber(String channelNumber) {
this.channelNumber = channelNumber;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getArea() {
return Area;
}
public void setArea(Integer area) {
Area = area;
}
@Override
public String toString() {
return "PlatformCustomer{" +
"id=" + id +
", customerName='" + customerName + '\'' +
", contactPerson='" + contactPerson + '\'' +
", password='" + password + '\'' +
", contactNumber='" + contactNumber + '\'' +
", contactEmail='" + contactEmail + '\'' +
", province=" + province +
", city=" + city +
", Area=" + Area +
", address='" + address + '\'' +
", status=" + status +
", publicKey='" + publicKey + '\'' +
", privateKey='" + privateKey + '\'' +
", channelNumber='" + channelNumber + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createBy=" + createBy +
", updateBy=" + updateBy +
", remark='" + remark + '\'' +
'}';
}
}
\ No newline at end of file
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 设备管理表
*/
public class PlatformDevice implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* 设备SN
*/
private String deviceSn;
/**
* 类型
*/
private String deviceType;
/**
* 客户id t_platform_customer表的id
*/
private Integer customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 激活时间
*/
private Date activatTime;
/**
* 设备状态 0 异常 1 正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 备注
*/
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDeviceSn() {
return deviceSn;
}
public void setDeviceSn(String deviceSn) {
this.deviceSn = deviceSn;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
public Date getActivatTime() {
return activatTime;
}
public void setActivatTime(Date activatTime) {
this.activatTime = activatTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
@Override
public String toString() {
return "PlatformDevice{" +
"id=" + id +
", deviceSn='" + deviceSn + '\'' +
", deviceType='" + deviceType + '\'' +
", customerId=" + customerId +
", customerName='" + customerName + '\'' +
", activatTime=" + activatTime +
", status=" + status +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createBy=" + createBy +
", updateBy=" + updateBy +
", remark='" + remark + '\'' +
'}';
}
}
\ No newline at end of file
package com.glsx.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 用户管理表
*/
public class PlatformUser implements Serializable {
/**
* 客户名称
*/
private String customerName;
/**
* 省份名称
*/
private String provinceName;
/**
* 城市名称
*/
private String cityName;
/**
* 主键
*/
private Integer id;
/**
* 昵称,账号
*/
private String nickname;
/**
* 联系电话
*/
private String contactNumber;
/**
* 微信ID
*/
private String wechatId;
/**
* 省份 sys_area的id
*/
private Integer province;
/**
* 城市 sys_area的id
*/
private Integer city;
/**
* 客户id t_platform_customer表的id
*/
private Integer customerId;
/**
* 最后登录时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
/**
* APP 账户ID
*/
private Integer appAccountId;
/**
* 创建时间 注册时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
/**
* 备注
*/
private String remark;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
public String getWechatId() {
return wechatId;
}
public void setWechatId(String wechatId) {
this.wechatId = wechatId;
}
public Integer getProvince() {
return province;
}
public void setProvince(Integer province) {
this.province = province;
}
public Integer getCity() {
return city;
}
public void setCity(Integer city) {
this.city = city;
}
public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId) {
this.customerId = customerId;
}
public Date getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(Date lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public Integer getAppAccountId() {
return appAccountId;
}
public void setAppAccountId(Integer appAccountId) {
this.appAccountId = appAccountId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "PlatformUser{" +
"customerName='" + customerName + '\'' +
", provinceName='" + provinceName + '\'' +
", cityName='" + cityName + '\'' +
", id=" + id +
", nickname='" + nickname + '\'' +
", contactNumber='" + contactNumber + '\'' +
", wechatId='" + wechatId + '\'' +
", province=" + province +
", city=" + city +
", customerId=" + customerId +
", lastLoginTime=" + lastLoginTime +
", appAccountId=" + appAccountId +
", createTime=" + createTime +
", updateTime=" + updateTime +
", createBy=" + createBy +
", updateBy=" + updateBy +
", remark='" + remark + '\'' +
'}';
}
}
package com.glsx.service;
import com.glsx.model.PlatformAd;
import java.util.List;
public interface AdMgrService {
List<PlatformAd> getAdMgrList();
int insertAd(PlatformAd ad);
int updateAd(PlatformAd ad);
int startandstop(int id, int status);
}
package com.glsx.service;
import com.glsx.model.PlatformApiCall;
import com.glsx.vo.ApiCallVo;
import java.util.List;
import java.util.Map;
public interface ApiCallMgrService {
List<PlatformApiCall> getApiCallMgrList(ApiCallVo apiCallVo);
int getApiCallCount();
List<Map<String, Integer>> getApiCallGraphData();
List<Map<String, Integer>> getApiCallTrendList();
}
package com.glsx.service;
import com.glsx.model.PlatformApi;
import java.util.List;
public interface ApiMgrService {
List<PlatformApi> getApiMgrList();
int startAndStop(int id, int status);
}
package com.glsx.service;
public interface AppDownloadMgrService {
int getApiCallCountAuth(String customerName);
}
package com.glsx.service;
import com.glsx.model.PlatformCustomer;
import java.util.List;
public interface CustomerMgrService {
List<PlatformCustomer> getCustomerMgrList();
int reset(int id);
int startAndStop(int id, int status);
int getCustomerCount();
int register(PlatformCustomer customer);
int login(PlatformCustomer customer);
}
package com.glsx.service;
import com.glsx.model.PlatformDevice;
import com.glsx.vo.DeviceVo;
import java.util.List;
import java.util.Map;
public interface DeviceMgrService {
List<PlatformDevice> getDeviceMgrList(DeviceVo deviceVo);
List<String> getCustomerNameList();
List<String> getDeviceTypeList();
int getDeviceCount();
List<Map<String, Integer>> getDeviceGraphData();
int getDeviceCountAuth(String customerName);
List<Map<String, Integer>> getDeviceAccessTrendList();
}
package com.glsx.service;
import java.util.Map;
/**
* <p>Description:
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
public interface IndexService {
Map<String, Integer> getUcSummaryStatistic(String customerName);
Map<String, Integer> getUcDeviceActivationStatistic(String customerName);
Map<String, Integer> getUcUserActivityStatistic(String customerName);
Map<String, Integer> getUcAppDownloadStatistic(String customerName);
}
package com.glsx.service;
import com.glsx.model.PlatformUser;
import com.glsx.vo.UserVo;
import java.util.List;
public interface UserMgrService {
List<PlatformUser> getUserMgrList(UserVo userVo);
List<String> getCustomerNameList();
int getUserCount();
int getUserCountAuth(String customerName);
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformAdMapper;
import com.glsx.model.PlatformAd;
import com.glsx.service.AdMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
public class AdMgrServiceImpl implements AdMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(AdMgrServiceImpl.class);
@Resource
private PlatformAdMapper adMapper;
@Override
public List<PlatformAd> getAdMgrList() {
return adMapper.getAdMgrList();
}
@Override
public int insertAd(PlatformAd ad) {
ad.setCreateTime(new Date());
return adMapper.insert(ad);
}
@Override
public int updateAd(PlatformAd ad) {
ad.setUpdateTime(new Date());
return adMapper.updateByPrimaryKeySelective(ad);
}
@Override
public int startandstop(int id, int status) {
PlatformAd ad = new PlatformAd();
ad.setId(id);
ad.setStatus(status);
return adMapper.updateByPrimaryKeySelective(ad);
}
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformApiCallMapper;
import com.glsx.model.PlatformApiCall;
import com.glsx.service.ApiCallMgrService;
import com.glsx.vo.ApiCallVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class ApiCallMgrServiceImpl implements ApiCallMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(ApiCallMgrServiceImpl.class);
@Resource
private PlatformApiCallMapper apiCallMapper;
@Override
public List<PlatformApiCall> getApiCallMgrList(ApiCallVo apiCallVo) {
return apiCallMapper.getApiCallMgrList(apiCallVo);
}
@Override
public int getApiCallCount() {
return apiCallMapper.getApiCallCount();
}
@Override
public List<Map<String, Integer>> getApiCallGraphData() {
return apiCallMapper.getApiCallGraphData();
}
@Override
public List<Map<String, Integer>> getApiCallTrendList() {
return apiCallMapper.getApiCallTrendList();
}
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformApiMapper;
import com.glsx.model.PlatformApi;
import com.glsx.service.ApiMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ApiMgrServiceImpl implements ApiMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(ApiMgrServiceImpl.class);
@Resource
private PlatformApiMapper apiMapper;
@Override
public List<PlatformApi> getApiMgrList() {
return apiMapper.getApiMgrList();
}
@Override
public int startAndStop(int id, int status) {
PlatformApi api = new PlatformApi();
api.setId(id);
api.setStatus(status);
return apiMapper.updateByPrimaryKeySelective(api);
}
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformAppDownloadMapper;
import com.glsx.service.AppDownloadMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class AppDownloadMgrServiceImpl implements AppDownloadMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(AppDownloadMgrServiceImpl.class);
@Resource
private PlatformAppDownloadMapper appDownloadMapper;
@Override
public int getApiCallCountAuth(String customerName) {
return appDownloadMapper.getApiCallCountAuth(customerName);
}
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.CustomerMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class CustomerMgrServiceImpl implements CustomerMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(CustomerMgrServiceImpl.class);
@Resource
private PlatformCustomerMapper customerMapper;
@Override
public List<PlatformCustomer> getCustomerMgrList() {
return customerMapper.getCustomerMgrList();
}
@Override
public int reset(int id) {
PlatformCustomer customer = new PlatformCustomer();
customer.setId(id);
customer.setPassword("12345678");
return customerMapper.updateByPrimaryKeySelective(customer);
}
@Override
public int startAndStop(int id, int status) {
PlatformCustomer customer = new PlatformCustomer();
customer.setId(id);
customer.setStatus(status);
return customerMapper.updateByPrimaryKeySelective(customer);
}
@Override
public int getCustomerCount() {
return customerMapper.getCustomerCount();
}
@Override
public int register(PlatformCustomer customer) {
return customerMapper.insertSelective(customer);
}
@Override
public int login(PlatformCustomer customer) {
return customerMapper.login(customer);
}
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.mapper.PlatformDeviceMapper;
import com.glsx.model.PlatformDevice;
import com.glsx.service.DeviceMgrService;
import com.glsx.vo.DeviceVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class DeviceMgrServiceImpl implements DeviceMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(DeviceMgrServiceImpl.class);
@Resource
private PlatformDeviceMapper deviceMapper;
@Resource
private PlatformCustomerMapper customerMapper;
@Override
public List<PlatformDevice> getDeviceMgrList(DeviceVo deviceVo) {
return deviceMapper.getDeviceMgrList(deviceVo);
}
@Override
public List<String> getCustomerNameList() {
return customerMapper.getCustomerNameList();
}
@Override
public List<String> getDeviceTypeList() {
return deviceMapper.getDeviceTypeList();
}
@Override
public int getDeviceCount() {
return deviceMapper.getDeviceCount();
}
@Override
public List<Map<String, Integer>> getDeviceGraphData() {
return deviceMapper.getDeviceGraphData();
}
@Override
public int getDeviceCountAuth(String customerName) {
return deviceMapper.getDeviceCountAuth(customerName);
}
@Override
public List<Map<String, Integer>> getDeviceAccessTrendList() {
return deviceMapper.getDeviceAccessTrendList();
}
}
package com.glsx.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.hutool.core.date.DateUtil;
import com.glsx.mapper.PlatformAppDownloadMapper;
import com.glsx.mapper.PlatformDeviceMapper;
import com.glsx.mapper.PlatformUserMapper;
import com.glsx.service.IndexService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>Description: 总览业务
* <p>Project: open-platform-admin
*
* @author wbh
* @date 2020-12-16
*/
@Service
public class IndexServiceImpl implements IndexService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private PlatformDeviceMapper deviceMapper;
@Autowired
private PlatformUserMapper userMapper;
@Autowired
private PlatformAppDownloadMapper appDownloadMapper;
@Override
public Map<String, Integer> getUcSummaryStatistic(String customerName) {
Map<String, Integer> statisticMap = new HashMap<>();
int deviceCount = this.deviceMapper.getDeviceCountAuth(customerName);
int userCount = this.userMapper.getUserCountAuth(customerName);
int appDownloadCount = this.appDownloadMapper.getApiCallCountAuth(customerName);
statisticMap.put("deviceCount", deviceCount);
statisticMap.put("userCount", userCount);
statisticMap.put("appDownloadCount", appDownloadCount);
return statisticMap;
}
@Override
public Map<String, Integer> getUcDeviceActivationStatistic(String customerName) {
Map<String, Integer> statisticMap;
List<Map<String, Object>> columnList = this.deviceMapper.getDeviceActivationStatistic(
this.getStatisticStartTime(), this.getStatisticEndTime(),
customerName);
statisticMap = this.convertColumnToMap(columnList);
return statisticMap;
}
@Override
public Map<String, Integer> getUcUserActivityStatistic(String customerName) {
Map<String, Integer> statisticMap;
List<Map<String, Object>> columnList = this.userMapper.getUserActivityStatistic(
this.getStatisticStartTime(), this.getStatisticEndTime(),
customerName);
statisticMap = this.convertColumnToMap(columnList);
return statisticMap;
}
@Override
public Map<String, Integer> getUcAppDownloadStatistic(String customerName) {
Map<String, Integer> statisticMap;
List<Map<String, Object>> columnList = this.appDownloadMapper.getAppDownloadStatistic(
this.getStatisticStartTime(), this.getStatisticEndTime(),
customerName);
statisticMap = this.convertColumnToMap(columnList);
return statisticMap;
}
private Date getStatisticStartTime() {
return DateUtil.beginOfDay(new Date());
}
private Date getStatisticEndTime() {
return DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -31);
}
private Map<String, Integer> convertColumnToMap(List<Map<String, Object>> columnList) {
Map<String, Integer> statisticMap = new HashMap<>();
for (Map<String, Object> columnMap : columnList) {
statisticMap.put((String) columnMap.get("time"), (Integer) columnMap.get("count"));
}
return statisticMap;
}
}
package com.glsx.service.impl;
import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.mapper.PlatformUserMapper;
import com.glsx.model.PlatformUser;
import com.glsx.service.UserMgrService;
import com.glsx.vo.UserVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class UserMgrServiceImpl implements UserMgrService {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(UserMgrServiceImpl.class);
@Resource
private PlatformUserMapper userMapper;
@Resource
private PlatformCustomerMapper customerMapper;
@Override
public List<PlatformUser> getUserMgrList(UserVo userVo) {
return userMapper.getUserMgrList(userVo);
}
@Override
public List<String> getCustomerNameList() {
return customerMapper.getCustomerNameList();
}
@Override
public int getUserCount() {
return userMapper.getUserCount();
}
@Override
public int getUserCountAuth(String customerName) {
return userMapper.getUserCountAuth(customerName);
}
}
package com.glsx.vo;
import java.io.Serializable;
import java.util.Date;
import org.oreframework.web.ui.Pagination;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* api调用表
*/
public class ApiCallVo extends Pagination implements Serializable {
/**
* 访问开始时间
*/
private Date accessStartTime;
/**
* 访问结束时间
*/
private Date accessEndTime;
public Date getAccessStartTime() {
return accessStartTime;
}
public void setAccessStartTime(Date accessStartTime) {
this.accessStartTime = accessStartTime;
}
public Date getAccessEndTime() {
return accessEndTime;
}
public void setAccessEndTime(Date accessEndTime) {
this.accessEndTime = accessEndTime;
}
}
package com.glsx.vo;
import java.io.Serializable;
import java.util.Date;
import org.oreframework.web.ui.Pagination;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 设备管理表
*/
public class DeviceVo extends Pagination implements Serializable {
/**
* 客户名称
*/
private String customerName;
/**
* 类型
*/
private String deviceType;
/**
* 激活开始时间
*/
private Date activatStartTime;
/**
* 激活开始时间
*/
private Date activatEndTime;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Date getActivatStartTime() {
return activatStartTime;
}
public void setActivatStartTime(Date activatStartTime) {
this.activatStartTime = activatStartTime;
}
public Date getActivatEndTime() {
return activatEndTime;
}
public void setActivatEndTime(Date activatEndTime) {
this.activatEndTime = activatEndTime;
}
}
package com.glsx.vo;
import java.util.List;
public class Pagination<T> {
private long total;
private List<T> list;
public Pagination(long total, List<T> list) {
this.total = total;
this.list = list;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
@Override
public String toString() {
return "Pagination{" +
"total=" + total +
", list=" + list +
'}';
}
}
package com.glsx.vo;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import com.glsx.enums.ResultCodeEnum;
/**
* 返回数据
*/
public class R extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
public final static String CODE_KEY = "code";
public final static String MSG_KEY = "message";
private final static String DATA_KEY = "data";
private final static String LIST_KEY = "list";
private final static String PAGE_KEY = "page";
private final static String TOTAL_PAGES_KEY = "totalPages";
private final static String TOTAL_ELEMENTS_KEY = "totalElements";
private final static int SUCCESS_CODE = ResultCodeEnum.SUCCESS.getCode();
public R() {
put(CODE_KEY, SUCCESS_CODE);
put(MSG_KEY, "success");
}
public static R error() {
return error(ResultCodeEnum.SERVER_ERROR);
}
public static R error(String msg) {
return error(ResultCodeEnum.SERVER_ERROR.getCode(), msg);
}
public static R error(int code, String msg) {
R r = new R();
r.put(CODE_KEY, code);
r.put(MSG_KEY, msg);
return r;
}
public static R error(String code, String msg) {
R r = new R();
r.put(CODE_KEY, code);
r.put(MSG_KEY, msg);
return r;
}
public static R error(ResultCodeEnum resultCodeEnum) {
R r = new R();
r.put(CODE_KEY, resultCodeEnum.getCode());
r.put(MSG_KEY, resultCodeEnum.getMsg());
return r;
}
public static R ok(String msg) {
R r = new R();
r.put(MSG_KEY, msg);
return r;
}
public static R ok(Map<String, Object> map) {
R r = new R();
r.putAll(map);
return r;
}
public static R ok() {
return new R();
}
public R data(Object o) {
super.put(DATA_KEY, o);
return this;
}
@Override
public R put(String key, Object value) {
super.put(key, value);
return this;
}
/**
* 分页信息,需要前端自己算分页数
*
* @param value
* @param totalElements
* @return
*/
public R putPageData(Object value, long totalElements) {
Map data = new HashMap(2);
data.put(LIST_KEY, value);
data.put(TOTAL_ELEMENTS_KEY, totalElements);
super.put(DATA_KEY, data);
return this;
}
/**
* spring jdbc分页信息
*
* @param page
* @return
*/
public R putPageData(org.springframework.data.domain.Page page) {
Map data = new HashMap(3);
data.put(LIST_KEY, page.getContent());//分页数据
data.put(TOTAL_PAGES_KEY, page.getTotalPages());//总页数
data.put(TOTAL_ELEMENTS_KEY, page.getTotalElements());//总数
super.put(DATA_KEY, data);
return this;
}
/**
* mybatis pagehelper分页信息
*
* @param page
* @return
*/
public R putPageData(com.github.pagehelper.PageInfo page) {
Map data = new HashMap(3);
data.put(LIST_KEY, page.getList());//分页数据
data.put(TOTAL_PAGES_KEY, page.getPages());//总页数
data.put(TOTAL_ELEMENTS_KEY, page.getTotal());//总数
super.put(DATA_KEY, data);
return this;
}
/**
* mybatis pagehelper分页信息
*
* @param page
* @return
*/
public R putPageData(com.github.pagehelper.Page<?> page, Collection<?> coll) {
Map data = new HashMap(2);
data.put(PAGE_KEY, page);//分页信息
data.put(LIST_KEY, coll);//分页数据
super.put(DATA_KEY, data);
return this;
}
/**
* 分页信息,需要前端自己算分页数
*
* @param page
* @return
*/
public R putPageData(Pagination page) {
Map data = new HashMap(2);
data.put(LIST_KEY, page.getList());
data.put(TOTAL_ELEMENTS_KEY, page.getTotal());//总数
super.put(DATA_KEY, data);
return this;
}
/**
* 分页信息,需要前端自己算分页数
*
* @param page
* @return
*/
public R putPageData(Pagination pagination, cn.hutool.db.Page page) {
Map data = new HashMap(3);
data.put(PAGE_KEY, page);//分页信息
data.put(LIST_KEY, pagination.getList());//数据列表
data.put(TOTAL_ELEMENTS_KEY, pagination.getTotal());//总数
super.put(DATA_KEY, data);
return this;
}
public void setMessage(String formatMessage) {
this.put(MSG_KEY, formatMessage);
}
public String getMessage() {
return (String) this.get(MSG_KEY);
}
public void setCode(int code) {
this.put(CODE_KEY, code);
}
public int getCode() {
return (int) this.get(CODE_KEY);
}
public Object getData() {
return this.get(DATA_KEY);
}
public boolean isSuccess() {
return SUCCESS_CODE == this.getCode();
}
}
package com.glsx.vo;
import java.io.Serializable;
import java.util.Date;
import org.oreframework.web.ui.Pagination;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 设备管理表
*/
public class UserVo extends Pagination implements Serializable {
/**
* 客户ID
*/
private Integer customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 类型
*/
private String deviceType;
/**
* 激活开始时间
*/
private Date registerStartTime;
/**
* 激活开始时间
*/
private Date registerEndTime;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Date getRegisterStartTime() {
return registerStartTime;
}
public void setRegisterStartTime(Date registerStartTime) {
this.registerStartTime = registerStartTime;
}
public Date getRegisterEndTime() {
return registerEndTime;
}
public void setRegisterEndTime(Date registerEndTime) {
this.registerEndTime = registerEndTime;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!