Skip to content

Commit

Permalink
doc: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Jan 2, 2023
1 parent c2b2947 commit 38969bb
Show file tree
Hide file tree
Showing 130 changed files with 528 additions and 483 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug------bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ assignees: ''

**版本**
Sonic的版本号 | Sonic's Version.
部署的系统(mac,windows32...) | System
部署的系统(mac,windows32...) | System

20 changes: 10 additions & 10 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: maven compile test

on: [pull_request]
on: [ pull_request ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Validate and Compile with Maven
run: mvn validate compile
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Validate and Compile with Maven
run: mvn validate compile
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
</p>

### Official Website

[Sonic Official Website](https://sonic-cloud.cn)

## Background

#### What is sonic ?

> Sonic is a platform that integrates remote control debugging and automated testing of mobile devices, and strives to create a better use experience for global developers and test engineers.
> Sonic is a platform that integrates remote control debugging and automated testing of mobile devices, and strives to
> create a better use experience for global developers and test engineers.
>
>If you want to participate, welcome to join us! 💪
>
Expand All @@ -43,7 +46,9 @@ mvn package
```
docker-compose up -d
```

or

```
docker-compose -f docker-compose-zh.yml up -d
```
Expand All @@ -54,8 +59,11 @@ Thank you to all our sponsors!

[<img src="https://ceshiren.com/uploads/default/original/3X/7/0/70299922296e93e2dcab223153a928c4bfb27df9.jpeg" alt="霍格沃兹测试开发学社" width="500">](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com)

> [霍格沃兹测试开发学社](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com)是业界领先的测试开发技术高端教育品牌,隶属于[测吧(北京)科技有限公司](http://qrcode.testing-studio.com/f?from=sonic&url=https://www.testing-studio.com) 。学院课程由一线大厂测试经理与资深测试开发专家参与研发,实战驱动。课程涵盖 web/app 自动化测试、接口测试、性能测试、安全测试、持续集成/持续交付/DevOps,测试左移&右移、精准测试、测试平台开发、测试管理等内容,帮助测试工程师实现测试开发技术转型。通过优秀的学社制度(奖学金、内推返学费、行业竞赛等多种方式)来实现学员、学社及用人企业的三方共赢。[进入测试开发技术能力测评!](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com/t/topic/14940)
> [霍格沃兹测试开发学社](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com)
> 是业界领先的测试开发技术高端教育品牌,隶属于[测吧(北京)科技有限公司](http://qrcode.testing-studio.com/f?from=sonic&url=https://www.testing-studio.com)
> 。学院课程由一线大厂测试经理与资深测试开发专家参与研发,实战驱动。课程涵盖 web/app
>
自动化测试、接口测试、性能测试、安全测试、持续集成/持续交付/DevOps,测试左移&右移、精准测试、测试平台开发、测试管理等内容,帮助测试工程师实现测试开发技术转型。通过优秀的学社制度(奖学金、内推返学费、行业竞赛等多种方式)来实现学员、学社及用人企业的三方共赢。[进入测试开发技术能力测评!](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com/t/topic/14940)

## LICENSE

Expand Down
13 changes: 10 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
</p>

### 官方网站
[Sonic Official Website](https://sonic-cloud.cn)

[Sonic Official Website](https://sonic-cloud.cn)

## 背景

#### 什么是 Sonic ?
Expand All @@ -43,7 +45,9 @@ mvn package
```
docker-compose up -d
```


```
docker-compose -f docker-compose-zh.yml up -d
```
Expand All @@ -54,8 +58,11 @@ docker-compose -f docker-compose-zh.yml up -d

[<img src="https://ceshiren.com/uploads/default/original/3X/7/0/70299922296e93e2dcab223153a928c4bfb27df9.jpeg" alt="霍格沃兹测试开发学社" width="500">](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com)

> [霍格沃兹测试开发学社](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com)是业界领先的测试开发技术高端教育品牌,隶属于[测吧(北京)科技有限公司](http://qrcode.testing-studio.com/f?from=sonic&url=https://www.testing-studio.com) 。学院课程由一线大厂测试经理与资深测试开发专家参与研发,实战驱动。课程涵盖 web/app 自动化测试、接口测试、性能测试、安全测试、持续集成/持续交付/DevOps,测试左移&右移、精准测试、测试平台开发、测试管理等内容,帮助测试工程师实现测试开发技术转型。通过优秀的学社制度(奖学金、内推返学费、行业竞赛等多种方式)来实现学员、学社及用人企业的三方共赢。[进入测试开发技术能力测评!](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com/t/topic/14940)
> [霍格沃兹测试开发学社](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com)
> 是业界领先的测试开发技术高端教育品牌,隶属于[测吧(北京)科技有限公司](http://qrcode.testing-studio.com/f?from=sonic&url=https://www.testing-studio.com)
> 。学院课程由一线大厂测试经理与资深测试开发专家参与研发,实战驱动。课程涵盖 web/app
>
自动化测试、接口测试、性能测试、安全测试、持续集成/持续交付/DevOps,测试左移&右移、精准测试、测试平台开发、测试管理等内容,帮助测试工程师实现测试开发技术转型。通过优秀的学社制度(奖学金、内推返学费、行业竞赛等多种方式)来实现学员、学社及用人企业的三方共赢。[进入测试开发技术能力测评!](https://qrcode.testing-studio.com/f?from=sonic&url=https://ceshiren.com/t/topic/14940)

## 开源许可协议

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package org.cloud.sonic.common.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -35,7 +34,6 @@

import java.util.Arrays;
import java.util.List;
import java.util.Locale;

/**
* @author ZhouYiXun
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType
return container;
}

public static RespModel process(String l, RespModel respModel,MessageSource messageSource) {
public static RespModel process(String l, RespModel respModel, MessageSource messageSource) {
String language = "zh_CN";
if (l != null) {
language = l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.springframework.stereotype.Component;

/**
* @author JayWenStar,Eason
* @author JayWenStar, Eason
* @date 2022/4/11 1:32 上午
*/
@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ public enum RespEnum {
DELETE_OK(2000, "ok.delete"),
UPLOAD_OK(2000, "ok.upload"),
SEND_OK(2000, "ok.send"),
COPY_OK(2000,"ok.copy"),
SEARCH_FAIL(3005,"fail.search"),
UPDATE_FAIL(3004,"fail.update"),
COPY_OK(2000, "ok.copy"),
SEARCH_FAIL(3005, "fail.search"),
UPDATE_FAIL(3004, "fail.update"),
DELETE_FAIL(3002, "fail.delete"),
UPLOAD_FAIL(3003, "fail.upload"),
UNAUTHORIZED(1001, "unauthorized"),
SERVICE_NOT_FOUND(1002, "not.found.service"),
PERMISSION_DENIED(1003, "permission.denied"),
RESOURCE_NOT_FOUND(1004, "not.found.resource"),
ID_NOT_FOUND(3001, "not.found.id"),
DEVICE_NOT_FOUND(3002,"not.found.device"),
DEVICE_NOT_FOUND(3002, "not.found.device"),
AGENT_NOT_ONLINE(5001, "not.online.agent"),
PARAMS_NOT_VALID(4004, "not.valid.params"),
PARAMS_NOT_READABLE(4005, "not.readable.params"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public RespModel(RespEnum respEnum, T data) {
this.data = data;
}

public static RespModel result(RespEnum respEnum){
public static RespModel result(RespEnum respEnum) {
return new RespModel(respEnum);
}

public static <T> RespModel<T> result(RespEnum respEnum, T data){
public static <T> RespModel<T> result(RespEnum respEnum, T data) {
return new RespModel<T>(respEnum, data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void resourceInit() {
log.info("version: {}, resource init finish!", version);
confListService.save(ConfType.RESOURCE, version, null);

}catch (Exception e) {
} catch (Exception e) {
log.error("init resource error", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ServerEndpointExporter serverEndpointExporter() {
}

@Bean
public WsEndpointConfigure newMyEndpointConfigure (){
public WsEndpointConfigure newMyEndpointConfigure() {
return new WsEndpointConfigure();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class WsEndpointConfigure extends ServerEndpointConfig.Configurator imple
private static volatile BeanFactory context;

@Override
public <T> T getEndpointInstance(Class<T> clazz){
public <T> T getEndpointInstance(Class<T> clazz) {
return context.getBean(clazz);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
package org.cloud.sonic.controller.controller;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.http.RespEnum;
import org.cloud.sonic.common.http.RespModel;
import org.cloud.sonic.controller.models.base.TypeConverter;
import org.cloud.sonic.controller.models.domain.Agents;
import org.cloud.sonic.controller.models.dto.AgentsDTO;
import org.cloud.sonic.controller.services.AgentsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.controller.transport.TransportWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.http.RespEnum;
import org.cloud.sonic.common.http.RespModel;
Expand All @@ -27,10 +31,6 @@
import org.cloud.sonic.controller.models.http.DeviceDetailChange;
import org.cloud.sonic.controller.models.http.UpdateDeviceImg;
import org.cloud.sonic.controller.services.DevicesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
package org.cloud.sonic.controller.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.http.RespEnum;
import org.cloud.sonic.common.http.RespModel;
Expand All @@ -26,10 +30,6 @@
import org.cloud.sonic.controller.models.dto.ElementsDTO;
import org.cloud.sonic.controller.models.dto.StepsDTO;
import org.cloud.sonic.controller.services.ElementsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -58,17 +58,17 @@ public class ElementsController {
})
@GetMapping("/list")
public RespModel<CommentPage<ElementsDTO>> findAll(@RequestParam(name = "projectId") int projectId,
@RequestParam(name = "type", required = false) String type,
@RequestParam(name = "eleTypes[]", required = false) List<String> eleTypes,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "value", required = false) String value,
@RequestParam(name = "moduleIds[]", required = false) List<Integer> moduleIds,
@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize") int pageSize) {
@RequestParam(name = "type", required = false) String type,
@RequestParam(name = "eleTypes[]", required = false) List<String> eleTypes,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "value", required = false) String value,
@RequestParam(name = "moduleIds[]", required = false) List<Integer> moduleIds,
@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize") int pageSize) {
Page<Elements> pageable = new Page<>(page, pageSize);
return new RespModel<>(
RespEnum.SEARCH_OK,
elementsService.findAll(projectId, type, eleTypes, name, value, moduleIds, pageable)
elementsService.findAll(projectId, type, eleTypes, name, value, moduleIds, pageable)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
*/
package org.cloud.sonic.controller.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.http.RespEnum;
import org.cloud.sonic.common.http.RespModel;
import org.cloud.sonic.controller.models.domain.GlobalParams;
import org.cloud.sonic.controller.models.dto.GlobalParamsDTO;
import org.cloud.sonic.controller.services.GlobalParamsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.exception.SonicException;
import org.cloud.sonic.common.http.RespEnum;
import org.cloud.sonic.common.http.RespModel;
import org.cloud.sonic.controller.models.base.CommentPage;
import org.cloud.sonic.controller.services.JobsService;
import org.cloud.sonic.controller.models.domain.Jobs;
import org.cloud.sonic.controller.models.dto.JobsDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.controller.services.JobsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
*/
package org.cloud.sonic.controller.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.http.RespEnum;
import org.cloud.sonic.common.http.RespModel;
import org.cloud.sonic.controller.models.base.TypeConverter;
import org.cloud.sonic.controller.models.domain.Modules;
import org.cloud.sonic.controller.models.dto.ModulesDTO;
import org.cloud.sonic.controller.services.ModulesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.stream.Collectors;

/**
* @author yaming116, Eason
* @des
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/
package org.cloud.sonic.controller.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.cloud.sonic.common.config.WebAspect;
import org.cloud.sonic.common.config.WhiteUrl;
import org.cloud.sonic.common.exception.SonicException;
Expand All @@ -26,9 +29,6 @@
import org.cloud.sonic.controller.models.domain.Projects;
import org.cloud.sonic.controller.models.dto.ProjectsDTO;
import org.cloud.sonic.controller.services.ProjectsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
Expand Down
Loading

0 comments on commit 38969bb

Please sign in to comment.