Skip to content

Commit

Permalink
Merge pull request #259 from SonicCloudOrg/feat/1.5.0-release
Browse files Browse the repository at this point in the history
Feat/1.5.0 release
  • Loading branch information
ZhouYixun authored Sep 3, 2022
2 parents 28f5e84 + 286127f commit b814451
Show file tree
Hide file tree
Showing 17 changed files with 379 additions and 167 deletions.
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/bug------bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ assignees: ''

---

**在提出此issue时,我确认了以下几点(保存后请点击复选框):**

- [ ] 我已自己确认这是Sonic自身的Bug。
- [ ] 我接受此issue可能被关闭,并查看开发人员的建议。

**Bug 描述**
清晰地描述Bug的情况与详细复现步骤 | A clear and concise description of what the bug is.
清晰地描述Bug的情况与详细复现步骤 | A clear and concise description of what the bug is.

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

9 changes: 9 additions & 0 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**在提出此拉取请求时,我确认了以下几点(保存后请点击复选框):**

- [ ] 我已检查没有与此请求重复的拉取请求。
- [ ] 我已经考虑过,并确认这份呈件对其他人很有价值。
- [ ] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。

**填写PR内容:**

-
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ public class ElementsController {
@ApiImplicitParam(name = "name", value = "控件名称", dataTypeClass = String.class),
@ApiImplicitParam(name = "value", value = "控件值", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "类型", dataTypeClass = String.class),
@ApiImplicitParam(name = "moduleIds", value = "模块ID", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "page", value = "页码", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "pageSize", value = "页数据大小", dataTypeClass = Integer.class)
})
@GetMapping("/list")
public RespModel<CommentPage<Elements>> findAll(@RequestParam(name = "projectId") int projectId,
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) {
Page<Elements> pageable = new Page<>(page, pageSize);
return new RespModel<>(
RespEnum.SEARCH_OK,
CommentPage.convertFrom(
elementsService.findAll(projectId, type, eleTypes, name, value, pageable)
)
elementsService.findAll(projectId, type, eleTypes, name, value, moduleIds, pageable)
);
}

Expand Down Expand Up @@ -112,10 +112,10 @@ public RespModel<String> save(@Validated @RequestBody ElementsDTO elementsDTO) {
}

