ソースを参照

用户相关接口

Progr1mmer 6 年 前
コミット
e8ee115b90
37 ファイル変更848 行追加157 行削除
  1. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/function/FunctionDO.java
  2. 5 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/Message.java
  3. 10 5
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/MessageSubscriberDO.java
  4. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleDO.java
  5. 16 15
      common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleFunctionDO.java
  6. 139 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/oauth2/OauthClientDetailsDO.java
  7. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/Organization.java
  8. 24 17
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleDO.java
  9. 14 13
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleModuleFunctionDO.java
  10. 37 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasDO.java
  11. 5 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasDefaultModuleDO.java
  12. 6 6
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasModuleDO.java
  13. 0 56
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/EmployRoleDO.java
  14. 170 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java
  15. 4 4
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/EmployHideModuleFunctionDO.java
  16. 39 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserRoleDO.java
  17. 16 1
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  18. 13 16
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java
  19. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/FunctionDao.java
  20. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/MessageDao.java
  21. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/MessageSubscriberDao.java
  22. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/ModuleDao.java
  23. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/ModuleFunctionDao.java
  24. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/OauthClientDetailsDao.java
  25. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/RoleDao.java
  26. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/RoleModuleFunctionDao.java
  27. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/SaasModuleDao.java
  28. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/UserDao.java
  29. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/UserRoleDao.java
  30. 22 7
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasEndpoint.java
  31. 106 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java
  32. 94 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserRoleEndpoint.java
  33. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/MessageService.java
  34. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/MessageSubscriberService.java
  35. 10 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/SaasService.java
  36. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/UserRoleService.java
  37. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/UserService.java

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/function/FunctionDO.java

@ -1,7 +1,7 @@
package com.yihu.jw.entity.base.function;
package com.yihu.jw.entity.base.function;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
@ -13,7 +13,7 @@ import javax.persistence.Transient;
 */
 */
