0107
|
@ -0,0 +1,7 @@
|
|||
[*.{js,jsx,ts,tsx,vue}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 150
|
|
@ -0,0 +1,2 @@
|
|||
# 发布
|
||||
NODE_ENV=production
|
|
@ -1,73 +1,24 @@
|
|||
# ---> JetBrains
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
*.zip
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/artifacts
|
||||
# .idea/compiler.xml
|
||||
# .idea/jarRepositories.xml
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
|
12
LICENSE
|
@ -1,12 +0,0 @@
|
|||
Copyright (C) 2006 by Rob Landley <rob@landley.net>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
66
README.md
|
@ -1,20 +1,56 @@
|
|||
#### 从命令行创建一个新的仓库
|
||||
# jointcloud 云际计算
|
||||
|
||||
```bash
|
||||
touch README.md
|
||||
git init
|
||||
git add README.md
|
||||
git commit -m "first commit"
|
||||
git remote add origin https://git.trustie.net/nudtpc/JCCPlatform.git
|
||||
git push -u origin master
|
||||
## 电脑需要安装 node 环境
|
||||
|
||||
## 安装依赖命令
|
||||
|
||||
```
|
||||
|
||||
#### 从命令行推送已经创建的仓库
|
||||
|
||||
```bash
|
||||
git remote add origin https://git.trustie.net/nudtpc/JCCPlatform.git
|
||||
git push -u origin master
|
||||
|
||||
npm install
|
||||
```
|
||||
|
||||
### 编译及热加载命令
|
||||
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### 生产环境打包命令
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### 项目目录结构 src
|
||||
|
||||
├── api `接口`
|
||||
├── assets `图片资源`
|
||||
│ ├── modules `八大模块图片`
|
||||
│ ├── partner `合作伙伴图片`
|
||||
├── components `组件`
|
||||
│ ├── documents `文件`
|
||||
│ ├── modules `模块组件`
|
||||
│ │ ├── cloudBookkeepingAsync `云际异步记账`
|
||||
│ │ ├── cloudBookkeepingSync `云际同步记账`
|
||||
│ │ ├── cloudComputation `云际计算`
|
||||
│ │ ├── cloudStorage `云际存储`
|
||||
│ │ ├── disasterRecovery `云际容灾`
|
||||
│ │ ├── serviceRecommendation `云际推荐`
|
||||
│ │ └── header.vue `模块公共头部`
|
||||
│ └── .. `其他组件`
|
||||
├── mixin `复用代码`
|
||||
├── router `路径声明`
|
||||
├── scripts/map `列表map(表头)`
|
||||
├── store `vuex存储`
|
||||
├── styles `公共样式文件`
|
||||
├── utils `封装请求及多语言`
|
||||
├── views `page页面`
|
||||
│ ├── error-page `模块页面`
|
||||
│ ├── modules `模块页面`
|
||||
│ │ ├── cloudBookkeepingAsync `云际异步记账`
|
||||
│ │ ├── cloudBookkeepingSync `云际同步记账`
|
||||
│ │ ├── cloudComputation `云际计算`
|
||||
│ │ ├── cloudStorage `云际存储`
|
||||
│ │ ├── disasterRecovery `云际容灾`
|
||||
│ │ └── serviceRecommendation `云际推荐`
|
||||
└── └── .. `其他页面`
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset',
|
||||
],
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
[0107/083320.090:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-cloudMeter</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>benchmark</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>cmeter</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>aliApi</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>jcc-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-bssopenapi</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.5.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-ecs</artifactId>
|
||||
<version>4.19.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.73</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,12 +0,0 @@
|
|||
package com.jcc.cm.ali;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class AliCloudMain {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AliCloudMain.class,args);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
package com.jcc.cm.ali.controller;
|
||||
|
||||
import com.aliyuncs.ecs.model.v20140526.*;
|
||||
import com.jcc.springcloud.cloud.DescribeCloud;
|
||||
import com.jcc.springcloud.result.CommonResult;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
|
||||
@RequestMapping("/")
|
||||
@RestController
|
||||
public class AliApiServiceController {
|
||||
//查询主机当前状态(初始化中、'Stopped'、'Running')
|
||||
|
||||
|
||||
@Value("${ali.AccessKeyId}")
|
||||
private String AccessKeyId;
|
||||
|
||||
|
||||
@Value("${ali.AccessKeySecret}")
|
||||
private String AccessKeySecret;
|
||||
|
||||
@Value("${ali.InternetChargeType}")
|
||||
private String InternetChargeType;
|
||||
|
||||
@Value("${ali.InternetMaxBandwidthOut}")
|
||||
private int InternetMaxBandwidthOut;
|
||||
|
||||
|
||||
@PostMapping(value = "/CreateInstanceGetIp")
|
||||
@ResponseBody
|
||||
public CommonResult create_instance_get_ip(@RequestBody DescribeCloud db){
|
||||
|
||||
|
||||
|
||||
DefaultProfile profile = DefaultProfile.getProfile(db.getRegionId(),AccessKeyId,AccessKeySecret);
|
||||
IAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
// DescribeInstancesRequest request = new DescribeInstancesRequest();
|
||||
|
||||
|
||||
//创建请求
|
||||
RunInstancesRequest request = new RunInstancesRequest ();
|
||||
|
||||
//请求的基本参数
|
||||
request.setRegionId(db.getRegionId());
|
||||
request.setImageId(db.getImageId());
|
||||
request.setInstanceType(db.getInstanceType());
|
||||
request.setInternetMaxBandwidthOut(InternetMaxBandwidthOut);
|
||||
request.setInternetChargeType(InternetChargeType);
|
||||
|
||||
|
||||
//数据盘暂时不装
|
||||
|
||||
|
||||
//发送请求
|
||||
RunInstancesResponse response;
|
||||
try {
|
||||
response = client.getAcsResponse(request);
|
||||
|
||||
//打印日志
|
||||
// System.out.println(JSON.toJSONString(response));
|
||||
|
||||
} catch (ServerException e) {
|
||||
|
||||
//打印错误日志
|
||||
// e.printStackTrace();
|
||||
return new CommonResult(-1,String.format("{\"Error\":%s}","请求失败,创建实例失败".concat(e.getErrMsg())));
|
||||
} catch (ClientException e) {
|
||||
|
||||
|
||||
//打印错误日志
|
||||
// System.out.println("ErrCode:" + e.getErrCode());
|
||||
// System.out.println("ErrMsg:" + e.getErrMsg());
|
||||
// System.out.println("RequestId:" + e.getRequestId());
|
||||
return new CommonResult(-2,String.format("{\"Error\":%s}","客户端异常,创建实例失败:".concat(e.getErrMsg())));
|
||||
}
|
||||
|
||||
String instanceId = response.getRequestId();
|
||||
|
||||
//阿里云需要主机初始化完成之后才能分配公网ip,即需要主机状态为Stopped,再分配ip,否则报错
|
||||
|
||||
DescribeInstancesResponse.Instance instance;
|
||||
int i = 0;
|
||||
do{
|
||||
instance = getInstanceInfo(client,instanceId,db.getRegionId());
|
||||
|
||||
if(instance != null) break;
|
||||
i++;
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}while (i<50);
|
||||
|
||||
if(instance == null){
|
||||
return new CommonResult(-3,String.format("{\"Error\":%s}","获取实例信息失败"));
|
||||
}
|
||||
//开始分配IP
|
||||
|
||||
AllocatePublicIpAddressRequest arequest = new AllocatePublicIpAddressRequest();
|
||||
arequest.setInstanceId(instanceId);
|
||||
|
||||
String publicIp = "";
|
||||
try {
|
||||
AllocatePublicIpAddressResponse aresponse = client.getAcsResponse(arequest);
|
||||
if(aresponse != null){
|
||||
publicIp.concat(aresponse.getIpAddress());
|
||||
}
|
||||
} catch (ClientException e) {
|
||||
// e.printStackTrace();
|
||||
return new CommonResult(-2,String.format("{\"Error\":%s}","客户端异常,IP分配失败:".concat(e.getErrMsg())));
|
||||
}
|
||||
|
||||
//启动主机
|
||||
StartInstanceRequest srequest = new StartInstanceRequest();
|
||||
srequest.setInstanceId(instanceId);
|
||||
|
||||
try {
|
||||
StartInstanceResponse sresponse = client.getAcsResponse(srequest);
|
||||
if(srequest != null){
|
||||
//返回公网IP
|
||||
return new CommonResult(1,String.format("{\"InstanceId\":%s,\"PublicIp\":%s}",instanceId,publicIp));
|
||||
}
|
||||
} catch (ClientException e) {
|
||||
return new CommonResult(-2,String.format("{\"Error\":%s}","客户端异常:".concat(e.getErrMsg())));
|
||||
}
|
||||
|
||||
|
||||
return new CommonResult(-4,String.format("{\"Error\":%s}","实例启动失败"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private DescribeInstancesResponse.Instance getInstanceInfo(IAcsClient client, String instanceId, String regionid){
|
||||
|
||||
// 创建API请求并设置参数。
|
||||
DescribeInstancesRequest request = new DescribeInstancesRequest();
|
||||
request.setRegionId(regionid);
|
||||
request.setInstanceIds(instanceId);
|
||||
try {
|
||||
DescribeInstancesResponse response = client.getAcsResponse(request);
|
||||
for (DescribeInstancesResponse.Instance instance : response.getInstances())
|
||||
{
|
||||
// System.out.println(instance.getImageId());
|
||||
// System.out.println(instance.getInstanceId());
|
||||
// System.out.println(instance.getPublicIpAddress());
|
||||
if(instance.getStatus() != null && instance.getStatus().equals("stopped")){
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
} catch (ClientException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/GetPrices")
|
||||
// @PostMapping("/GetPrices")
|
||||
public CommonResult getPrice(/*@RequestBody DescribeCloud db*/){
|
||||
|
||||
DescribeCloud db = new DescribeCloud();
|
||||
|
||||
db.setInstanceType("ecs.g5.xlarge");
|
||||
db.setRegionId("cn-hangzhou");
|
||||
|
||||
|
||||
DefaultProfile profile = DefaultProfile.getProfile(db.getRegionId(),AccessKeyId,AccessKeySecret);
|
||||
IAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
|
||||
DescribePriceRequest request = new DescribePriceRequest();
|
||||
request.setInstanceType(db.getInstanceType());
|
||||
// request.setRegionId("cn-hangzhou");
|
||||
|
||||
|
||||
try{
|
||||
DescribePriceResponse response = client.getAcsResponse(request);
|
||||
return new CommonResult(1, new Gson().toJson(response));
|
||||
// return new CommonResult(1,String.format("{%s:%s}",db.getInstanceType(),response.getPriceInfo().getPrice().getTradePrice()));
|
||||
}
|
||||
catch (ClientException e){
|
||||
|
||||
System.out.println("ErrCode:" + e.getErrCode());
|
||||
System.out.println("ErrMsg:" + e.getErrMsg());
|
||||
System.out.println("RequestId:" + e.getRequestId());
|
||||
return new CommonResult(-1,String.format("{ClientException:%s}",e.fillInStackTrace()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/DestroyInstance")
|
||||
public CommonResult destroy_instance(@RequestBody DescribeCloud db){
|
||||
DefaultProfile profile = DefaultProfile.getProfile(db.getRegionId(),AccessKeyId,AccessKeySecret);
|
||||
IAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
|
||||
DeleteInstanceRequest request = new DeleteInstanceRequest();
|
||||
request.setInstanceId(db.getInstanceId());
|
||||
request.setForce(true);
|
||||
|
||||
try {
|
||||
DeleteInstanceResponse response = client.getAcsResponse(request);
|
||||
return new CommonResult(1,"删除成功");
|
||||
} catch (ClientException e) {
|
||||
return new CommonResult(-1,String.format("{删除失败:%s}",e.getErrMsg()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package com.jcc.cm.ali.service;
|
||||
|
||||
public interface AliApiService {
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package com.jcc.cm.ali.service.impl;
|
||||
|
||||
public class AliApiServiceImpl {
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-cloudMeter</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>cmeter</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>aliApi</module>
|
||||
<module>tencentApi</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/com.huaweicloud.sdk/huaweicloud-sdk-core -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>cmeter</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>tencentApi</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-apis</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-cloudMeter</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>cmeter</module>
|
||||
<module>benchmark</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-apis</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-cloudStorage</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-apis</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-jointFaas</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>jcc-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-fc</artifactId>
|
||||
<version>1.7.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,11 +0,0 @@
|
|||
package com.jcc.springcloud;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class JointFaasApplicationMain {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JointFaasApplicationMain.class,args);
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package com.jcc.springcloud.controller;
|
||||
|
||||
import com.jcc.springcloud.file.FuncResource;
|
||||
import com.jcc.springcloud.service.ManagerService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class ManagerController {
|
||||
@Resource
|
||||
private ManagerService managerService;
|
||||
|
||||
//上传函数
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/upload")
|
||||
public FuncResource upload(@RequestBody FuncResource funcResource) throws Exception {
|
||||
return managerService.upload(funcResource);
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.jcc.springcloud.service;
|
||||
|
||||
import com.jcc.springcloud.file.FuncResource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
public interface ManagerService {
|
||||
|
||||
//上传接口,上传依赖库以及把代码拷贝网页上
|
||||
FuncResource upload(@RequestBody FuncResource funcResource) throws Exception;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.jcc.springcloud.service.impl;
|
||||
|
||||
import com.jcc.springcloud.file.FuncResource;
|
||||
import com.jcc.springcloud.service.ManagerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@Service
|
||||
public class MangerServiceImpl implements ManagerService {
|
||||
@Override
|
||||
public FuncResource upload(@RequestBody FuncResource funcResource) throws Exception {
|
||||
if(funcResource.getFuncName().isEmpty()){
|
||||
throw new Exception("函数名不能为空!");
|
||||
}
|
||||
if(funcResource.getFuncContent().isEmpty()){
|
||||
throw new Exception("函数内容不能为空!");
|
||||
}
|
||||
|
||||
//上传给阿里云serverless服务
|
||||
return funcResource;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>JCCPlatform</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-apis</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>jcc-cloudStorage</module>
|
||||
<module>jcc-jointFaas</module>
|
||||
<module>jcc-cloudMeter</module>
|
||||
|
||||
</modules>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>JCCPlatform</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>jcc-commons</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,29 +0,0 @@
|
|||
package com.jcc.springcloud.cloud;
|
||||
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Setter
|
||||
@Getter
|
||||
public class DescribeCloud implements Serializable {
|
||||
|
||||
private String regionId;
|
||||
|
||||
private String imageId;
|
||||
|
||||
private String instanceType;
|
||||
|
||||
private String InstanceId;
|
||||
|
||||
private String instanceName;
|
||||
|
||||
|
||||
|
||||
|
||||
// private String ClientToken;
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package com.jcc.springcloud.file;
|
||||
|
||||
public class FuncResource {
|
||||
//函数名字
|
||||
private String funcName;
|
||||
//语言类型
|
||||
private String env;
|
||||
//函数内容
|
||||
private String funcContent;
|
||||
//函数上传后的路径
|
||||
private String url;
|
||||
//内存大小
|
||||
private String memorySize;
|
||||
|
||||
|
||||
public String getFuncName() {
|
||||
return funcName;
|
||||
}
|
||||
|
||||
public void setFuncName(String funcName) {
|
||||
this.funcName = funcName;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getEnv() {
|
||||
return env;
|
||||
}
|
||||
|
||||
public void setEnv(String env) {
|
||||
this.env = env;
|
||||
}
|
||||
|
||||
public String getFuncContent() {
|
||||
return funcContent;
|
||||
}
|
||||
|
||||
public void setFuncContent(String funcContent) {
|
||||
this.funcContent = funcContent;
|
||||
}
|
||||
|
||||
public String getMemorySize() {
|
||||
return memorySize;
|
||||
}
|
||||
|
||||
public void setMemorySize(String memorySize) {
|
||||
this.memorySize = memorySize;
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package com.jcc.springcloud.result;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* @author tansheng
|
||||
* @create 2020/10/23
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class CommonResult<T> {
|
||||
private Integer code;
|
||||
private String message;
|
||||
private T data;
|
||||
|
||||
public CommonResult(Integer code,String message){
|
||||
this(code,message,null);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.jcc.springcloud.user;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author tansheng
|
||||
* @create 2020/10/23
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserDo implements Serializable {
|
||||
|
||||
private long id;
|
||||
private String userName;
|
||||
private String pwdMd5;
|
||||
private String email;
|
||||
private String phone;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getPwdMd5() {
|
||||
return pwdMd5;
|
||||
}
|
||||
|
||||
public void setPwdMd5(String pwdMd5) {
|
||||
this.pwdMd5 = pwdMd5;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$/../jcc-dao-cloudMeter">
|
||||
<excludeFolder url="file://$MODULE_DIR$/../jcc-dao-cloudMeter/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="jcc-commons" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.4" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-dao</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-dao-cloudMeter</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-dao</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-dao-cloudStorage</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-dao</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-dao-jointFaas</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-dao</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-dao-user</artifactId>
|
||||
|
||||
|
||||
|
||||
</project>
|
|
@ -1,19 +0,0 @@
|
|||
package com.jcc.springcloud.dao;
|
||||
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface LoginDao {
|
||||
|
||||
/*系统站内注册*/
|
||||
/*public int login(UserDo userEntity);*/
|
||||
|
||||
/*查询用户是否存在*/
|
||||
public UserDo findUserByName(UserDo userDo);
|
||||
|
||||
/*查询用户名和密码是否匹配*/
|
||||
public UserDo findUserByPwd(UserDo userDo);
|
||||
}
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.jcc.springcloud.dao;
|
||||
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* @author tansheng
|
||||
* @create 2020/10/23
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface RegisterDao {
|
||||
|
||||
/*系统站内登录*/
|
||||
int register(UserDo userDo);
|
||||
|
||||
List<UserDo> findUserByName(UserDo userDo);}
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.jcc.springcloud.dao.LoginDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.jcc.springcloud.user.UserDo">
|
||||
<result column="user_name" property="userName" jdbcType="VARCHAR"></result>
|
||||
<result column="pwd_md5" property="pwdMd5" jdbcType="VARCHAR"></result>
|
||||
<result column="phone" property="phone" jdbcType="VARCHAR"></result>
|
||||
<result column="email" property="email" jdbcType="VARCHAR"></result>
|
||||
</resultMap>
|
||||
|
||||
<!--查询用户是否存在-->
|
||||
<select id="findUserByName" parameterType="com.jcc.springcloud.user.UserDo" resultMap="BaseResultMap">
|
||||
SELECT * FROM user_login WHERE user_name = #{userName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
<!--查询用户名和密码是否匹配-->
|
||||
<select id="findUserByPwd" parameterType="com.jcc.springcloud.user.UserDo" resultMap="BaseResultMap">
|
||||
SELECT * FROM user_login WHERE user_name = #{userName,jdbcType=VARCHAR} AND pwd_md5 = #{pwdMd5,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.jcc.springcloud.dao.RegisterDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.jcc.springcloud.user.UserDo">
|
||||
<result column="user_name" property="userName" jdbcType="VARCHAR"></result>
|
||||
<result column="pwd_md5" property="pwdMd5" jdbcType="VARCHAR"></result>
|
||||
<result column="phone" property="phone" jdbcType="VARCHAR"></result>
|
||||
<result column="email" property="email" jdbcType="VARCHAR"></result>
|
||||
</resultMap>
|
||||
|
||||
<insert id="register" parameterType="com.jcc.springcloud.user.UserDo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into user_login(user_name,pwd_md5,phone,email) values (#{userName,jdbcType=VARCHAR},#{pwdMd5,jdbcType=VARCHAR},#{phone,jdbcType=VARCHAR},#{email,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!--查询用户是否存在-->
|
||||
<select id="findUserByName" parameterType="com.jcc.springcloud.user.UserDo" resultMap="BaseResultMap">
|
||||
select * from user_login where user_name=#{userName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>JCCPlatform</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-dao</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>jcc-dao-user</module>
|
||||
<module>jcc-dao-cloudStorage</module>
|
||||
<module>jcc-dao-jointFaas</module>
|
||||
<module>jcc-dao-cloudMeter</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>jcc-commons</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.4.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jcc-service</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-user</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>jcc-dao-user</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>jcc-utils</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
|
@ -1,11 +0,0 @@
|
|||
package com.jcc.springcloud;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class UserApplicationMain {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UserApplicationMain.class,args);
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.jcc.springcloud.controller;
|
||||
|
||||
import com.jcc.springcloud.result.CommonResult;
|
||||
import com.jcc.springcloud.service.LoginService;
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class LoginController {
|
||||
@Resource
|
||||
private LoginService loginService;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/login")
|
||||
public CommonResult login(@RequestBody UserDo userDo){
|
||||
UserDo userByName = loginService.findUserByName(userDo);
|
||||
if(userByName == null){
|
||||
return new CommonResult(444,"登录失败,用户名未注册",null);
|
||||
}else{
|
||||
UserDo userByPwd = loginService.findUserByPwd(userDo);
|
||||
if(userByPwd == null){
|
||||
return new CommonResult(444,"登录失败,密码错误",null);
|
||||
}else {
|
||||
return new CommonResult(200,"登录成功",null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.jcc.springcloud.controller;
|
||||
|
||||
import com.jcc.springcloud.result.CommonResult;
|
||||
import com.jcc.springcloud.service.RegisterService;
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class RegisterController {
|
||||
@Resource
|
||||
private RegisterService registerService;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/register")
|
||||
public CommonResult create(@RequestBody UserDo userDo){
|
||||
int result = registerService.register(userDo);
|
||||
log.info("************注册结果:"+result);
|
||||
if(result > 0)
|
||||
{
|
||||
return new CommonResult(200,"注册成功",null);
|
||||
}else{
|
||||
return new CommonResult(444,"注册失败",null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.jcc.springcloud.service;
|
||||
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
|
||||
public interface LoginService {
|
||||
/*查询用户是否存在*/
|
||||
UserDo findUserByName(UserDo userDo);
|
||||
|
||||
/*查询用户名和密码是否匹配*/
|
||||
UserDo findUserByPwd(UserDo userDo);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.jcc.springcloud.service;
|
||||
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RegisterService {
|
||||
|
||||
public List<UserDo> findUserByName(UserDo userDo);
|
||||
|
||||
public int register(UserDo userDo);
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.jcc.springcloud.service.impl;
|
||||
|
||||
import com.jcc.springcloud.common.utils.MD5Utils;
|
||||
import com.jcc.springcloud.dao.LoginDao;
|
||||
import com.jcc.springcloud.service.LoginService;
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class LoginServiceImpl implements LoginService {
|
||||
@Resource
|
||||
private LoginDao loginDao;
|
||||
|
||||
@Override
|
||||
/*查询用户是否存在*/
|
||||
public UserDo findUserByName(UserDo userDo) {
|
||||
UserDo userByName = loginDao.findUserByName(userDo);
|
||||
return userByName;
|
||||
}
|
||||
|
||||
@Override
|
||||
/*查询用户名和密码是否匹配*/
|
||||
public UserDo findUserByPwd(UserDo userDo) {
|
||||
String md5Pwd = MD5Utils.md5Encrypt32Lower(userDo.getPwdMd5().toString());
|
||||
userDo.setPwdMd5(md5Pwd);
|
||||
UserDo userByPwd = loginDao.findUserByPwd(userDo);
|
||||
return userByPwd;
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package com.jcc.springcloud.service.impl;
|
||||
|
||||
import com.jcc.springcloud.common.utils.MD5Utils;
|
||||
import com.jcc.springcloud.dao.RegisterDao;
|
||||
import com.jcc.springcloud.service.RegisterService;
|
||||
import com.jcc.springcloud.user.UserDo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class RegisterServiceImpl implements RegisterService {
|
||||
@Resource
|
||||
private RegisterDao registerDao;
|
||||
|
||||
@Override
|
||||
public List<UserDo> findUserByName(UserDo userDo){
|
||||
return registerDao.findUserByName(userDo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int register(UserDo userDo) {
|
||||
List<UserDo> userList = findUserByName(userDo);
|
||||
System.out.println("listSize = "+userList.size());
|
||||
if(userList.size()==0){
|
||||
System.out.println("register = "+userDo.getUserName());
|
||||
String md5Pwd = MD5Utils.md5Encrypt32Lower(userDo.getPwdMd5().toString());
|
||||
userDo.setPwdMd5(md5Pwd);
|
||||
int result = registerDao.register(userDo);
|
||||
return 1;
|
||||
} else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
server:
|
||||
port: 8002
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: jcc-springcloud-service
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/jccplatform?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: nudt@2020
|
||||
|
||||
mybatis:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: com.jcc.springcloud.user
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>JCCPlatform</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-service</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>jcc-user</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>jcc-dao-user</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>JCCPlatform</artifactId>
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jcc-utils</artifactId>
|
||||
|
||||
</project>
|
|
@ -1,102 +0,0 @@
|
|||
package com.jcc.springcloud.common.utils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author tansheng
|
||||
* @create 2020/10/21
|
||||
*/
|
||||
|
||||
public class MD5Utils {
|
||||
/**
|
||||
* MD5加密字符串(32位大写)
|
||||
*
|
||||
* @param string 需要进行MD5加密的字符串
|
||||
* @return 加密后的字符串(大写)
|
||||
*/
|
||||
public static String md5Encrypt32Upper(String string) {
|
||||
byte[] hash;
|
||||
try {
|
||||
//创建一个MD5算法对象,并获得MD5字节数组,16*8=128位
|
||||
hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8"));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("Huh, MD5 should be supported?", e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException("Huh, UTF-8 should be supported?", e);
|
||||
}
|
||||
|
||||
//转换为十六进制字符串
|
||||
StringBuilder hex = new StringBuilder(hash.length * 2);
|
||||
for (byte b : hash) {
|
||||
if ((b & 0xFF) < 0x10) { hex.append("0"); }
|
||||
hex.append(Integer.toHexString(b & 0xFF));
|
||||
}
|
||||
return hex.toString().toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* MD5加密字符串(32位小写)
|
||||
*
|
||||
* @param string 需要进行MD5加密的字符串
|
||||
* @return 加密后的字符串(小写)
|
||||
*/
|
||||
public static String md5Encrypt32Lower(String string) {
|
||||
byte[] hash;
|
||||
try {
|
||||
//创建一个MD5算法对象,并获得MD5字节数组,16*8=128位
|
||||
hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8"));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("Huh, MD5 should be supported?", e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException("Huh, UTF-8 should be supported?", e);
|
||||
}
|
||||
|
||||
//转换为十六进制字符串
|
||||
StringBuilder hex = new StringBuilder(hash.length * 2);
|
||||
for (byte b : hash) {
|
||||
if ((b & 0xFF) < 0x10) { hex.append("0"); }
|
||||
hex.append(Integer.toHexString(b & 0xFF));
|
||||
}
|
||||
return hex.toString().toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将二进制字节数组转换为十六进制字符串
|
||||
*
|
||||
* @param bytes 二进制字节数组
|
||||
* @return 十六进制字符串
|
||||
*/
|
||||
public static String bytesToHex(byte[] bytes) {
|
||||
StringBuffer hexStr = new StringBuffer();
|
||||
int num;
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
num = bytes[i];
|
||||
if (num < 0) {
|
||||
num += 256;
|
||||
}
|
||||
if (num < 16) {
|
||||
hexStr.append("0");
|
||||
}
|
||||
hexStr.append(Integer.toHexString(num));
|
||||
}
|
||||
return hexStr.toString().toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unicode中文编码转换成字符串
|
||||
*/
|
||||
public static String unicodeToString(String str) {
|
||||
Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))");
|
||||
Matcher matcher = pattern.matcher(str);
|
||||
char ch;
|
||||
while (matcher.find()) {
|
||||
ch = (char) Integer.parseInt(matcher.group(2), 16);
|
||||
str = str.replace(matcher.group(1), ch + "");
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"name": "jointcloud",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"author": "annzee <aannzee@gmail.com>",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"prod": "vue-cli-service serve --mode production",
|
||||
"build": "vue-cli-service build --mode production",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.20.0",
|
||||
"compression-webpack-plugin": "^6.0.4",
|
||||
"core-js": "^3.6.5",
|
||||
"dedent": "^0.7.0",
|
||||
"echarts": "^4.9.0",
|
||||
"element-ui": "^2.13.2",
|
||||
"filemanager-webpack-plugin": "^3.0.0-alpha.4",
|
||||
"qs": "^6.9.4",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-codemirror": "^4.0.6",
|
||||
"vue-i18n": "^8.22.2",
|
||||
"vue-router": "^3.4.4",
|
||||
"vuex": "^3.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "^4.5.6",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/eslint-config-airbnb": "^5.0.2",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"node-sass": "^4.14.1",
|
||||
"sass-loader": "^10.0.2",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended",
|
||||
"@vue/airbnb"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
114
pom.xml
|
@ -1,114 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.jcc.springcloud</groupId>
|
||||
<artifactId>JCCPlatform</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<modules>
|
||||
<module>jcc-commons</module>
|
||||
<module>jcc-utils</module>
|
||||
<module>jcc-dao</module>
|
||||
<module>jcc-service</module>
|
||||
<module>jcc-apis</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://maven.apache.org/</url>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<junit.version>4.12</junit.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<lombok.version>1.16.18</lombok.version>
|
||||
<mysql.version>8.0.21</mysql.version>
|
||||
<druid.version>1.1.16</druid.version>
|
||||
<mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version>
|
||||
</properties>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>website</id>
|
||||
<url>scp://webhost.company.com/www/website</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.3.4.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Hoxton.SR8</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>2.2.3.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>${mybatis.spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.18</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.3.4.RELEASE</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
<addResources>true</addResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
After Width: | Height: | Size: 4.2 KiB |
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<!-- 使用CDN的CSS文件 -->
|
||||
<% for (var i in htmlWebpackPlugin.options.cdn &&
|
||||
htmlWebpackPlugin.options.cdn.css) { %>
|
||||
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
|
||||
<% } %>
|
||||
|
||||
<!-- 使用CDN的JS文件 -->
|
||||
<% for (var i in htmlWebpackPlugin.options.cdn &&
|
||||
htmlWebpackPlugin.options.cdn.js) { %>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"
|
||||
></script>
|
||||
<% } %>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<template>
|
||||
<div id="app">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
/* margin-top: 60px; */
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,6 @@
|
|||
import common from './common';
|
||||
import cloudStorage from './cloudStorage';
|
||||
import cloudComputation from './cloudComputation';
|
||||
import serviceRecommendation from './serviceRecommendation';
|
||||
|
||||
export default { common, cloudStorage, cloudComputation, serviceRecommendation };
|
|
@ -0,0 +1,50 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
// 云计算接口
|
||||
export default {
|
||||
createFunction(query) {
|
||||
return request({
|
||||
url: '/function/createFunction',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
},
|
||||
deleteFunctionByName() {
|
||||
return request({
|
||||
url: '/function/delete/functionByName',
|
||||
method: 'delete',
|
||||
});
|
||||
},
|
||||
deleteFunction(functionId) {
|
||||
return request({
|
||||
url: `/function/deleteFunction/${functionId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
},
|
||||
getFunctionByFunctionName() {
|
||||
return request({
|
||||
url: '/function/delete/functionByName',
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
invokeFunction(query) {
|
||||
return request({
|
||||
url: '/function/invokeFunction',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
},
|
||||
listFunctions(query) {
|
||||
return request({
|
||||
url: '/function/lists',
|
||||
method: 'get',
|
||||
params: query || { page: 1, size: 10 },
|
||||
});
|
||||
},
|
||||
updateFunction() {
|
||||
return request({
|
||||
url: '/function/updateFunction',
|
||||
method: 'put',
|
||||
});
|
||||
},
|
||||
};
|
|
@ -0,0 +1,45 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
// 云存储接口
|
||||
export default {
|
||||
makeBucket(query) {
|
||||
return request({
|
||||
url: '/storage/makeBucket',
|
||||
method: 'post',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
listBuckets() {
|
||||
return request({
|
||||
url: '/storage/listBuckets',
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
listCloudFiles() {
|
||||
return request({
|
||||
url: '/storage/listCloudFiles',
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
uploadFile(query) {
|
||||
return request({
|
||||
url: '/storage/uploadFile',
|
||||
method: 'post',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
downloadFile() {
|
||||
return request({
|
||||
url: '/storage/downloadFile',
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
deleteFile(query) {
|
||||
return request({
|
||||
url: '/storage/deleteFile',
|
||||
method: 'post',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
export default {
|
||||
create(query) {
|
||||
return request({
|
||||
url: '/api/register',
|
||||
method: 'post',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
login(query) {
|
||||
return request({
|
||||
url: '/login',
|
||||
method: 'post',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
// 云推荐接口
|
||||
export default {
|
||||
scoreTotal(query) {
|
||||
return request({
|
||||
url: '/scoreTotal/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
},
|
||||
scoreCost(query) {
|
||||
return request({
|
||||
url: '/scoreCost/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
},
|
||||
score(query) {
|
||||
return request({
|
||||
url: '/score/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
},
|
||||
}
|
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 430 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 178 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 397 KiB |
After Width: | Height: | Size: 572 KiB |
After Width: | Height: | Size: 388 KiB |
After Width: | Height: | Size: 191 KiB |
After Width: | Height: | Size: 683 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 279 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 151 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 206 KiB |
After Width: | Height: | Size: 525 KiB |
After Width: | Height: | Size: 533 KiB |
After Width: | Height: | Size: 165 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 148 KiB |