@WebAspect
@ApiOperation(value = "复制控件元素",notes ="复制空间元素,按照元素ID")
@ApiImplicitParam(name ="id",value = "元素id",dataTypeClass = Integer.class)
@ApiOperation(value = "复制控件元素", notes = "复制空间元素,按照元素ID")
@ApiImplicitParam(name = "id", value = "元素id", dataTypeClass = Integer.class)
@GetMapping("/copyEle")
public RespModel<String> copy(@RequestParam(name ="id") int id){
public RespModel<String> copy(@RequestParam(name = "id") int id) {
return elementsService.copy(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,22 @@ public class TestCasesController {
@ApiImplicitParam(name = "projectId", value = "项目id", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "platform", value = "平台类型", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "name", value = "用例名称", dataTypeClass = String.class),
@ApiImplicitParam(name = "moduleIds", value = "模块Id", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "page", value = "页码", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "pageSize", value = "页数据大小", dataTypeClass = Integer.class)
})
@GetMapping("/list")
public RespModel<CommentPage<TestCases>> findAll(@RequestParam(name = "projectId") int projectId,
@RequestParam(name = "platform") int platform,
@RequestParam(name = "name") String name,
@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize") int pageSize) {
public RespModel<CommentPage<TestCasesDTO>> findAll(@RequestParam(name = "projectId") int projectId,
@RequestParam(name = "platform") int platform,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "moduleIds[]", required = false) List<Integer> moduleIds,
@RequestParam(name = "page") int page,
@RequestParam(name = "pageSize") int pageSize) {
Page<TestCases> pageable = new Page<>(page, pageSize);
System.out.println(moduleIds);
return new RespModel<>(
RespEnum.SEARCH_OK,
CommentPage.convertFrom(testCasesService.findAll(projectId, platform, name, pageable))
testCasesService.findAll(projectId, platform, name, moduleIds, pageable)
);
}

Expand Down Expand Up @@ -124,8 +127,8 @@ public RespModel<String> save(@Validated @RequestBody TestCasesDTO testCasesDTO,
@ApiOperation(value = "查询测试用例详情", notes = "查找对应用例id的用例详情")
@ApiImplicitParam(name = "id", value = "用例id", dataTypeClass = Integer.class)
@GetMapping
public RespModel<TestCases> findById(@RequestParam(name = "id") int id) {
TestCases testCases = testCasesService.findById(id);
public RespModel<TestCasesDTO> findById(@RequestParam(name = "id") int id) {
TestCasesDTO testCases = testCasesService.findById(id);
if (testCases != null) {
return new RespModel<>(RespEnum.SEARCH_OK, testCases);
} else {
Expand All @@ -141,12 +144,13 @@ public RespModel<List<TestCases>> findByIdIn(@RequestParam(name = "ids[]") List<
return new RespModel<>(RespEnum.SEARCH_OK,
testCasesService.findByIdIn(ids));
}

//记得翻译
@WebAspect
@ApiOperation(value = "复制测试用例", notes = "复制对应用例id的用例详情")
@ApiImplicitParam(name = "id", value = "用例id", dataTypeClass = Integer.class)
@GetMapping("/copy")
public RespModel<String> copyTestById(@RequestParam(name = "id") Integer id){
public RespModel<String> copyTestById(@RequestParam(name = "id") Integer id) {
testCasesService.copyTestById(id);
return new RespModel<>(RespEnum.COPY_OK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class Devices implements Serializable, TypeConverter<Devices, DevicesDTO>
private Integer platform;

@TableField
@Column(value = "is_hm", isNull = false, comment = "是否为鸿蒙类型 1:鸿蒙 0:非鸿蒙")
@Column(value = "is_hm", isNull = false, comment = "是否为鸿蒙类型 1:鸿蒙 0:非鸿蒙", defaultValue = "0")
private Integer isHm;

@TableField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,10 @@ public class Elements implements Serializable, TypeConverter<Elements, ElementsD
@Column(value = "project_id", isNull = false, comment = "所属项目id")
@Index(value = "IDX_PROJECT_ID", columns = {"project_id"})
private Integer projectId;


@TableField
@Column(value = "module_id", isNull = true, comment = "所属项目id", defaultValue = "0")
@Index(value = "IDX_MODULE_ID", columns = {"module_id"})
private Integer moduleId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public class TestCases implements Serializable, TypeConverter<TestCases, TestCas
private Date editTime;

@TableField
@Column(isNull = false, comment = "所属模块")
private String module;
@Column(value = "module_id", isNull = true, comment = "所属模块", defaultValue = "0")
@Index(value = "IDX_MODULE_ID", columns = {"module_id"})
private Integer moduleId;

@TableField
@Column(isNull = false, comment = "用例名称")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class ElementsDTO implements Serializable, TypeConverter<ElementsDTO, Ele
@ApiModelProperty(value = "项目id", required = true, example = "1")
Integer projectId;

@ApiModelProperty(value = "模块id", required = false, example = "1")
Integer moduleId;

@JSONField(serialize = false)
ModulesDTO modulesDTO;

//因为一个控件可以存在于多个步骤,也可以一个步骤有多个同样的控件,所以是多对多关系
@JsonIgnore
@JSONField(serialize = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class TestCasesDTO implements Serializable, TypeConverter<TestCasesDTO, T
@ApiModelProperty(value = "项目id", required = true, example = "1")
Integer projectId;

@ApiModelProperty(value = "模块名称", required = true, example = "xxx模块")
String module;
@ApiModelProperty(value = "模块名称", required = false, example = "xxx模块")
Integer moduleId;

@ApiModelProperty(value = "项目迭代名称", required = true, example = "v1.0.0需求增加")
String version;
Expand All @@ -61,4 +61,7 @@ public class TestCasesDTO implements Serializable, TypeConverter<TestCasesDTO, T
@JsonIgnore
@JSONField(serialize = false)
List<TestSuitesDTO> testSuites;

@JSONField(serialize = false)
ModulesDTO modulesDTO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.cloud.sonic.common.http.RespModel;
import org.cloud.sonic.controller.models.base.CommentPage;
import org.cloud.sonic.controller.models.domain.Elements;
import org.cloud.sonic.controller.models.domain.Steps;
import org.cloud.sonic.controller.models.dto.ElementsDTO;
import org.cloud.sonic.controller.models.dto.StepsDTO;

import java.util.List;

public interface ElementsService extends IService<Elements> {
Page<Elements> findAll(int projectId, String type, List<String> eleTypes, String name, String value, Page<Elements> pageable);
CommentPage<ElementsDTO> findAll(int projectId, String type, List<String> eleTypes, String name, String value, List<Integer> moduleIds, Page<Elements> pageable);

List<StepsDTO> findAllStepsByElementsId(int elementsId);

Expand All @@ -34,4 +36,6 @@ public interface ElementsService extends IService<Elements> {
* @return
*/
Boolean newStepBeLinkedEle(StepsDTO stepsDTO, Steps step);

Boolean updateEleModuleByModuleId(Integer module);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.cloud.sonic.controller.models.base.CommentPage;
import org.cloud.sonic.controller.models.domain.TestCases;
import org.cloud.sonic.controller.models.dto.TestCasesDTO;

import java.util.List;

Expand All @@ -13,13 +15,13 @@
* @date 2021/8/20 17:51
*/
public interface TestCasesService extends IService<TestCases> {
Page<TestCases> findAll(int projectId, int platform, String name, Page<TestCases> pageable);
CommentPage<TestCasesDTO> findAll(int projectId, int platform, String name, List<Integer> moduleIds, Page<TestCases> pageable);

List<TestCases> findAll(int projectId, int platform);

boolean delete(int id);

TestCases findById(int id);
TestCasesDTO findById(int id);

JSONObject findSteps(int id);

Expand All @@ -31,8 +33,11 @@ public interface TestCasesService extends IService<TestCases> {

/**
* 复制测试用例
* @param id 测试用例id (test_cases,步骤表 steps case_id字段)
*
* @param id 测试用例id (test_cases,步骤表 steps case_id字段)
* @return
*/
boolean copyTestById(int id);
boolean copyTestById(int id);

Boolean updateTestCaseModuleByModuleId(Integer module);
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@
@Slf4j
public class DevicesServiceImpl extends SonicServiceImpl<DevicesMapper, Devices> implements DevicesService {

@Autowired private DevicesMapper devicesMapper;
@Autowired private UsersService usersService;
@Autowired private TestSuitesDevicesMapper testSuitesDevicesMapper;
@Autowired private AgentsService agentsService;
@Autowired
private DevicesMapper devicesMapper;
@Autowired
private UsersService usersService;
@Autowired
private TestSuitesDevicesMapper testSuitesDevicesMapper;
@Autowired
private AgentsService agentsService;

@Override
public boolean saveDetail(DeviceDetailChange deviceDetailChange) {
Expand Down Expand Up @@ -95,7 +99,7 @@ public void updateImg(UpdateDeviceImg updateDeviceImg) {
}

@Override
public Page<Devices> findAll(List<String> iOSVersion, List<String> androidVersion,List<String> hmVersion, List<String> manufacturer,
public Page<Devices> findAll(List<String> iOSVersion, List<String> androidVersion, List<String> hmVersion, List<String> manufacturer,
List<String> cpu, List<String> size, List<Integer> agentId, List<String> status,
String deviceInfo, Page<Devices> pageable) {
DevicesSearchParams params = new DevicesSearchParams()
Expand Down Expand Up @@ -185,6 +189,7 @@ public void deviceStatus(JSONObject jsonMsg) {
devices.setImgUrl("");
devices.setTemperature(0);
devices.setLevel(0);
devices.setIsHm(0);
}
devices.setAgentId(jsonMsg.getInteger("agentId"));
if (jsonMsg.getString("name") != null) {
Expand All @@ -201,10 +206,10 @@ public void deviceStatus(JSONObject jsonMsg) {
if (jsonMsg.getString("version") != null) {
devices.setVersion(jsonMsg.getString("version"));
}
if (jsonMsg.getString("platform") != null) {
if (jsonMsg.getInteger("platform") != null) {
devices.setPlatform(jsonMsg.getInteger("platform"));
}
if (jsonMsg.getString("isHm") != null) {
if (jsonMsg.getInteger("isHm") != null) {
devices.setIsHm(jsonMsg.getInteger("isHm"));
}
if (jsonMsg.getString("cpu") != null) {
Expand Down
Loading

0 comments on commit b814451

Please sign in to comment.