@Entity
@Entity
@Table(name = "base_function")
@Table(name = "base_function")
public class FunctionDO extends UuidIdentityEntityWithOperator {
public class FunctionDO extends IntegerIdentityEntityWithOperator {
    //功能名称
    //功能名称
    private String name;
    private String name;

+ 5 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/Message.java

@ -1,7 +1,8 @@
package com.yihu.jw.entity.base.message;
package com.yihu.jw.entity.base.message;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -9,11 +10,12 @@ import javax.persistence.Table;
 * Created by progr1mmer on 2018/8/14.
 * Created by progr1mmer on 2018/8/14.
 */@Entity
 */@Entity
@Table(name = "base_message")
@Table(name = "base_message")
public class Message extends UuidIdentityEntity {
public class MessageDo extends IntegerIdentityEntity {
    private String topic; //消息主题
    private String topic; //消息主题
    private String template; //消息模板
    private String template; //消息模板
    @Column(name = "topic", nullable = false)
    public String getTopic() {
    public String getTopic() {
        return topic;
        return topic;
    }
    }
@ -22,6 +24,7 @@ public class Message extends UuidIdentityEntity {
        this.topic = topic;
        this.topic = topic;
    }
    }
    @Column(name = "template", nullable = false)
    public String getTemplate() {
    public String getTemplate() {
        return template;
        return template;
    }
    }

+ 10 - 5
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/MessageSubscriberDO.java

@ -1,7 +1,8 @@
package com.yihu.jw.entity.base.message;
package com.yihu.jw.entity.base.message;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -10,21 +11,23 @@ import javax.persistence.Table;
 */
 */
@Entity
@Entity
@Table(name = "base_message_subscriber")
@Table(name = "base_message_subscriber")
public class MessageSubscriberDO extends UuidIdentityEntity {
public class MessageSubscriberDO extends IntegerIdentityEntity {
    private String messageId; //消息ID
    private Integer messageId; //消息ID
    private String saasId; //saas id
    private String saasId; //saas id
    private String url; //推送地址
    private String url; //推送地址
    private String remark; //备注
    private String remark; //备注
    public String getMessageId() {
    @Column(name = "message_id")
    public Integer getMessageId() {
        return messageId;
        return messageId;
    }
    }
    public void setMessageId(String messageId) {
    public void setMessageId(Integer messageId) {
        this.messageId = messageId;
        this.messageId = messageId;
    }
    }
    @Column(name = "saas_id", length = 50)
    public String getSaasId() {
    public String getSaasId() {
        return saasId;
        return saasId;
    }
    }
@ -33,6 +36,7 @@ public class MessageSubscriberDO extends UuidIdentityEntity {
        this.saasId = saasId;
        this.saasId = saasId;
    }
    }
    @Column(name = "url")
    public String getUrl() {
    public String getUrl() {
        return url;
        return url;
    }
    }
@ -41,6 +45,7 @@ public class MessageSubscriberDO extends UuidIdentityEntity {
        this.url = url;
        this.url = url;
    }
    }
    @Column(name = "remark")
    public String getRemark() {
    public String getRemark() {
        return remark;
        return remark;
    }
    }

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleDO.java

@ -1,6 +1,6 @@
package com.yihu.jw.entity.base.module;// default package
package com.yihu.jw.entity.base.module;// default package
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
@ -14,7 +14,7 @@ import java.util.List;
 */
 */
@Entity
@Entity
@Table(name = "base_module")
@Table(name = "base_module")
public class ModuleDO extends UuidIdentityEntityWithOperator {
public class ModuleDO extends IntegerIdentityEntityWithOperator {
    public enum Status {
    public enum Status {
		disable,
		disable,

+ 16 - 15
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleFunctionDO.java

@ -1,6 +1,6 @@
package com.yihu.jw.entity.base.module;// default package
package com.yihu.jw.entity.base.module;// default package
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.*;
import javax.persistence.*;
@ -9,28 +9,29 @@ import javax.persistence.*;
 */
 */
@Entity
@Entity
@Table(name = "base_module_function")
@Table(name = "base_module_function")
public class ModuleFunctionDO extends UuidIdentityEntity {
public class ModuleFunctionDO extends IntegerIdentityEntity {
	//关联 base_function   ic
	private String functionId;
	//关联 base_module   id
	//关联 base_module   id
	private String moduleId;
	private Integer moduleId;
	//关联 base_function   ic
	private Integer functionId;
	@Column(name = "function_id", length = 100)
	public String getFunctionId() {
		return this.functionId;
	@Column(name = "module_id")
	public Integer getModuleId() {
		return this.moduleId;
	}
	}
	public void setFunctionId(String functionId) {
		this.functionId = functionId;
	public void setModuleId(Integer moduleId) {
		this.moduleId = moduleId;
	}
	}
	@Column(name = "module_id", length = 100)
	public String getModuleId() {
		return this.moduleId;
	@Column(name = "function_id")
	public Integer getFunctionId() {
		return this.functionId;
	}
	}
	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	public void setFunctionId(Integer functionId) {
		this.functionId = functionId;
	}
	}
}
}

+ 139 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/oauth2/OauthClientDetailsDO.java

@ -0,0 +1,139 @@
package com.yihu.jw.entity.base.oauth2;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
/**
 * Entity - Oauth2
 * Created by progr1mmer on 2018/1/23.
 */
@Entity
@Table(name = "oauth_client_details")
@Access(value = AccessType.PROPERTY)
public class OauthClientDetailsDO {
    private String clientId;
    private String saasId;
    private String resourceIds;
    private String clientSecret;
    private String scope;
    private String authorizedGrantTypes;
    private String webServerRedirectUri;
    private String authorities;
    private Integer accessTokenValidity;
    private Integer refreshTokenValidity;
    private String additionalInformation;
    private String autoApprove;
    @Id
    @GeneratedValue(generator = "Generator")
    @GenericGenerator(name = "Generator", strategy = "assigned")
    @Column(name = "client_id", nullable = false)
    public String getClientId() {
        return clientId;
    }
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "resource_ids")
    public String getResourceIds() {
        return resourceIds;
    }
    public void setResourceIds(String resourceIds) {
        this.resourceIds = resourceIds;
    }
    @Column(name = "client_secret")
    public String getClientSecret() {
        return clientSecret;
    }
    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }
    @Column(name = "scope")
    public String getScope() {
        return scope;
    }
    public void setScope(String scope) {
        this.scope = scope;
    }
    @Column(name = "authorized_grant_types")
    public String getAuthorizedGrantTypes() {
        return authorizedGrantTypes;
    }
    public void setAuthorizedGrantTypes(String authorizedGrantTypes) {
        this.authorizedGrantTypes = authorizedGrantTypes;
    }
    @Column(name = "web_server_redirect_uri")
    public String getWebServerRedirectUri() {
        return webServerRedirectUri;
    }
    public void setWebServerRedirectUri(String webServerRedirectUri) {
        this.webServerRedirectUri = webServerRedirectUri;
    }
    @Column(name = "authorities")
    public String getAuthorities() {
        return authorities;
    }
    public void setAuthorities(String authorities) {
        this.authorities = authorities;
    }
    @Column(name = "access_token_validity")
    public Integer getAccessTokenValidity() {
        return accessTokenValidity;
    }
    public void setAccessTokenValidity(Integer accessTokenValidity) {
        this.accessTokenValidity = accessTokenValidity;
    }
    @Column(name = "refresh_token_validity")
    public Integer getRefreshTokenValidity() {
        return refreshTokenValidity;
    }
    public void setRefreshTokenValidity(Integer refreshTokenValidity) {
        this.refreshTokenValidity = refreshTokenValidity;
    }
    @Column(name = "additional_information")
    public String getAdditionalInformation() {
        return additionalInformation;
    }
    public void setAdditionalInformation(String additionalInformation) {
        this.additionalInformation = additionalInformation;
    }
    @Column(name = "autoapprove")
    public String getAutoApprove() {
        return autoApprove;
    }
    public void setAutoApprove(String autoApprove) {
        this.autoApprove = autoApprove;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/Organization.java

@ -10,7 +10,7 @@ import javax.persistence.Table;
 */
 */
@Entity
@Entity
@Table(name = "base_organization")
@Table(name = "base_organization")
public class Organization extends UuidIdentityEntity {
public class OrganizationDO extends UuidIdentityEntity {
    private String name; //名称
    private String name; //名称
    private String code; //编码
    private String code; //编码

+ 24 - 17
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleDO.java

@ -1,18 +1,29 @@
package com.yihu.jw.entity.base.role;
package com.yihu.jw.entity.base.role;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
import java.sql.Timestamp;
/**
/**
 * BaseRole entity. @author MyEclipse Persistence Tools
 * BaseRole entity. @author MyEclipse Persistence Tools
 */
 */
@Entity
@Entity
@Table(name = "base_role")
@Table(name = "base_role")
public class RoleDO extends UuidIdentityEntityWithOperator {
public class RoleDO extends IntegerIdentityEntityWithOperator {
	/**
	 * 角色类型
	 */
	public enum Type {
		//系统 - user对应的角色类型
		system,
		//医生
		doctor,
		//患者
		patient
	}
	//saas id
	//saas id
	private String saasId;
	private String saasId;
@ -22,20 +33,8 @@ public class RoleDO extends UuidIdentityEntityWithOperator {
	private String code;
	private String code;
	//备注
	//备注
	private String remark;
	private String remark;
	// Constructors
	/** default constructor */
	public RoleDO() {
	}
	/** minimal constructor */
	public RoleDO(String id, Timestamp createTime, Timestamp updateTime) {
		this.id = id;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}
	// Property accessors
	//角色类型
	private Type type;
	@Column(name = "saas_id", length = 50)
	@Column(name = "saas_id", length = 50)
	public String getSaasId() {
	public String getSaasId() {
@ -73,4 +72,12 @@ public class RoleDO extends UuidIdentityEntityWithOperator {
		this.remark = remark;
		this.remark = remark;
	}
	}
	@Column(name = "type")
	public Type getType() {
		return type;
	}
	public void setType(Type type) {
		this.type = type;
	}
}
}

+ 14 - 13
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleModuleFunctionDO.java

@ -1,5 +1,6 @@
package com.yihu.jw.entity.base.role;
package com.yihu.jw.entity.base.role;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Column;
@ -11,36 +12,36 @@ import javax.persistence.Table;
 */
 */
@Entity
@Entity
@Table(name = "base_role_module_function")
@Table(name = "base_role_module_function")
public class RoleModuleFunctionDO extends UuidIdentityEntity {
public class RoleModuleFunctionDO extends IntegerIdentityEntity {
    private String roleId; //角色ID
    private String moduleId; //模块ID
    private String functionId; //功能ID
    private Integer roleId; //角色ID
    private Integer moduleId; //模块ID
    private Integer functionId; //功能ID
    @Column(name = "role_id", length = 50)
    public String getRoleId() {
    @Column(name = "role_id", nullable = false)
    public Integer getRoleId() {
        return roleId;
        return roleId;
    }
    }
    public void setRoleId(String roleId) {
    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
        this.roleId = roleId;
    }
    }
    @Column(name = "module_id", length = 50)
    public String getModuleId() {
    @Column(name = "module_id", nullable = false)
    public Integer getModuleId() {
        return moduleId;
        return moduleId;
    }
    }
    public void setModuleId(String moduleId) {
    public void setModuleId(Integer moduleId) {
        this.moduleId = moduleId;
        this.moduleId = moduleId;
    }
    }
    @Column(name = "function_id", length = 50)
    public String getFunctionId() {
    @Column(name = "function_id", nullable = false)
    public Integer getFunctionId() {
        return functionId;
        return functionId;
    }
    }
    public void setFunctionId(String functionId) {
    public void setFunctionId(Integer functionId) {
        this.functionId = functionId;
        this.functionId = functionId;
    }
    }
}
}

+ 37 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasDO.java

@ -16,9 +16,13 @@ import javax.persistence.Table;
public class SaasDO extends UuidIdentityEntityWithOperator {
public class SaasDO extends UuidIdentityEntityWithOperator {
    public enum Status {
    public enum Status {
    	//待审核
        auditWait,
        auditWait,
		//审核通过
        auditPassed,
        auditPassed,
		//审核不通过
        auditNotPassed,
        auditNotPassed,
		//已删除
		delete
		delete
    }
    }
@ -33,11 +37,14 @@ public class SaasDO extends UuidIdentityEntityWithOperator {
    private String orgCode; //机构编码
    private String orgCode; //机构编码
	private String name; //系统名称
	private String name; //系统名称
	private Status status; //状态 0 已删除 1待审核 2审核通过 3审核不通过
	private Status status; //状态  0待审核 1审核通过 2审核不通过 3已删除
	private String remark; //备注
	private String remark; //备注
	private String logo; //远程fastDFS文件地址
	private String logo; //远程fastDFS文件地址
    private Integer theme; //主题ID
    private Integer theme; //主题ID
    private Type type; //类型
    private Type type; //类型
	private String manager; //管理员 - 关联user表id字段
	private String email; //管理员邮箱
	private String phone; //管理员手机号码
	@Column(name = "org_code", nullable = false)
	@Column(name = "org_code", nullable = false)
	public String getOrgCode() {
	public String getOrgCode() {
@ -66,7 +73,7 @@ public class SaasDO extends UuidIdentityEntityWithOperator {
        this.status = status;
        this.status = status;
    }
    }
    @Column(name = "remark", length = 1000)
    @Column(name = "remark")
	public String getRemark() {
	public String getRemark() {
		return this.remark;
		return this.remark;
	}
	}
@ -101,4 +108,32 @@ public class SaasDO extends UuidIdentityEntityWithOperator {
	public void setType(Type type) {
	public void setType(Type type) {
		this.type = type;
		this.type = type;
	}
	}
	@Column(name = "manager", length = 50)
	public String getManager() {
		return manager;
	}
	public void setManager(String manager) {
		this.manager = manager;
	}
	@Column(name = "email")
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	@Column(name = "phone")
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
}
}

+ 5 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasDefaultModuleDO.java

@ -1,7 +1,8 @@
package com.yihu.jw.entity.base.saas;
package com.yihu.jw.entity.base.saas;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -10,11 +11,12 @@ import javax.persistence.Table;
 */
 */
@Entity
@Entity
@Table(name = "base_saas_default_module")
@Table(name = "base_saas_default_module")
public class SaasDefaultModuleDO extends UuidIdentityEntity {
public class SaasDefaultModuleDO extends IntegerIdentityEntity {
    private SaasDO.Type type;
    private SaasDO.Type type;
    private Integer moduleId;
    private Integer moduleId;
    @Column(name = "type", nullable = false)
    public SaasDO.Type getType() {
    public SaasDO.Type getType() {
        return type;
        return type;
    }
    }
@ -23,6 +25,7 @@ public class SaasDefaultModuleDO extends UuidIdentityEntity {
        this.type = type;
        this.type = type;
    }
    }
    @Column(name = "module_id", nullable = false)
    public Integer getModuleId() {
    public Integer getModuleId() {
        return moduleId;
        return moduleId;
    }
    }

+ 6 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasModuleDO.java

@ -1,7 +1,7 @@
package com.yihu.jw.entity.base.saas;// default package
package com.yihu.jw.entity.base.saas;// default package
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.*;
import javax.persistence.*;
@ -10,10 +10,10 @@ import javax.persistence.*;
 */
 */
@Entity
@Entity
@Table(name = "base_saas_module")
@Table(name = "base_saas_module")
public class SaasModuleDO extends UuidIdentityEntity {
public class SaasModuleDO extends IntegerIdentityEntity {
	private String saasId; //关联WlyySaas code
	private String saasId; //关联WlyySaas code
	private String moduleId; //关联 WlyyModule code
	private Integer moduleId; //关联 WlyyModule code
	// Constructors
	// Constructors
@ -26,12 +26,12 @@ public class SaasModuleDO extends UuidIdentityEntity {
		this.saasId = saasId;
		this.saasId = saasId;
	}
	}
	@Column(name = "module_id", length = 50)
	public String getModuleId() {
	@Column(name = "module_id", nullable = false)
	public Integer getModuleId() {
		return this.moduleId;
		return this.moduleId;
	}
	}
	public void setModuleId(String moduleId) {
	public void setModuleId(Integer moduleId) {
		this.moduleId = moduleId;
		this.moduleId = moduleId;
	}
	}
}
}

+ 0 - 56
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/EmployRoleDO.java

@ -1,56 +0,0 @@
package com.yihu.jw.entity.base.user;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * BaseEmployRole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_employ_role")
public class EmployRoleDO extends UuidIdentityEntity implements java.io.Serializable {
	// Fields
	private String employId;
	private String roleId;
	// Constructors
	/** default constructor */
	public EmployRoleDO() {
	}
	/** minimal constructor */
	public EmployRoleDO(String id) {
		this.id = id;
	}
	/** full constructor */
	public EmployRoleDO(String id, String roleId, String employId) {
		this.id = id;
		this.roleId = roleId;
		this.employId = employId;
	}
	@Column(name = "role_id", length = 50)
	public String getRoleId() {
		return this.roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	@Column(name = "employ_id", length = 50)
	public String getEmployId() {
		return this.employId;
	}
	public void setEmployId(String employId) {
		this.employId = employId;
	}
}

+ 170 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java

@ -0,0 +1,170 @@
package com.yihu.jw.entity.base.user;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by progr1mmer on 2018/8/20.
 */
@Entity
@Table(name = "base_user")
public class UserDO extends UuidIdentityEntityWithOperator {
    /**
     * 性别
     */
    public enum Gender {
        //男
        male,
        //女
        female
    }
    //用户名
    private String username;
    //密码
    private String password;
    //密码散列值
    private String salt;
    //姓名
    private String name;
    //性别
    private Gender gender;
    //身份证号码
    private String idcard;
    //手机号码
    private String phone;
    //邮箱
    private String email;
    //是否可用
    private Boolean isEnabled;
    //是否锁定
    private Boolean isLocked;
    //锁定时间
    private Date lockedDate;
    //最后登陆时间
    private Date loginDate;
    //登陆失败次数
    private Integer loginFailureCount;
    @Column(name = "username", nullable = false)
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    @Column(name = "password", nullable = false)
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    @Column(name = "salt", nullable = false)
    public String getSalt() {
        return salt;
    }
    public void setSalt(String salt) {
        this.salt = salt;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "gender")
    public Gender getGender() {
        return gender;
    }
    public void setGender(Gender gender) {
        this.gender = gender;
    }
    @Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @Column(name = "phone", length = 200)
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    @Column(name = "email", length = 200)
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    @Column(name = "is_enabled", nullable = false)
    public Boolean getEnabled() {
        return isEnabled;
    }
    public void setEnabled(Boolean enabled) {
        isEnabled = enabled;
    }
    @Column(name = "is_locked", nullable = false)
    public Boolean getLocked() {
        return isLocked;
    }
    public void setLocked(Boolean locked) {
        isLocked = locked;
    }
    @Column(name = "locked_date")
    public Date getLockedDate() {
        return lockedDate;
    }
    public void setLockedDate(Date lockedDate) {
        this.lockedDate = lockedDate;
    }
    @Column(name = "login_date")
    public Date getLoginDate() {
        return loginDate;
    }
    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }
    @Column(name = "login_failure_count")
    public Integer getLoginFailureCount() {
        return loginFailureCount;
    }
    public void setLoginFailureCount(Integer loginFailureCount) {
        this.loginFailureCount = loginFailureCount;
    }
}

+ 4 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/EmployHideModuleFunctionDO.java

@ -1,6 +1,6 @@
package com.yihu.jw.entity.base.user;
package com.yihu.jw.entity.base.user;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -10,13 +10,13 @@ import javax.persistence.Table;
 */
 */
@Entity
@Entity
@Table(name = "base_employ_hide_module_function")
@Table(name = "base_employ_hide_module_function")
public class EmployHideModuleFunctionDO extends UuidIdentityEntity {
public class UserHideModuleFunctionDO extends IntegerIdentityEntity {
    //用户ID
    //用户ID
    private String employId;
    private String employId;
    //模块ID
    //模块ID
    private String moduleId;
    private Integer moduleId;
    //功能ID(该字段为空则直接隐藏上级模块)
    //功能ID(该字段为空则直接隐藏上级模块)
    private String functionId;
    private Integer functionId;
}
}

+ 39 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserRoleDO.java

@ -0,0 +1,39 @@
package com.yihu.jw.entity.base.user;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * BaseEmployRole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_user_role")
public class UserRoleDO extends IntegerIdentityEntity {
	// Fields
	private String userId;
	private Integer roleId;
	@Column(name = "user_id", length = 50)
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@Column(name = "role_id")
	public Integer getRoleId() {
		return this.roleId;
	}
	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}
}

+ 16 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -29,7 +29,7 @@ public class BaseRequestMapping {
    }
    }
    /**
    /**
     * SAAS
     * SAAS模块
     */
     */
    public static class SaasModule extends Basic {
    public static class SaasModule extends Basic {
        public static final String PREFIX  = "/saas_module";
        public static final String PREFIX  = "/saas_module";
@ -79,6 +79,21 @@ public class BaseRequestMapping {
        public static final String PREFIX  = "/system_dict_entry";
        public static final String PREFIX  = "/system_dict_entry";
    }
    }
    /**
     * 用户
     */
    public static class User extends Basic {
        public static final String PREFIX  = "/user";
        public static final String CHECK_USERNAME = "/check_username";
    }
    /**
     * 用户
     */
    public static class UserRole extends Basic {
        public static final String PREFIX  = "/user_role";
    }
    /**
    /**
     * 角色
     * 角色
     */
     */

+ 13 - 16
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -1,8 +1,8 @@
package com.yihu.jw.restmodel.web.endpoint;
package com.yihu.jw.restmodel.web.endpoint;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -44,19 +44,19 @@ public abstract class EnvelopRestEndpoint {
        return envelop;
        return envelop;
    }
    }
    protected <J> ObjEnvelop<J> success(J data){
        return success("success", data);
    protected <J> ObjEnvelop<J> success(J obj){
        return success("success", obj);
    }
    }
    protected <J> ObjEnvelop<J> success(String message, J data){
        return success(message, 200, data);
    protected <J> ObjEnvelop<J> success(String message, J obj){
        return success(message, 200, obj);
    }
    }
    protected <J> ObjEnvelop<J> success(String message, int status, J data){
    protected <J> ObjEnvelop<J> success(String message, int status, J obj){
        ObjEnvelop<J> objEnvelop = new ObjEnvelop<>();
        ObjEnvelop<J> objEnvelop = new ObjEnvelop<>();
        objEnvelop.setMessage(message);
        objEnvelop.setMessage(message);
        objEnvelop.setStatus(status);
        objEnvelop.setStatus(status);
        objEnvelop.setObj(data);
        objEnvelop.setObj(obj);
        return objEnvelop;
        return objEnvelop;
    }
    }
@ -103,11 +103,11 @@ public abstract class EnvelopRestEndpoint {
        return success(message, 200, contents, obj);
        return success(message, 200, contents, obj);
    }
    }
    protected <T, J> MixEnvelop<T, J> success(String message, int status, List<T> contents, J data) {
        return success(message, status, contents, data, contents.size(), 1, contents.size());
    protected <T, J> MixEnvelop<T, J> success(String message, int status, List<T> contents, J obj) {
        return success(message, status, contents, obj, contents.size(), 1, contents.size());
    }
    }
    protected <T, J> MixEnvelop<T, J> success(String message, int status, List<T> contents, J data, int totalCount, int currPage, int pageSize) {
    protected <T, J> MixEnvelop<T, J> success(String message, int status, List<T> contents, J obj, int totalCount, int currPage, int pageSize) {
        MixEnvelop<T, J> mixEnvelop = new MixEnvelop();
        MixEnvelop<T, J> mixEnvelop = new MixEnvelop();
        mixEnvelop.setMessage(message);
        mixEnvelop.setMessage(message);
        mixEnvelop.setStatus(status);
        mixEnvelop.setStatus(status);
@ -115,19 +115,16 @@ public abstract class EnvelopRestEndpoint {
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setTotalCount(totalCount);
        mixEnvelop.setTotalCount(totalCount);
        mixEnvelop.setDetailModelList(contents);
        mixEnvelop.setDetailModelList(contents);
        mixEnvelop.setObj(data);
        mixEnvelop.setObj(obj);
        return mixEnvelop;
        return mixEnvelop;
    }
    }
    protected Envelop failed(String message) {
    protected Envelop failed(String message) {
        return failed(message, 500);
        return failed(message, -10000);
    }
    }
    protected Envelop failed(String message, int status) {
    protected Envelop failed(String message, int status) {
        Envelop envelop = new Envelop();
        envelop.setMessage(message);
        envelop.setStatus(status);
        return envelop;
        return success(message, status);
    }
    }
    protected <T> T toEntity(String json, Class<T> target) throws IOException {
    protected <T> T toEntity(String json, Class<T> target) throws IOException {

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/FunctionDao.java

@ -7,6 +7,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by chenweida on 2017/5/19.
 * Created by chenweida on 2017/5/19.
 */
 */
public interface FunctionDao extends PagingAndSortingRepository<FunctionDO, String>, JpaSpecificationExecutor<FunctionDO> {
public interface FunctionDao extends PagingAndSortingRepository<FunctionDO, Integer>, JpaSpecificationExecutor<FunctionDO> {
}
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/MessageDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.base.dao;
import com.yihu.jw.entity.base.message.MessageDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by progr1mmer on 2018/8/20.
 */
public interface MessageDao extends PagingAndSortingRepository<MessageDo, Integer>, JpaSpecificationExecutor<MessageDo> {
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/MessageSubscriberDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.base.dao;
import com.yihu.jw.entity.base.message.MessageSubscriberDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by progr1mmer on 2018/8/20.
 */
public interface MessageSubscriberDao extends PagingAndSortingRepository<MessageSubscriberDO, Integer>, JpaSpecificationExecutor<MessageSubscriberDO> {
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/ModuleDao.java

@ -7,6 +7,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by chenweida on 2017/5/19.
 * Created by chenweida on 2017/5/19.
 */
 */
public interface ModuleDao extends PagingAndSortingRepository<ModuleDO, String>, JpaSpecificationExecutor<ModuleDO> {
public interface ModuleDao extends PagingAndSortingRepository<ModuleDO, Integer>, JpaSpecificationExecutor<ModuleDO> {
}
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/ModuleFunctionDao.java

@ -7,6 +7,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by chenweida on 2017/5/19.
 * Created by chenweida on 2017/5/19.
 */
 */
public interface ModuleFunctionDao extends PagingAndSortingRepository<ModuleFunctionDO, String>, JpaSpecificationExecutor<ModuleFunctionDO> {
public interface ModuleFunctionDao extends PagingAndSortingRepository<ModuleFunctionDO, Integer>, JpaSpecificationExecutor<ModuleFunctionDO> {
}
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/OauthClientDetailsDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.base.dao;
import com.yihu.jw.entity.base.oauth2.OauthClientDetailsDO;
import org.springframework.data.jpa.repository.JpaRepository;
/**
 * Created by progr1mmer on 2018/1/23.
 */
public interface OauthClientDetailsDao extends JpaRepository<OauthClientDetailsDO, String> {
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/RoleDao.java

@ -7,6 +7,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by progr1mmer on 2018/8/17.
 * Created by progr1mmer on 2018/8/17.
 */
 */
public interface RoleDao extends PagingAndSortingRepository<RoleDO, String>, JpaSpecificationExecutor<RoleDO> {
public interface RoleDao extends PagingAndSortingRepository<RoleDO, Integer>, JpaSpecificationExecutor<RoleDO> {
}
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/RoleModuleFunctionDao.java

@ -7,6 +7,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by progr1mmer on 2018/8/17.
 * Created by progr1mmer on 2018/8/17.
 */
 */
public interface RoleModuleFunctionDao extends PagingAndSortingRepository<RoleModuleFunctionDO, String>, JpaSpecificationExecutor<RoleModuleFunctionDO> {
public interface RoleModuleFunctionDao extends PagingAndSortingRepository<RoleModuleFunctionDO, Integer>, JpaSpecificationExecutor<RoleModuleFunctionDO> {
}
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/SaasModuleDao.java

@ -7,6 +7,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by progr1mmer on 2018/8/17.
 * Created by progr1mmer on 2018/8/17.
 */
 */
public interface SaasModuleDao extends PagingAndSortingRepository<SaasModuleDO, String>, JpaSpecificationExecutor<SaasModuleDO> {
public interface SaasModuleDao extends PagingAndSortingRepository<SaasModuleDO, Integer>, JpaSpecificationExecutor<SaasModuleDO> {
}
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/UserDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.base.dao;
import com.yihu.jw.entity.base.user.UserDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by progr1mmer on 2018/8/20.
 */
public interface UserDao extends PagingAndSortingRepository<UserDO, String>, JpaSpecificationExecutor<UserDO> {
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/UserRoleDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.base.dao;
import com.yihu.jw.entity.base.user.UserRoleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by progr1mmer on 2018/8/20.
 */
public interface UserRoleDao extends PagingAndSortingRepository<UserRoleDO, Integer>, JpaSpecificationExecutor<UserRoleDO> {
}

+ 22 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasEndpoint.java

@ -1,18 +1,21 @@
package com.yihu.jw.base.endpoint.saas;
package com.yihu.jw.base.endpoint.saas;
import com.yihu.jw.base.service.UserService;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.base.service.SaasService;
import com.yihu.jw.base.service.SaasService;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.utils.security.MD5;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.List;
@ -27,15 +30,27 @@ public class SaasEndpoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private SaasService saasService;
    private SaasService saasService;
    @Autowired
    private UserService userService;
    @PostMapping(value = BaseRequestMapping.Saas.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @PostMapping(value = BaseRequestMapping.Saas.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    @ApiOperation(value = "创建")
    public ObjEnvelop<SaasDO> create (
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasDO saasDO = toEntity(jsonData, SaasDO.class);
        saasDO = saasService.save(saasDO);
        return success(saasDO);
    public Envelop create (
            @ApiParam(name = "saas", value = "Json数据", required = true)
            @RequestParam(value = "saas") SaasDO saasDO,
            @ApiParam(name = "user", value = "Json数据", required = true)
            @RequestParam(value = "user") UserDO userDO) throws Exception {
        if (userService.search("username=" + userDO.getUsername()).size() > 0) {
            return failed("管理员用户名已存在");
        }
        userDO.setEnabled(true);
        userDO.setLocked(false);
        if (StringUtils.isEmpty(userDO.getPassword())) {
            String password = MD5.md5Hex(userDO.getIdcard().substring(0, 5));
            userDO.setPassword(password);
        }
        saasService.save(saasDO, userDO);
        return success("创建成功");
    }
    }
    @PostMapping(value = BaseRequestMapping.Saas.DELETE)
    @PostMapping(value = BaseRequestMapping.Saas.DELETE)

+ 106 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java

@ -0,0 +1,106 @@
package com.yihu.jw.base.endpoint.user;
import com.yihu.jw.base.service.UserService;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by progr1mmer on 2018/8/16.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.User.PREFIX)
@Api(value = "用户管理", description = "用户管理服务接口", tags = {"wlyy基础服务 - 用户管理服务接口"})
public class UserEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private UserService userService;
    @PostMapping(value = BaseRequestMapping.User.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<UserDO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserDO userDO = toEntity(jsonData, UserDO.class);
        userDO = userService.save(userDO);
        return success(userDO);
    }
    @PostMapping(value = BaseRequestMapping.User.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        userService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.User.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public Envelop update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserDO userDO = toEntity(jsonData, UserDO.class);
        if (null == userDO.getId()) {
            return failed("ID不能为空");
        }
        userDO = userService.save(userDO);
        return success(userDO);
    }
    @GetMapping(value = BaseRequestMapping.User.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<UserDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<UserDO> userDOS = userService.search(fields, filters, sorts, page, size);
        int count = (int)userService.getCount(filters);
        return success(userDOS, count, page, size);
    }
    @GetMapping(value = BaseRequestMapping.User.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<UserDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<UserDO> userDOS = userService.search(fields, filters, sorts);
        return success(userDOS);
    }
    @GetMapping(value = BaseRequestMapping.User.CHECK_USERNAME)
    @ApiOperation(value = "检查用户名是否可用(message=1代表可用,message=0代表不可用)")
    public Envelop checkName (
            @ApiParam(name = "username", value = "用户名", required = true)
            @RequestParam(value = "username", required = false) String username) throws Exception {
        if (userService.search("username=" + username).size() == 0) {
            return success("1");
        } else {
            return success("0");
        }
    }
}

+ 94 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserRoleEndpoint.java

@ -0,0 +1,94 @@
package com.yihu.jw.base.endpoint.user;
import com.yihu.jw.base.service.UserRoleService;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by progr1mmer on 2018/8/16.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.UserRole.PREFIX)
@Api(value = "用户角色管理", description = "用户角色管理服务接口", tags = {"wlyy基础服务 - 用户角色管理服务接口"})
public class UserRoleEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private UserRoleService userRoleService;
    @PostMapping(value = BaseRequestMapping.UserRole.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<UserRoleDO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserRoleDO userRoleDO = toEntity(jsonData, UserRoleDO.class);
        userRoleDO = userRoleService.save(userRoleDO);
        return success(userRoleDO);
    }
    @PostMapping(value = BaseRequestMapping.UserRole.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        userRoleService.delete(ids);
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.UserRole.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public Envelop update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserRoleDO userRoleDO = toEntity(jsonData, UserRoleDO.class);
        if (null == userRoleDO.getId()) {
            return failed("ID不能为空");
        }
        userRoleDO = userRoleService.save(userRoleDO);
        return success(userRoleDO);
    }
    @GetMapping(value = BaseRequestMapping.UserRole.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<UserRoleDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<UserRoleDO> userRoleDOS = userRoleService.search(fields, filters, sorts, page, size);
        int count = (int)userRoleService.getCount(filters);
        return success(userRoleDOS, count, page, size);
    }
    @GetMapping(value = BaseRequestMapping.UserRole.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<UserRoleDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<UserRoleDO> userRoleDOS = userRoleService.search(fields, filters, sorts);
        return success(userRoleDOS);
    }
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/MessageService.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.service;
import com.yihu.jw.base.dao.MessageDao;
import com.yihu.jw.entity.base.message.MessageDo;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Created by progr1mmer on 2018/8/20.
 */
@Service
public class MessageService extends BaseJpaService<MessageDo, MessageDao> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/MessageSubscriberService.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.service;
import com.yihu.jw.base.dao.MessageSubscriberDao;
import com.yihu.jw.entity.base.message.MessageSubscriberDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Created by progr1mmer on 2018/8/20.
 */
@Service
public class MessageSubscriberService extends BaseJpaService<MessageSubscriberDO, MessageSubscriberDao> {
}

+ 10 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/SaasService.java

@ -1,7 +1,9 @@
package com.yihu.jw.base.service;
package com.yihu.jw.base.service;
import com.yihu.jw.base.dao.UserDao;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.base.dao.SaasDao;
import com.yihu.jw.base.dao.SaasDao;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
@ -15,6 +17,14 @@ public class SaasService extends BaseJpaService<SaasDO, SaasDao> {
    @Autowired
    @Autowired
    private SaasDao saasDao;
    private SaasDao saasDao;
    @Autowired
    private UserDao userDao;
    public SaasDO save(SaasDO saas, UserDO user) {
        user = userDao.save(user);
        saas.setManager(user.getId());
        return super.save(saas);
    }
    @Transactional
    @Transactional
    public void delete(String ids) {
    public void delete(String ids) {

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/UserRoleService.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.service;
import com.yihu.jw.base.dao.UserRoleDao;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Created by progr1mmer on 2018/8/20.
 */
@Service
public class UserRoleService extends BaseJpaService<UserRoleDO, UserRoleDao> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/UserService.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.service;
import com.yihu.jw.base.dao.UserDao;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Created by progr1mmer on 2018/8/20.
 */
@Service
public class UserService extends BaseJpaService<UserDO, UserDao> {
}