提交 b794b4d8 编写于 作者: wenhao.qin's avatar wenhao.qin

fix-代码完善

上级 61489083
流水线 #42969 已取消 于阶段
......@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class DoctorReq {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("姓名")
......
......@@ -70,9 +70,9 @@ public class HospitalSaasUserReq {
if (null == this.sourceType) {
throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "资源类型不能为空!");
}
// if (!Pattern.matches("^[A-Za-z0-9]{5,10}$", this.password)) {
// throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "密码需由6-10位字母或数字组成!");
// }
if (!Pattern.matches("^[A-Za-z0-9]{5,10}$", this.password)) {
throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "密码需由6-10位字母或数字组成!");
}
if (Objects.nonNull(this.comment) && this.comment.length() > 100) {
throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "备注长度须≤100字符");
}
......
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -9,9 +10,10 @@ import lombok.Data;
*/
@Data
public class HospitalRoleDetailDto {
@ApiModelProperty("角色名称")
private String roleName;
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("备注")
private String remark;
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -9,16 +10,16 @@ import lombok.Data;
*/
@Data
public class HospitalRoleDto {
@ApiModelProperty("角色名称")
private String roleName;
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("创建人名称")
private String createName;
@ApiModelProperty("创建人id")
private String createId;
@ApiModelProperty("创建时间")
private Long createTime;
}
......@@ -9,8 +9,6 @@ import com.pica.cloud.account.account.server.req.HospitalRoleDetailReq;
import com.pica.cloud.account.account.server.req.HospitalRoleListReq;
import com.pica.cloud.account.account.server.resp.*;
import com.pica.cloud.account.account.server.service.HospitalSaasRoleService;
import com.pica.cloud.foundation.entity.PicaException;
import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.entity.PicaResultCode;
import com.pica.cloud.foundation.entity.PicaWarnException;
import com.pica.cloud.foundation.utils.entity.PicaUser;
......@@ -37,11 +35,11 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
@Override
public int insertAndModify(HospitalRoleDetailReq req, PicaUser user) {
if (StringUtils.isEmpty(req.getName()) || req.getName().trim().length() > 16) {
throw new PicaWarnException(PicaResultCode.DATA_EXCEPTION.code(), "长度≤16字符");
throw new PicaWarnException(PicaResultCode.DATA_EXCEPTION.code(), "姓名长度≤16字符");
}
if (StringUtils.isEmpty(req.getRemark()) || req.getName().trim().length() > 100) {
throw new PicaWarnException(PicaResultCode.DATA_EXCEPTION.code(), "长度≤100字符");
throw new PicaWarnException(PicaResultCode.DATA_EXCEPTION.code(), "备注长度≤100字符");
}
if (Objects.nonNull(req.getId()) && (req.getId() <= 4 )) {
......@@ -76,8 +74,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
@Override
public HospitalRoleResp listByPage(HospitalRoleListReq req) {
ArrayList<Object> list = new ArrayList<>(3);
Arrays.asList(1, 2);
List<Integer> list = Arrays.asList(1, 2);
Map<String, Object> map = new HashMap(4);
map.put("list", list);
map.put("name", req.getName());
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册