Commit fd3da40a by aye

代码提交

parent b9da2c02
package com.jty.nrsc;
package com.jty.wsxt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package com.jty.nrsc.application;
package com.jty.wsxt.application;
import com.jty.nrsc.application.service.AuthRoleServer;
import com.jty.nrsc.application.service.AuthUserServer;
import com.jty.nrsc.application.service.NrscAuthorityServer;
import com.jty.nrsc.application.service.NrscTeacherService;
import com.jty.wsxt.application.service.AuthRoleServer;
import com.jty.wsxt.application.service.AuthUserServer;
import com.jty.wsxt.application.service.NrscAuthorityServer;
import com.jty.wsxt.application.service.NrscTeacherService;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
......
......@@ -7,6 +7,6 @@
* 对内 调用领域层(领域对象或领域服务)完成各种业务逻辑任务(task)。
* 这一层也很适合写一些任务处理,日志监控
**/
package com.jty.nrsc.application;
package com.jty.wsxt.application;
package com.jty.nrsc.application.service;
package com.jty.wsxt.application.service;
import org.springframework.security.core.GrantedAuthority;
......
package com.jty.nrsc.application.service;
package com.jty.wsxt.application.service;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.nrsc.interfaces.dto.AuthRoleDto;
import org.springframework.data.domain.Page;
......
package com.jty.nrsc.application.service;
package com.jty.wsxt.application.service;
import com.jty.nrsc.domain.model.auth.history.AuthUserHistory;
import com.jty.wsxt.domain.model.auth.history.AuthUserHistory;
import com.jty.nrsc.interfaces.dto.AuthUserHistoryDto;
import com.jty.nrsc.interfaces.dto.OperatorDto;
import org.springframework.data.domain.Page;
......
package com.jty.nrsc.application.service;
package com.jty.wsxt.application.service;
import com.jty.nrsc.domain.model.auth.authority.nrsc.NrscAuthority;
import com.jty.wsxt.domain.model.auth.authority.nrsc.NrscAuthority;
import java.util.List;
......
package com.jty.nrsc.application.service;
package com.jty.wsxt.application.service;
import com.jty.nrsc.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.nrsc.interfaces.dto.ChangePasswordDto;
import com.jty.wsxt.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.nrsc.interfaces.dto.NrscTeacherDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherSearchDto;
import com.jty.nrsc.interfaces.dto.OperatorDto;
......
package com.jty.nrsc.application.service.impl;
package com.jty.wsxt.application.service.impl;
import com.jty.nrsc.application.service.AuthAuthorityService;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.authority.AuthAuthority;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.wsxt.application.service.AuthAuthorityService;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.authority.AuthAuthority;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
......
package com.jty.nrsc.application.service.impl;
package com.jty.wsxt.application.service.impl;
import com.jty.nrsc.application.service.AuthRoleServer;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.authority.AuthAuthority;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.wsxt.application.service.AuthRoleServer;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.authority.AuthAuthority;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.nrsc.interfaces.dto.AuthRoleDto;
......@@ -12,9 +12,6 @@ import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.util.Iterator;
import java.util.List;
/**
* AuthRoleServerImpl
*
......
package com.jty.nrsc.application.service.impl;
package com.jty.wsxt.application.service.impl;
import com.jty.nrsc.application.service.AuthUserServer;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.history.*;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.wsxt.application.service.AuthUserServer;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.history.*;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.nrsc.infrastructure.DomainEventPublisher;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
......
package com.jty.nrsc.application.service.impl;
package com.jty.wsxt.application.service.impl;
import com.jty.nrsc.application.service.NrscAuthorityServer;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.authority.nrsc.NrscAuthority;
import com.jty.wsxt.application.service.NrscAuthorityServer;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.authority.nrsc.NrscAuthority;
import org.springframework.stereotype.Service;
import java.util.List;
......
package com.jty.nrsc.application.service.impl;
import com.jty.nrsc.application.ApplicationRegistry;
import com.jty.nrsc.application.service.NrscTeacherService;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.nrsc.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.nrsc.domain.model.stage.BasicStage;
import com.jty.nrsc.domain.model.subject.BasicSubject;
package com.jty.wsxt.application.service.impl;
import com.jty.wsxt.application.ApplicationRegistry;
import com.jty.wsxt.application.service.NrscTeacherService;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.wsxt.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.wsxt.domain.model.stage.BasicStage;
import com.jty.wsxt.domain.model.subject.BasicSubject;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.nrsc.interfaces.dto.ChangePasswordDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherSearchDto;
import com.jty.nrsc.interfaces.dto.OperatorDto;
......@@ -18,7 +17,6 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.hibernate.query.criteria.internal.OrderImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.security.crypto.password.PasswordEncoder;
......@@ -26,7 +24,6 @@ import org.springframework.stereotype.Service;
import javax.persistence.criteria.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
......
package com.jty.nrsc.domain;
package com.jty.wsxt.domain;
import com.jty.nrsc.domain.model.auth.authority.AuthAuthorityRepository;
import com.jty.nrsc.domain.model.auth.authority.nrsc.NrscAuthorityRepository;
import com.jty.nrsc.domain.model.auth.client.ClientRepository;
import com.jty.nrsc.domain.model.auth.history.AuthUserHistoryRepository;
import com.jty.nrsc.domain.model.auth.role.RoleRepository;
import com.jty.nrsc.domain.model.auth.user.UserRepository;
import com.jty.nrsc.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.nrsc.domain.model.auth.user.nrsc.NrscTeacherRepository;
import com.jty.nrsc.domain.model.stage.BasicStageRepository;
import com.jty.nrsc.domain.model.subject.BasicSubjectRepository;
import com.jty.wsxt.domain.model.auth.authority.AuthAuthorityRepository;
import com.jty.wsxt.domain.model.auth.authority.nrsc.NrscAuthorityRepository;
import com.jty.wsxt.domain.model.auth.client.ClientRepository;
import com.jty.wsxt.domain.model.auth.history.AuthUserHistoryRepository;
import com.jty.wsxt.domain.model.auth.role.RoleRepository;
import com.jty.wsxt.domain.model.auth.user.UserRepository;
import com.jty.wsxt.domain.model.auth.user.nrsc.NrscTeacherRepository;
import com.jty.wsxt.domain.model.stage.BasicStageRepository;
import com.jty.wsxt.domain.model.subject.BasicSubjectRepository;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
......
package com.jty.nrsc.domain.model.auth.authority;
package com.jty.wsxt.domain.model.auth.authority;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.nrsc.domain.shared.IdentifiedValueObject;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
......
package com.jty.nrsc.domain.model.auth.authority;
package com.jty.wsxt.domain.model.auth.authority;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......
package com.jty.nrsc.domain.model.auth.authority.nrsc;
package com.jty.wsxt.domain.model.auth.authority.nrsc;
import com.jty.nrsc.domain.model.auth.authority.AuthAuthority;
import com.jty.wsxt.domain.model.auth.authority.AuthAuthority;
import lombok.Data;
import javax.persistence.DiscriminatorValue;
......
package com.jty.nrsc.domain.model.auth.authority.nrsc;
package com.jty.wsxt.domain.model.auth.authority.nrsc;
import org.springframework.data.jpa.repository.JpaRepository;
......
package com.jty.nrsc.domain.model.auth.client;
package com.jty.wsxt.domain.model.auth.client;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import lombok.Data;
import javax.persistence.Entity;
......
package com.jty.nrsc.domain.model.auth.client;
package com.jty.wsxt.domain.model.auth.client;
import org.springframework.data.jpa.repository.JpaRepository;
......
package com.jty.nrsc.domain.model.auth.history;
package com.jty.wsxt.domain.model.auth.history;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import lombok.Data;
import javax.persistence.Embedded;
......
package com.jty.nrsc.domain.model.auth.history;
package com.jty.wsxt.domain.model.auth.history;
import org.springframework.data.jpa.repository.JpaRepository;
......
package com.jty.nrsc.domain.model.auth.history;
package com.jty.wsxt.domain.model.auth.history;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.user.DisableUserEvent;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.user.DisableUserEvent;
import com.jty.nrsc.infrastructure.DomainEventSubscriber;
/**
......
package com.jty.nrsc.domain.model.auth.history;
package com.jty.wsxt.domain.model.auth.history;
import com.jty.nrsc.domain.model.auth.user.DisableUserEvent;
import com.jty.nrsc.domain.model.auth.user.EnableUserEvent;
import com.jty.wsxt.domain.model.auth.user.EnableUserEvent;
import com.jty.nrsc.infrastructure.DomainEventSubscriber;
/**
......
package com.jty.nrsc.domain.model.auth.history;
package com.jty.wsxt.domain.model.auth.history;
import com.jty.nrsc.domain.shared.ValueObject;
import com.jty.wsxt.domain.shared.ValueObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.jty.nrsc.domain.model.auth.history;
package com.jty.wsxt.domain.model.auth.history;
import com.jty.nrsc.domain.shared.ValueObject;
import com.jty.wsxt.domain.shared.ValueObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.jty.nrsc.domain.model.auth.role;
package com.jty.wsxt.domain.model.auth.role;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.nrsc.domain.model.auth.authority.AuthAuthority;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.nrsc.domain.shared.IdentifiedValueObject;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.wsxt.domain.model.auth.authority.AuthAuthority;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import lombok.Data;
......
package com.jty.nrsc.domain.model.auth.role;
package com.jty.wsxt.domain.model.auth.role;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
/**
......
package com.jty.nrsc.domain.model.auth.user;
package com.jty.wsxt.domain.model.auth.user;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.nrsc.domain.model.auth.history.ManagerId;
import com.jty.nrsc.domain.model.auth.history.OperatorId;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.wsxt.domain.model.auth.history.ManagerId;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import com.jty.nrsc.infrastructure.DomainEventPublisher;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
......
package com.jty.nrsc.domain.model.auth.user;
package com.jty.wsxt.domain.model.auth.user;
import com.jty.nrsc.domain.model.auth.history.ManagerId;
import com.jty.nrsc.domain.model.auth.history.OperatorId;
import com.jty.wsxt.domain.model.auth.history.ManagerId;
import com.jty.nrsc.infrastructure.DomainEvent;
import com.jty.nrsc.interfaces.dto.OperatorDto;
import lombok.AllArgsConstructor;
......
package com.jty.nrsc.domain.model.auth.user;
package com.jty.wsxt.domain.model.auth.user;
import com.jty.nrsc.domain.model.auth.history.ManagerId;
import com.jty.nrsc.domain.model.auth.history.OperatorId;
import com.jty.wsxt.domain.model.auth.history.ManagerId;
import com.jty.nrsc.infrastructure.DomainEvent;
import com.jty.nrsc.interfaces.dto.OperatorDto;
import lombok.AllArgsConstructor;
......
package com.jty.nrsc.domain.model.auth.user;
package com.jty.wsxt.domain.model.auth.user;
import org.springframework.data.jpa.repository.JpaRepository;
......
package com.jty.nrsc.domain.model.auth.user.nrsc;
import com.jty.nrsc.domain.DomainRegistry;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.nrsc.domain.model.stage.BasicStage;
import com.jty.nrsc.domain.model.subject.BasicSubject;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.nrsc.infrastructure.constants.TableConstants;
package com.jty.wsxt.domain.model.auth.user.nrsc;
import com.jty.wsxt.domain.DomainRegistry;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.wsxt.domain.model.stage.BasicStage;
import com.jty.wsxt.domain.model.subject.BasicSubject;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import lombok.Data;
......
package com.jty.nrsc.domain.model.auth.user.nrsc;
package com.jty.wsxt.domain.model.auth.user.nrsc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......
package com.jty.nrsc.domain.model.stage;
package com.jty.wsxt.domain.model.stage;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import lombok.Data;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
......
package com.jty.nrsc.domain.model.stage;
package com.jty.wsxt.domain.model.stage;
import org.springframework.data.jpa.repository.JpaRepository;
......
package com.jty.nrsc.domain.model.subject;
package com.jty.wsxt.domain.model.subject;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.nrsc.domain.shared.IdentifiedEntityObject;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.wsxt.domain.shared.IdentifiedEntityObject;
import lombok.Data;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
......
package com.jty.nrsc.domain.model.subject;
package com.jty.wsxt.domain.model.subject;
import com.jty.nrsc.domain.model.stage.BasicStage;
import org.springframework.data.jpa.repository.JpaRepository;
/**
......
......@@ -11,4 +11,4 @@
* 工厂(Factories): 创建复杂对象,隐藏创建细节
* 仓储(Repository): 提供查找和持久化对象的方法
*/
package com.jty.nrsc.domain;
\ No newline at end of file
package com.jty.wsxt.domain;
\ No newline at end of file
package com.jty.nrsc.domain.shared;
package com.jty.wsxt.domain.shared;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
......
package com.jty.nrsc.domain.shared;
package com.jty.wsxt.domain.shared;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
......
package com.jty.nrsc.domain.shared;
package com.jty.wsxt.domain.shared;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
......
package com.jty.nrsc.infrastructure;
package com.jty.wsxt.infrastructure;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
......
package com.jty.nrsc.infrastructure;
package com.jty.wsxt.infrastructure;
/**
* 领域事件超级父类
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import javax.servlet.ServletRequest;
import java.io.BufferedReader;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import java.io.Serializable;
import java.time.LocalDateTime;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import com.jty.nrsc.infrastructure.code.image.ImageCodeGenerator;
import com.jty.nrsc.infrastructure.code.sms.DefaultSmsCodeSender;
import com.jty.nrsc.infrastructure.code.sms.SmsCodeSender;
import com.jty.nrsc.infrastructure.properties.SecurityProperties;
import com.jty.wsxt.infrastructure.code.image.ImageCodeGenerator;
import com.jty.wsxt.infrastructure.code.sms.DefaultSmsCodeSender;
import com.jty.wsxt.infrastructure.code.sms.SmsCodeSender;
import com.jty.wsxt.infrastructure.properties.SecurityProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import com.jty.nrsc.infrastructure.properties.SecurityConstants;
import com.jty.wsxt.infrastructure.properties.SecurityConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.wsxt.infrastructure.support.ResultCode;
import org.springframework.security.core.AuthenticationException;
/**
......
/**
*
*/
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import com.jty.nrsc.infrastructure.properties.SecurityProperties;
import com.jty.wsxt.infrastructure.properties.SecurityProperties;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -71,7 +71,7 @@ public class ValidateCodeFilter extends OncePerRequestFilter implements Initiali
/**
* 讲系统中配置的需要校验验证码的URL根据校验的类型放入map
*
*
* @param urlString
* @param type
*/
......@@ -109,7 +109,7 @@ public class ValidateCodeFilter extends OncePerRequestFilter implements Initiali
/**
* 获取校验码的类型,如果当前请求不需要校验,则返回null
*
*
* @param request
* @return
*/
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import org.springframework.web.context.request.ServletWebRequest;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import org.springframework.web.context.request.ServletWebRequest;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import org.springframework.web.context.request.ServletWebRequest;
......
/**
*
*/
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import org.springframework.beans.factory.annotation.Autowired;
......
package com.jty.nrsc.infrastructure.code;
package com.jty.wsxt.infrastructure.code;
import com.jty.nrsc.infrastructure.properties.SecurityConstants;
import com.jty.wsxt.infrastructure.properties.SecurityConstants;
/**
* 验证码类型枚举
......
package com.jty.nrsc.infrastructure.code.image;
package com.jty.wsxt.infrastructure.code.image;
import com.jty.nrsc.infrastructure.code.ValidateCode;
import com.jty.wsxt.infrastructure.code.ValidateCode;
import lombok.Data;
import java.awt.image.BufferedImage;
......
package com.jty.nrsc.infrastructure.code.image;
package com.jty.wsxt.infrastructure.code.image;
import com.jty.nrsc.infrastructure.code.ValidateCodeGenerator;
import com.jty.nrsc.infrastructure.properties.SecurityProperties;
import com.jty.wsxt.infrastructure.code.ValidateCodeGenerator;
import com.jty.wsxt.infrastructure.properties.SecurityProperties;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;
......
/**
*
*/
package com.jty.nrsc.infrastructure.code.image;
package com.jty.wsxt.infrastructure.code.image;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jty.nrsc.infrastructure.code.impl.AbstractValidateCodeProcessor;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.code.impl.AbstractValidateCodeProcessor;
import com.jty.wsxt.infrastructure.support.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.ServletWebRequest;
......
/**
*
*/
package com.jty.nrsc.infrastructure.code.impl;
package com.jty.wsxt.infrastructure.code.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jty.nrsc.infrastructure.code.*;
import com.jty.wsxt.infrastructure.code.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestBindingException;
......
package com.jty.nrsc.infrastructure.code.impl;
package com.jty.wsxt.infrastructure.code.impl;
import com.jty.nrsc.infrastructure.code.ValidateCode;
import com.jty.nrsc.infrastructure.code.ValidateCodeException;
import com.jty.nrsc.infrastructure.code.ValidateCodeRepository;
import com.jty.nrsc.infrastructure.code.ValidateCodeType;
import com.jty.wsxt.infrastructure.code.ValidateCode;
import com.jty.wsxt.infrastructure.code.ValidateCodeException;
import com.jty.wsxt.infrastructure.code.ValidateCodeRepository;
import com.jty.wsxt.infrastructure.code.ValidateCodeType;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
......
package com.jty.nrsc.infrastructure.code.sms;
package com.jty.wsxt.infrastructure.code.sms;
import com.aliyuncs.exceptions.ClientException;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.wsxt.infrastructure.support.BusinessException;
import com.jty.wsxt.infrastructure.support.ResultCode;
import lombok.extern.slf4j.Slf4j;
/**
......
package com.jty.nrsc.infrastructure.code.sms;
package com.jty.wsxt.infrastructure.code.sms;
import com.jty.nrsc.infrastructure.code.ValidateCode;
import com.jty.nrsc.infrastructure.code.ValidateCodeGenerator;
import com.jty.nrsc.infrastructure.properties.SecurityProperties;
import com.jty.wsxt.infrastructure.code.ValidateCode;
import com.jty.wsxt.infrastructure.code.ValidateCodeGenerator;
import com.jty.wsxt.infrastructure.properties.SecurityProperties;
import org.apache.commons.lang.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......
package com.jty.nrsc.infrastructure.code.sms;
package com.jty.wsxt.infrastructure.code.sms;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jty.nrsc.infrastructure.code.ValidateCode;
import com.jty.nrsc.infrastructure.code.impl.AbstractValidateCodeProcessor;
import com.jty.nrsc.infrastructure.properties.SecurityConstants;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.code.ValidateCode;
import com.jty.wsxt.infrastructure.code.impl.AbstractValidateCodeProcessor;
import com.jty.wsxt.infrastructure.properties.SecurityConstants;
import com.jty.wsxt.infrastructure.support.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.ServletRequestUtils;
......
/**
*
*/
package com.jty.nrsc.infrastructure.code.sms;
package com.jty.wsxt.infrastructure.code.sms;
/**
* 短信验证码生成器
......
package com.jty.nrsc.infrastructure.code.sms;
package com.jty.wsxt.infrastructure.code.sms;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
......@@ -9,7 +9,7 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.jty.nrsc.infrastructure.constants.AlibabaConstants;
import com.jty.wsxt.infrastructure.constants.AlibabaConstants;
import java.text.SimpleDateFormat;
import java.util.Date;
......
package com.jty.nrsc.infrastructure.config;
package com.jty.wsxt.infrastructure.config;
import com.jty.nrsc.infrastructure.security.MyClientDetailService;
import com.jty.nrsc.infrastructure.security.MyUserDetailService;
import com.jty.wsxt.infrastructure.security.MyClientDetailService;
import com.jty.wsxt.infrastructure.security.MyUserDetailService;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
......
package com.jty.nrsc.infrastructure.config;
package com.jty.wsxt.infrastructure.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
......
package com.jty.nrsc.infrastructure.config;
package com.jty.wsxt.infrastructure.config;
import com.jty.nrsc.infrastructure.code.ValidateCodeSecurityConfig;
import com.jty.nrsc.infrastructure.security.CustomAuthenticationFilter;
import com.jty.nrsc.infrastructure.security.CustomTokenFilter;
import com.jty.nrsc.infrastructure.security.embed.EmbedAuthenticationConfig;
import com.jty.wsxt.infrastructure.code.ValidateCodeSecurityConfig;
import com.jty.wsxt.infrastructure.security.CustomAuthenticationFilter;
import com.jty.wsxt.infrastructure.security.CustomTokenFilter;
import com.jty.wsxt.infrastructure.security.embed.EmbedAuthenticationConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
package com.jty.nrsc.infrastructure.config;
package com.jty.wsxt.infrastructure.config;
import com.jty.nrsc.infrastructure.properties.SecurityProperties;
import com.jty.nrsc.infrastructure.security.MyRedisTokenStore;
import com.jty.wsxt.infrastructure.properties.SecurityProperties;
import com.jty.wsxt.infrastructure.security.MyRedisTokenStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
......
package com.jty.nrsc.infrastructure.config;
package com.jty.wsxt.infrastructure.config;
import com.jty.nrsc.infrastructure.security.embed.EmbedAuthenticationProvider;
import com.jty.wsxt.infrastructure.security.embed.EmbedAuthenticationProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
......@@ -7,4 +7,4 @@
* 为用户界面层 提供组件配置
* 基础设施层还能够通过架构框架来支持四个层次间的交互模式。
*/
package com.jty.nrsc.infrastructure;
\ No newline at end of file
package com.jty.wsxt.infrastructure;
\ No newline at end of file
package com.jty.nrsc.infrastructure.properties;
package com.jty.wsxt.infrastructure.properties;
public interface SecurityConstants {
......
package com.jty.nrsc.infrastructure.properties;
package com.jty.wsxt.infrastructure.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
......
/**
*
*/
package com.jty.nrsc.infrastructure.properties;
package com.jty.wsxt.infrastructure.properties;
import lombok.Data;
......@@ -13,7 +13,7 @@ import lombok.Data;
public class ValidateCodeProperties {
private ImageCodeProperties image = new ImageCodeProperties();
private SmsCodeProperties sms = new SmsCodeProperties();
}
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import lombok.Getter;
import lombok.Setter;
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang.StringUtils;
......@@ -31,7 +31,7 @@ public class CustomAuthenticationFilter extends UsernamePasswordAuthenticationFi
ObjectMapper mapper = new ObjectMapper();
UsernamePasswordAuthenticationToken authRequest = null;
try (InputStream is = request.getInputStream()){
AuthenticationBean authenticationBean = mapper.readValue(is,AuthenticationBean.class);
AuthenticationBean authenticationBean = mapper.readValue(is, AuthenticationBean.class);
authRequest = new UsernamePasswordAuthenticationToken(
authenticationBean.getUsername(), authenticationBean.getPassword());
}catch (IOException e) {
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.util.HeadUtils;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.util.HeadUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import com.jty.nrsc.domain.model.auth.client.AuthClient;
import com.jty.nrsc.domain.model.auth.client.ClientRepository;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.wsxt.domain.model.auth.client.AuthClient;
import com.jty.wsxt.domain.model.auth.client.ClientRepository;
import com.jty.wsxt.infrastructure.support.BusinessException;
import com.jty.wsxt.infrastructure.support.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.ClientDetailsService;
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import com.jty.nrsc.application.service.AuthAuthorityService;
import com.jty.nrsc.domain.model.auth.user.AuthUser;
import com.jty.nrsc.domain.model.auth.user.UserRepository;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.wsxt.application.service.AuthAuthorityService;
import com.jty.wsxt.domain.model.auth.user.AuthUser;
import com.jty.wsxt.domain.model.auth.user.UserRepository;
import com.jty.wsxt.infrastructure.support.BusinessException;
import com.jty.wsxt.infrastructure.support.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
......
package com.jty.nrsc.infrastructure.security;
package com.jty.wsxt.infrastructure.security;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.nrsc.interfaces.dto.NrscTeacherDto;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.support.ResultCode;
import com.jty.wsxt.interfaces.dto.NrscTeacherDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.http.HttpStatus;
......
package com.jty.nrsc.infrastructure.security.authentication;
package com.jty.wsxt.infrastructure.security.authentication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
......
package com.jty.nrsc.infrastructure.security.authentication;
package com.jty.wsxt.infrastructure.security.authentication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
package com.jty.nrsc.infrastructure.security.authentication;
package com.jty.wsxt.infrastructure.security.authentication;
import com.jty.nrsc.infrastructure.properties.SecurityConstants;
import com.jty.wsxt.infrastructure.properties.SecurityConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
......
package com.jty.nrsc.infrastructure.security.authentication;
package com.jty.wsxt.infrastructure.security.authentication;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jty.nrsc.infrastructure.code.ValidateCodeException;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.wsxt.infrastructure.code.ValidateCodeException;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.support.ResultCode;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
package com.jty.nrsc.infrastructure.security.authentication;
package com.jty.wsxt.infrastructure.security.authentication;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.util.HeadUtils;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.util.HeadUtils;
import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
package com.jty.nrsc.infrastructure.security.embed;
package com.jty.wsxt.infrastructure.security.embed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
......
package com.jty.nrsc.infrastructure.security.embed;
package com.jty.wsxt.infrastructure.security.embed;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jty.nrsc.infrastructure.code.BodyReaderHttpServletRequestWrapper;
import com.jty.nrsc.infrastructure.security.AuthenticationBean;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.nrsc.infrastructure.util.HeadUtils;
import com.jty.wsxt.infrastructure.code.BodyReaderHttpServletRequestWrapper;
import com.jty.wsxt.infrastructure.security.AuthenticationBean;
import com.jty.wsxt.infrastructure.support.BusinessException;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.support.ResultCode;
import com.jty.wsxt.infrastructure.util.HeadUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.InitializingBean;
......@@ -77,7 +77,7 @@ public class EmbedAuthenticationFilter extends OncePerRequestFilter implements I
||StringUtils.equalsIgnoreCase(MediaType.APPLICATION_JSON_VALUE,request.getContentType())){
try (InputStream is = request.getInputStream()){
ObjectMapper mapper = new ObjectMapper();
AuthenticationBean authenticationBean = mapper.readValue(is,AuthenticationBean.class);
AuthenticationBean authenticationBean = mapper.readValue(is, AuthenticationBean.class);
userName=authenticationBean.getUsername();
}
}else{
......
package com.jty.nrsc.infrastructure.security.embed;
package com.jty.wsxt.infrastructure.security.embed;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.wsxt.infrastructure.support.BusinessException;
import com.jty.wsxt.infrastructure.support.ResultCode;
import org.apache.commons.lang.StringUtils;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication;
......
package com.jty.nrsc.infrastructure.security.embed;
package com.jty.wsxt.infrastructure.security.embed;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
......
package com.jty.nrsc.infrastructure.support;
package com.jty.wsxt.infrastructure.support;
import lombok.Data;
......@@ -23,7 +23,7 @@ public class BusinessException extends RuntimeException{
* @param code
* @param message
*/
public BusinessException(ResultCode code,String... message){
public BusinessException(ResultCode code, String... message){
String meg=code.message();
code.setMessage(String.format(meg,message));
this.code=code;
......
package com.jty.nrsc.infrastructure.support;
package com.jty.wsxt.infrastructure.support;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -33,7 +33,7 @@ public class GlobalExceptionHandler {
* @param ex
* @return //
*/
@ExceptionHandler({MissingServletRequestParameterException.class,BusinessException.class})
@ExceptionHandler({MissingServletRequestParameterException.class, BusinessException.class})
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public Result handleRuntimeException(BusinessException ex) {
//logger.info("catch BusinessException:"+ ex.toString());
......
package com.jty.nrsc.infrastructure.support;
package com.jty.wsxt.infrastructure.support;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
......
package com.jty.nrsc.infrastructure.support;
package com.jty.wsxt.infrastructure.support;
import com.fasterxml.jackson.annotation.JsonView;
import lombok.Data;
......
package com.jty.nrsc.infrastructure.util;
package com.jty.wsxt.infrastructure.util;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.crypto.codec.Base64;
......
package com.jty.nrsc.infrastructure.util;
package com.jty.wsxt.infrastructure.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
package com.jty.nrsc.interfaces;
package com.jty.wsxt.interfaces;
import com.jty.nrsc.domain.model.auth.authority.AuthAuthority;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.nrsc.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.nrsc.interfaces.dto.AuthAuthorityDto;
import com.jty.nrsc.interfaces.dto.AuthRoleDto;
import com.jty.nrsc.interfaces.dto.NrscRoleDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherDto;
import com.jty.wsxt.domain.model.auth.authority.AuthAuthority;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.wsxt.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.wsxt.interfaces.dto.AuthAuthorityDto;
import com.jty.wsxt.interfaces.dto.AuthRoleDto;
import com.jty.wsxt.interfaces.dto.NrscRoleDto;
import com.jty.wsxt.interfaces.dto.NrscTeacherDto;
import org.apache.commons.collections.CollectionUtils;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
......
package com.jty.nrsc.interfaces.controller;
package com.jty.wsxt.interfaces.controller;
import com.jty.nrsc.application.ApplicationRegistry;
import com.jty.nrsc.domain.model.auth.role.AuthRole;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.interfaces.Assembler;
import com.jty.nrsc.interfaces.dto.AuthRoleDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherDto;
import com.jty.wsxt.application.ApplicationRegistry;
import com.jty.wsxt.domain.model.auth.role.AuthRole;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.interfaces.Assembler;
import com.jty.wsxt.interfaces.dto.AuthRoleDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.security.access.prepost.PreAuthorize;
......
package com.jty.nrsc.interfaces.controller;
package com.jty.wsxt.interfaces.controller;
import com.jty.nrsc.application.ApplicationRegistry;
import com.jty.nrsc.domain.model.auth.history.AuthUserHistory;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.util.PoCastUtils;
import com.jty.nrsc.interfaces.dto.AuthUserHistoryDto;
import com.jty.wsxt.application.ApplicationRegistry;
import com.jty.wsxt.domain.model.auth.history.AuthUserHistory;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.util.PoCastUtils;
import com.jty.wsxt.interfaces.dto.AuthUserHistoryDto;
import org.springframework.data.domain.Page;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
......@@ -20,9 +19,9 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class AuthUserController {
@GetMapping("/history/user/{userId}")
public Result getHistoryByManagerId(AuthUserHistoryDto authUserHistoryDto,@PathVariable Integer userId){
public Result getHistoryByManagerId(AuthUserHistoryDto authUserHistoryDto, @PathVariable Integer userId){
authUserHistoryDto.setManagerId(userId);
Page<AuthUserHistory> userHistoryPage = ApplicationRegistry.authUserServer().findHistoryByManagerId(authUserHistoryDto);
return Result.success(PoCastUtils.poPageCastToDto(userHistoryPage,AuthUserHistoryDto.class));
return Result.success(PoCastUtils.poPageCastToDto(userHistoryPage, AuthUserHistoryDto.class));
}
}
package com.jty.nrsc.interfaces.controller;
package com.jty.wsxt.interfaces.controller;
import com.jty.nrsc.application.ApplicationRegistry;
import com.jty.nrsc.domain.model.auth.authority.nrsc.NrscAuthority;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.interfaces.Assembler;
import com.jty.nrsc.interfaces.dto.AuthAuthorityDto;
import com.jty.wsxt.application.ApplicationRegistry;
import com.jty.wsxt.domain.model.auth.authority.nrsc.NrscAuthority;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.interfaces.Assembler;
import com.jty.wsxt.interfaces.dto.AuthAuthorityDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
......
package com.jty.nrsc.interfaces.controller;
package com.jty.wsxt.interfaces.controller;
import com.jty.nrsc.application.ApplicationRegistry;
import com.jty.nrsc.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.nrsc.infrastructure.security.MyUserDetail;
import com.jty.nrsc.infrastructure.support.BusinessException;
import com.jty.nrsc.infrastructure.support.Result;
import com.jty.nrsc.infrastructure.support.ResultCode;
import com.jty.nrsc.interfaces.Assembler;
import com.jty.nrsc.interfaces.dto.ChangePasswordDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherDto;
import com.jty.nrsc.interfaces.dto.NrscTeacherSearchDto;
import com.jty.nrsc.interfaces.dto.OperatorDto;
import com.jty.wsxt.application.ApplicationRegistry;
import com.jty.wsxt.domain.model.auth.user.nrsc.NrscTeacher;
import com.jty.wsxt.infrastructure.security.MyUserDetail;
import com.jty.wsxt.infrastructure.support.BusinessException;
import com.jty.wsxt.infrastructure.support.Result;
import com.jty.wsxt.infrastructure.support.ResultCode;
import com.jty.wsxt.interfaces.Assembler;
import com.jty.wsxt.interfaces.dto.ChangePasswordDto;
import com.jty.wsxt.interfaces.dto.NrscTeacherDto;
import com.jty.wsxt.interfaces.dto.NrscTeacherSearchDto;
import com.jty.wsxt.interfaces.dto.OperatorDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
......@@ -48,7 +46,7 @@ public class NrscTeacherController {
@PutMapping("/user/{userId}")
@PreAuthorize("hasAuthority('NRSC_MANAGE_USER')")
public Result updateTeacher(@PathVariable Integer userId,@RequestBody NrscTeacherDto nrscTeacherDto){
public Result updateTeacher(@PathVariable Integer userId, @RequestBody NrscTeacherDto nrscTeacherDto){
nrscTeacherDto.setId(userId);
ApplicationRegistry.nrscTeacherService().updateNrscTeacher(nrscTeacherDto);
return Result.success();
......
package com.jty.nrsc.interfaces.dto;
package com.jty.wsxt.interfaces.dto;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
......
package com.jty.nrsc.interfaces.dto;
package com.jty.wsxt.interfaces.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
......
package com.jty.nrsc.interfaces.dto;
package com.jty.wsxt.interfaces.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
......
package com.jty.nrsc.interfaces.dto;
package com.jty.wsxt.interfaces.dto;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
......
package com.jty.nrsc.interfaces.dto;
package com.jty.wsxt.interfaces.dto;
import lombok.Data;
import org.springframework.data.domain.PageRequest;
......
package com.jty.nrsc;
package com.jty.wsxt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package com.jty.wsxt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/**
* web站点网关服务器
*
* @author Jason
* @since 2018/12/20 10:42
*/
@SpringBootApplication
@EnableEurekaClient
public class WebGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(WebGatewayApplication.class,args);
}
}
server:
port: 9007
servlet:
context-path: /v1/nrsc
eureka:
client:
serviceUrl:
defaultZone: http://${EUREKA_HOST:localhost}:${EUREKA_PORT:8762}/eureka/
instance:
prefer-ip-address: true
spring:
application:
name: web-gateway-v1
cloud:
gateway:
routes:
- id: auth-server
uri: lb://auth-server
predicates:
- Path=${server.servlet.context-path}/manage/**
filters:
- StripPrefix= 2
- id: service-question
uri: lb://service-question
predicates:
- Path=${server.servlet.context-path}/service-question/**
filters:
- StripPrefix= 2
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