Commit 91f031da authored by 赵啸非's avatar 赵啸非

添加服务检测拉起脚本

parent 88ce81d7
......@@ -53,7 +53,6 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
@Override
protected void saveBefore(WorkmanEntity entity, Context context) throws AppException {
if (StringUtils.isNull(entity.getLoginName())) {
throw new AppException("账号不能为空!");
}
......@@ -61,8 +60,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
if (StringUtils.isNull(entity.getLoginPwd())) {
throw new AppException("密码不能为空!");
}
List<WorkmanEntity> list = this.find(new WorkmanQuery().loginName(entity.getLoginName()));
if (CollectionUtils.isNotEmpty(list)) {
int count = this.count(new WorkmanQuery().loginName(entity.getLoginName()),context);
if (count>0) {
throw new AppException("账号已存在!");
}
......
package com.mortals.xhx.module.workman.web;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.alibaba.fastjson.JSON;
......@@ -187,7 +188,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
workmanEntity.setLoginName(loginName);
}
if (ObjectUtils.isEmpty(workmanEntity.getLoginPwd())) {
if (ObjectUtils.isEmpty(workmanEntity.getLoginPwd())||"".equals(workmanEntity.getLoginPwd().trim())) {
workmanEntity.setLoginPwd("123");
}
......@@ -222,6 +223,12 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
public static void main(String[] args) {
System.out.println(StrUtil.cleanBlank(PinyinUtil.getPinyin("张 三", "")));
//
// System.out.println(Base64.encode(new JSONObject().toJSONString()));
// System.out.println( com.mortals.framework.util.Base64.encode(new JSONObject().toJSONString().getBytes()));
//
//
System.out.println(Base64.encode("[]"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment