master
elf 8 months ago
parent 9618243b12
commit 871448c627

1
.gitignore vendored

@ -26,6 +26,7 @@ target/
/nbdist/ /nbdist/
/.nb-gradle/ /.nb-gradle/
build/ build/
logs/
### VS Code ### ### VS Code ###
.vscode/ .vscode/

@ -3,6 +3,7 @@ package com.wayn.admin.api.controller.system;
import com.wayn.common.constant.SysConstants; import com.wayn.common.constant.SysConstants;
import com.wayn.common.core.domain.system.Dept; import com.wayn.common.core.domain.system.Dept;
import com.wayn.common.core.service.system.IDeptService; import com.wayn.common.core.service.system.IDeptService;
import com.wayn.common.core.service.system.IUserService;
import com.wayn.common.enums.ReturnCodeEnum; import com.wayn.common.enums.ReturnCodeEnum;
import com.wayn.common.util.R; import com.wayn.common.util.R;
import com.wayn.common.util.security.SecurityUtils; import com.wayn.common.util.security.SecurityUtils;
@ -27,6 +28,9 @@ public class DeptController {
private IDeptService iDeptService; private IDeptService iDeptService;
private IUserService iUserService;
@PreAuthorize("@ss.hasPermi('system:dept:list')") @PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list") @GetMapping("/list")
public R list(Dept dept) { public R list(Dept dept) {
@ -89,7 +93,7 @@ public class DeptController {
if (iDeptService.hasChildByDeptId(deptId)) { if (iDeptService.hasChildByDeptId(deptId)) {
return R.error(ReturnCodeEnum.DEPT_HAS_SUB_DEPT_ERROR); return R.error(ReturnCodeEnum.DEPT_HAS_SUB_DEPT_ERROR);
} }
if (iDeptService.checkDeptExistUser(deptId)) { if (iUserService.checkDeptExistUser(deptId)) {
return R.error(ReturnCodeEnum.DEPT_HAS_USER_ERROR); return R.error(ReturnCodeEnum.DEPT_HAS_USER_ERROR);
} }
return R.result(iDeptService.removeById(deptId)); return R.result(iDeptService.removeById(deptId));

@ -41,7 +41,7 @@ logging:
com.wayn: info com.wayn: info
org.springframework: info org.springframework: info
file: file:
name: ${LOG_PATH_PREFIX:E:/home}/${spring.application.name}/info.log name: ./logs/${spring.application.name}/info.log
management: management:
endpoints: endpoints:
@ -66,6 +66,8 @@ mybatis-plus:
typeAliasesPackage: com.wayn.**.domain typeAliasesPackage: com.wayn.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件 # 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml mapperLocations: classpath*:mapper/**/*Mapper.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
# wayn配置 # wayn配置
wayn: wayn:

@ -2,7 +2,7 @@
<configuration> <configuration>
<springProperty scope="context" name="appName" source="spring.application.name" defaultValue="dev"/> <springProperty scope="context" name="appName" source="spring.application.name" defaultValue="dev"/>
<property name="logPath" value="/home/logs/${appName}"/> <property name="logPath" value="./logs/${appName}"/>
<property name="pattern" <property name="pattern"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{request_id}] [%thread] [%-5level] %logger{36}:%L %M - %msg%n"/> value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{request_id}] [%thread] [%-5level] %logger{36}:%L %M - %msg%n"/>

@ -52,6 +52,9 @@ public interface IUserService extends IService<User> {
*/ */
String checkEmailUnique(User user); String checkEmailUnique(User user);
boolean checkDeptExistUser(Long deptId);
/** /**
* *
* *

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wayn.common.constant.SysConstants; import com.wayn.common.constant.SysConstants;
import com.wayn.common.core.domain.system.Dept;
import com.wayn.common.core.domain.system.Role; import com.wayn.common.core.domain.system.Role;
import com.wayn.common.core.domain.system.User; import com.wayn.common.core.domain.system.User;
import com.wayn.common.core.domain.system.UserRole; import com.wayn.common.core.domain.system.UserRole;
@ -80,6 +81,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
return SysConstants.UNIQUE; return SysConstants.UNIQUE;
} }
@Override
public boolean checkDeptExistUser(Long deptId) {
return count(Wrappers.lambdaQuery(User.class).eq(User::getDeptId, deptId)) > 0;
}
@Override @Override
public boolean insertUserAndRole(User user) { public boolean insertUserAndRole(User user) {
save(user); save(user);

@ -4,9 +4,9 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
# 主库数据源 # 主库数据源
master: master:
jdbc-url: jdbc:mysql://127.0.0.1:3306/wayn_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 jdbc-url: jdbc:mysql://124.223.222.61:3306/shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: elf1990
password: 123456 password: XtN1YiaqP4BxC9MEe
pool-name: hikariCP pool-name: hikariCP
minimum-idle: 100 minimum-idle: 100
maximum-pool-size: 200 maximum-pool-size: 200
@ -51,10 +51,10 @@ spring:
es: es:
config: config:
host: 127.0.0.1 host: 124.223.222.61
port: 9200 port: 9200
username: elastic username: elastic
password: 123456 password: XtN1YiaqP4BxC9MEe
scheme: http scheme: http
shards: 3 shards: 3
replicas: 2 replicas: 2

@ -95,9 +95,9 @@ public class LoginController {
return R.error(ReturnCodeEnum.USER_REGISTER_MOBILE_ERROR); return R.error(ReturnCodeEnum.USER_REGISTER_MOBILE_ERROR);
} }
// 判断用户输入邮箱验证码是否正确 // 判断用户输入邮箱验证码是否正确
if (registryObj.getEmailCode() == null || !redisEmailCode.equals(registryObj.getEmailCode().trim().toLowerCase())) { // if (registryObj.getEmailCode() == null || !redisEmailCode.equals(registryObj.getEmailCode().trim().toLowerCase())) {
return R.error(ReturnCodeEnum.USER_EMAIL_CODE_ERROR); // return R.error(ReturnCodeEnum.USER_EMAIL_CODE_ERROR);
} // }
// 删除验证码 // 删除验证码
redisCache.deleteObject(registryObj.getCaptchaKey()); redisCache.deleteObject(registryObj.getCaptchaKey());
redisCache.deleteObject(registryObj.getEmailKey()); redisCache.deleteObject(registryObj.getEmailKey());

@ -36,7 +36,7 @@ token:
# 日志配置 # 日志配置
logging: logging:
file: file:
name: ${LOG_PATH_PREFIX:E:/home/logs}/${spring.application.name}/info.log name: ./logs/${spring.application.name}/info.log
# mybatis plus 配置 # mybatis plus 配置
mybatis-plus: mybatis-plus:

@ -2,7 +2,7 @@
<configuration> <configuration>
<springProperty scope="context" name="appName" source="spring.application.name" defaultValue="dev"/> <springProperty scope="context" name="appName" source="spring.application.name" defaultValue="dev"/>
<property name="logPath" value="/home/logs/${appName}"/> <property name="logPath" value="./logs/${appName}"/>
<property name="pattern" <property name="pattern"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{request_id}] [%thread] [%-5level] %logger{36}:%L %M - %msg%n"/> value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{request_id}] [%thread] [%-5level] %logger{36}:%L %M - %msg%n"/>

Loading…
Cancel
Save