提交 754e1fe8 authored 作者: 李炎's avatar 李炎

微调

上级 aa2933e2
...@@ -24,7 +24,7 @@ public class LicInfoController { ...@@ -24,7 +24,7 @@ public class LicInfoController {
@ApiOperation("Lic信息列表") @ApiOperation("Lic信息列表")
@GetMapping("/lic/info/list") @GetMapping("/lic/info/list")
public RestResponse licInfoList(@ModelAttribute LicInfoListInVo inVo) { public RestResponse<LicInfoListOutVo> licInfoList(@ModelAttribute LicInfoListInVo inVo) {
LicInfoListOutVo outVo = locInfoService.licInfoList(inVo); LicInfoListOutVo outVo = locInfoService.licInfoList(inVo);
return RestResponse.success(outVo); return RestResponse.success(outVo);
} }
......
...@@ -7,7 +7,7 @@ import lombok.Data; ...@@ -7,7 +7,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
@ApiModel(value = "docker镜像表", description = "私有镜像") @ApiModel(value = "docker镜像表Dto", description = "私有镜像Dto")
public class DockerServiceDto implements Serializable { public class DockerServiceDto implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.system.entity; package com.system.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -25,11 +26,13 @@ public class DockerImage implements Serializable { ...@@ -25,11 +26,13 @@ public class DockerImage implements Serializable {
private Integer id; private Integer id;
@ApiModelProperty(value = "镜像名") @ApiModelProperty(value = "镜像名")
@TableField(value = "`name`")
private String name; private String name;
@ApiModelProperty(value = "服务路径") @ApiModelProperty(value = "服务路径")
private String contextPath; private String contextPath;
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
@TableField(value = "`describe`")
private String describe; private String describe;
} }
...@@ -17,14 +17,17 @@ public class DockerImageVersionServiceImpl extends ServiceImpl<DockerImageVersio ...@@ -17,14 +17,17 @@ public class DockerImageVersionServiceImpl extends ServiceImpl<DockerImageVersio
@Override @Override
public boolean deleteByImageId(Integer imageId) { public boolean deleteByImageId(Integer imageId) {
LambdaQueryWrapper<DockerImageVersion> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DockerImageVersion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DockerImageVersion::getImageId,imageId); wrapper.eq(DockerImageVersion::getImageId, imageId);
if (count(wrapper) == 0) {
return true;
}
return this.remove(wrapper); return this.remove(wrapper);
} }
@Override @Override
public List<DockerImageVersion> listByImageId(Integer imagesId) { public List<DockerImageVersion> listByImageId(Integer imagesId) {
LambdaQueryWrapper<DockerImageVersion> qw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DockerImageVersion> qw = new LambdaQueryWrapper<>();
qw.eq(DockerImageVersion::getImageId,imagesId); qw.eq(DockerImageVersion::getImageId, imagesId);
return list(qw); return list(qw);
} }
} }
......
...@@ -45,6 +45,9 @@ public class LicInfoCreateInVo { ...@@ -45,6 +45,9 @@ public class LicInfoCreateInVo {
*/ */
private List<String> moduleVerification; private List<String> moduleVerification;
/**
* 服务
*/
private List<DockerServiceDto> dockerServices; private List<DockerServiceDto> dockerServices;
/** /**
......
package com.system.transfer.lic; package com.system.transfer.lic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -8,17 +10,20 @@ import java.util.List; ...@@ -8,17 +10,20 @@ import java.util.List;
* @author Inori * @author Inori
*/ */
@Data @Data
@ApiModel(value="LicInfoListOutVo")
public class LicInfoListOutVo { public class LicInfoListOutVo {
/** /**
* 总数 * 总数
*/ */
@ApiModelProperty(value = "条数")
private Integer total; private Integer total;
/** /**
* 记录 * 记录
*/ */
@ApiModelProperty(value = "item")
private List<LicInfoListOutVoRecords> records; private List<LicInfoListOutVoRecords> records;
......
...@@ -3,7 +3,7 @@ package com.system.transfer.response; ...@@ -3,7 +3,7 @@ package com.system.transfer.response;
/** /**
* @author Inori * @author Inori
*/ */
public class RestResponse { public class RestResponse<T> {
public static final int CODE_SUCCESS = 200; public static final int CODE_SUCCESS = 200;
public static final int CODE_VERSION_NONSUPPORT = 305; public static final int CODE_VERSION_NONSUPPORT = 305;
public static final int CODE_PARAM_ERROR = 400; public static final int CODE_PARAM_ERROR = 400;
...@@ -15,7 +15,7 @@ public class RestResponse { ...@@ -15,7 +15,7 @@ public class RestResponse {
private int code; private int code;
private String message; private String message;
private Object data = null; private T data;
public static RestResponse success() { public static RestResponse success() {
RestResponse restResponse = new RestResponse(); RestResponse restResponse = new RestResponse();
...@@ -24,8 +24,8 @@ public class RestResponse { ...@@ -24,8 +24,8 @@ public class RestResponse {
return restResponse; return restResponse;
} }
public static RestResponse success(Object data) { public static <T>RestResponse<T> success(T data) {
RestResponse restResponse = new RestResponse(); RestResponse<T> restResponse = new RestResponse<T>();
restResponse.setCode(200); restResponse.setCode(200);
restResponse.setData(data); restResponse.setData(data);
return restResponse; return restResponse;
...@@ -85,7 +85,7 @@ public class RestResponse { ...@@ -85,7 +85,7 @@ public class RestResponse {
return data; return data;
} }
public void setData(Object data) { public void setData(T data) {
this.data = data; this.data = data;
} }
......
spring: spring:
profiles: profiles:
active: test active: docker
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论