feat: oss
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
# ---> Java
|
||||
# IDEA
|
||||
.idea
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
|
55
sms-auth/pom.xml
Normal file
55
sms-auth/pom.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>sms-auth</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<modules>
|
||||
<module>sms-auth-start</module>
|
||||
<module>sms-auth-infra</module>
|
||||
<module>sms-auth-domain</module>
|
||||
<module>sms-auth-common</module>
|
||||
<module>sms-auth-controller</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>2.4.2</spring-boot.version>
|
||||
<spring-cloud-alibaba.version>2021.1</spring-cloud-alibaba.version>
|
||||
<spring-cloud.version>2020.0.6</spring-cloud.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.4.2</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>central</id>
|
||||
<name>aliyun maven</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<layout>default</layout>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
92
sms-auth/sms-auth-common/pom.xml
Normal file
92
sms-auth/sms-auth-common/pom.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>sms-auth-common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>sms-auth-common</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.4.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.28</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>1.4.2.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>1.4.2.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.79</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>19.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.11</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– Sa-Token 权限认证,在线文档:https://sa-token.cc –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.dev33</groupId>-->
|
||||
<!-- <artifactId>sa-token-spring-boot-starter</artifactId>-->
|
||||
<!-- <version>1.37.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– Sa-Token 整合 Redis (使用 jackson 序列化方式) –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.dev33</groupId>-->
|
||||
<!-- <artifactId>sa-token-redis-jackson</artifactId>-->
|
||||
<!-- <version>1.37.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– 提供Redis连接池 –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.commons</groupId>-->
|
||||
<!-- <artifactId>commons-pool2</artifactId>-->
|
||||
<!-- <version>2.9.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,25 @@
|
||||
package com.landaiqing.auth.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.ResourceBundleMessageSource;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@Configuration
|
||||
public class LocaleConfig {
|
||||
|
||||
@Bean
|
||||
public ResourceBundleMessageSource messageSource() {
|
||||
Locale.setDefault(Locale.CHINA);
|
||||
ResourceBundleMessageSource source = new ResourceBundleMessageSource();
|
||||
//设置国际化文件存储路径和名称 i18n目录,messages文件名
|
||||
source.setBasenames("i18n/messages");
|
||||
//设置根据key如果没有获取到对应的文本信息,则返回key作为信息
|
||||
source.setUseCodeAsDefaultMessage(true);
|
||||
//设置字符编码
|
||||
source.setDefaultEncoding("UTF-8");
|
||||
return source;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package com.landaiqing.auth.common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 分页请求实体
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Data
|
||||
public class PageInfo {
|
||||
|
||||
private Integer pageNo = 1;
|
||||
|
||||
private Integer pageSize = 20;
|
||||
|
||||
public Integer getPageNo() {
|
||||
if (pageNo == null || pageNo < 1) {
|
||||
return 1;
|
||||
}
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
if (pageSize == null || pageSize < 1 || pageSize > Integer.MAX_VALUE) {
|
||||
return 20;
|
||||
}
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
package com.landaiqing.auth.common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分页返回实体
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Data
|
||||
public class PageResult<T> implements Serializable {
|
||||
|
||||
private Integer pageNo = 1;
|
||||
|
||||
private Integer pageSize = 20;
|
||||
|
||||
private Integer total = 0;
|
||||
|
||||
private Integer totalPages = 0;
|
||||
|
||||
private List<T> result = Collections.emptyList();
|
||||
|
||||
private Integer start = 1;
|
||||
|
||||
private Integer end = 0;
|
||||
|
||||
public void setRecords(List<T> result) {
|
||||
this.result = result;
|
||||
if (result != null && result.size() > 0) {
|
||||
setTotal(result.size());
|
||||
}
|
||||
}
|
||||
|
||||
public void setTotal(Integer total) {
|
||||
this.total = total;
|
||||
if (this.pageSize > 0) {
|
||||
this.totalPages = (total / this.pageSize) + (total % this.pageSize == 0 ? 0 : 1);
|
||||
} else {
|
||||
this.totalPages = 0;
|
||||
}
|
||||
this.start = (this.pageSize > 0 ? (this.pageNo - 1) * this.pageSize : 0) + 1;
|
||||
this.end = (this.start - 1 + this.pageSize * (this.pageNo > 0 ? 1 : 0));
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.landaiqing.auth.common.entity;
|
||||
|
||||
import com.landaiqing.auth.common.enums.ResultCodeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Result<T> {
|
||||
|
||||
private Boolean success;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String message;
|
||||
|
||||
private T data;
|
||||
|
||||
public static Result ok(){
|
||||
Result result = new Result();
|
||||
result.setSuccess(true);
|
||||
result.setCode(ResultCodeEnum.SUCCESS.getCode());
|
||||
result.setMessage(ResultCodeEnum.SUCCESS.getDesc());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> Result ok(T data){
|
||||
Result result = new Result();
|
||||
result.setSuccess(true);
|
||||
result.setCode(ResultCodeEnum.SUCCESS.getCode());
|
||||
result.setMessage(ResultCodeEnum.SUCCESS.getDesc());
|
||||
result.setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Result fail(){
|
||||
Result result = new Result();
|
||||
result.setSuccess(false);
|
||||
result.setCode(ResultCodeEnum.FAIL.getCode());
|
||||
result.setMessage(ResultCodeEnum.FAIL.getDesc());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> Result fail(T data){
|
||||
Result result = new Result();
|
||||
result.setSuccess(false);
|
||||
result.setCode(ResultCodeEnum.FAIL.getCode());
|
||||
result.setMessage(ResultCodeEnum.FAIL.getDesc());
|
||||
result.setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.landaiqing.auth.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 用户状态枚举
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Getter
|
||||
public enum AuthUserStatusEnum {
|
||||
|
||||
OPEN(0,"启用"),
|
||||
CLOSE(1,"禁用");
|
||||
|
||||
public int code;
|
||||
|
||||
public String desc;
|
||||
|
||||
AuthUserStatusEnum(int code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static AuthUserStatusEnum getByCode(int codeVal){
|
||||
for(AuthUserStatusEnum resultCodeEnum : AuthUserStatusEnum.values()){
|
||||
if(resultCodeEnum.code == codeVal){
|
||||
return resultCodeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.landaiqing.auth.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 删除状态枚举
|
||||
*
|
||||
* @author: landaiqing
|
||||
*/
|
||||
@Getter
|
||||
public enum IsDeletedFlagEnum {
|
||||
|
||||
DELETED(1,"已删除"),
|
||||
UN_DELETED(0,"未删除");
|
||||
|
||||
public int code;
|
||||
|
||||
public String desc;
|
||||
|
||||
IsDeletedFlagEnum(int code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static IsDeletedFlagEnum getByCode(int codeVal){
|
||||
for(IsDeletedFlagEnum resultCodeEnum : IsDeletedFlagEnum.values()){
|
||||
if(resultCodeEnum.code == codeVal){
|
||||
return resultCodeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.landaiqing.auth.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum LanguageEnum {
|
||||
|
||||
ZH_CN("zh_CN", "中文/中国"),
|
||||
EN_US( "en_US", "英语/美国"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 语言_国家缩写
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.landaiqing.auth.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum ResultCodeEnum {
|
||||
SUCCESS(200,"成功"),
|
||||
FAIL(500,"失败");
|
||||
private int code;
|
||||
private String desc;
|
||||
|
||||
ResultCodeEnum(int code, String desc){
|
||||
this.code=code;
|
||||
this.desc=desc;
|
||||
}
|
||||
public static ResultCodeEnum getByCode(int codeVal){
|
||||
for(ResultCodeEnum resultCodeEnum:ResultCodeEnum.values()){
|
||||
if(resultCodeEnum.code==codeVal){
|
||||
return resultCodeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package com.landaiqing.auth.common.util;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.MessageSource;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class MessageUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 根据key信息获取对应语言的内容
|
||||
*
|
||||
* @param key 消息key值
|
||||
* @param language 语言_国家
|
||||
* @return
|
||||
*/
|
||||
public static String get(String key, String language) {
|
||||
if (!StringUtils.isEmpty(language)) {
|
||||
String[] arrs = language.split("_");
|
||||
if (arrs.length == 2) {
|
||||
return get(key, new Locale(arrs[0], arrs[1]));
|
||||
}
|
||||
}
|
||||
//使用默认的国际化语言
|
||||
return get(key, Locale.getDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key信息获取对应语言的内容
|
||||
*
|
||||
* @param key 消息key值
|
||||
* @param params 需要替换到占位符中的参数 占位符下标重0开始 格式如: {0} {1}
|
||||
* @param language 语言_国家
|
||||
* @return
|
||||
*/
|
||||
public static String get(String key, Object[] params, String language) {
|
||||
if (!StringUtils.isEmpty(language)) {
|
||||
String arrs[] = language.split("_");
|
||||
if (arrs.length == 2) {
|
||||
return get(key, params, new Locale(arrs[0], arrs[1]));
|
||||
}
|
||||
}
|
||||
return get(key, params, Locale.getDefault());
|
||||
}
|
||||
|
||||
private static String get(String key, Locale language) {
|
||||
return get(key, new String[0], language);
|
||||
}
|
||||
|
||||
private static String get(String key, Object[] params, Locale language) {
|
||||
return getInstance().getMessage(key, params, language);
|
||||
}
|
||||
|
||||
private static MessageSource getInstance() {
|
||||
return Lazy.messageSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用懒加载方式实例化messageSource国际化工具
|
||||
*/
|
||||
private static class Lazy {
|
||||
private static final MessageSource messageSource = SpringUtil.getBean(MessageSource.class);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.landaiqing.auth.common.util;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author Dominick Li
|
||||
* @description 普通类调用Spring bean对象使用的工具栏
|
||||
**/
|
||||
@Component
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class SpringUtil implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext applicationContext = null;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
if (SpringUtil.applicationContext == null) {
|
||||
SpringUtil.applicationContext = applicationContext;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过class获取Bean.
|
||||
*/
|
||||
public static <T> T getBean(Class<T> clazz) {
|
||||
return applicationContext.getBean(clazz);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
student_management=????
|
||||
sutdent_center=????
|
@@ -0,0 +1,2 @@
|
||||
student_management=student_management
|
||||
sutdent_center=sutdent_center
|
@@ -0,0 +1,2 @@
|
||||
student_management=????
|
||||
sutdent_center=????
|
37
sms-auth/sms-auth-controller/pom.xml
Normal file
37
sms-auth/sms-auth-controller/pom.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>sms-auth-controller</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>sms-auth-controller</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-domain</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-infra</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,38 @@
|
||||
package com.landaiqing.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname GlobalConfig
|
||||
* @BelongsProject: qing-yu-club
|
||||
* @BelongsPackage: com.landaiqing.subject.application.config
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-02-16 15:57
|
||||
* @Description: MVC全局处理
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class GlobalConfig extends WebMvcConfigurationSupport {
|
||||
@Override
|
||||
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
super.configureMessageConverters(converters);
|
||||
converters.add(mappingJackson2HttpMessageConverter());
|
||||
}
|
||||
private MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(){
|
||||
ObjectMapper objectMapper=new ObjectMapper();
|
||||
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false);
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
MappingJackson2HttpMessageConverter converter=new MappingJackson2HttpMessageConverter(objectMapper);
|
||||
return converter;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,150 @@
|
||||
package com.landaiqing.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.landaiqing.auth.common.entity.PageInfo;
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.auth.common.entity.Result;
|
||||
import com.landaiqing.auth.common.util.MessageUtil;
|
||||
import com.landaiqing.convert.PermissionDTOConvert;
|
||||
import com.landaiqing.convert.StudentInfoDtoConvert;
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.domain.service.StudentDomainService;
|
||||
import com.landaiqing.domain.service.StudentPermissionDomainService;
|
||||
import com.landaiqing.dto.PermissionDTO;
|
||||
import com.landaiqing.dto.StudentDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname StudentController
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.controller
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-04 23:17
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/student/")
|
||||
@Slf4j
|
||||
public class StudentController {
|
||||
@Resource
|
||||
private StudentDomainService studentDomainService;
|
||||
@Resource
|
||||
private StudentPermissionDomainService studentPermissionDomainService;
|
||||
|
||||
|
||||
/**
|
||||
* @description: 头像上传
|
||||
* @param: [studentDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/3/4 23:47
|
||||
*/
|
||||
@PostMapping("upload")
|
||||
public Result<Boolean> uploadAvatar(@RequestBody StudentDTO studentDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("StudentController.uploadAvatar.dto:{}", JSON.toJSONString(studentDTO));
|
||||
}
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(studentDTO.getUrl()), "url不能为空!");
|
||||
Preconditions.checkNotNull(studentDTO.getId(), "id不能为空!");
|
||||
StudentBO studentBO = StudentInfoDtoConvert.INSTANCE.convertDtoToBO(studentDTO);
|
||||
return Result.ok(studentDomainService.uploadAvatar(studentBO));
|
||||
} catch (Exception e) {
|
||||
log.error("StudentController.uploadAvatar.error:{}", e.getMessage(), e);
|
||||
return Result.fail("上传头像失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 分页查询所有学生信息
|
||||
* @param: [studentDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<com.landaiqing.auth.common.entity.PageResult < com.landaiqing.dto.StudentDTO>>
|
||||
* @author landaiqing
|
||||
* @date: 2024/3/5 12:03
|
||||
*/
|
||||
@RequestMapping("queryAllStudent")
|
||||
public Result<PageResult<StudentDTO>> queryAllStudent(@RequestBody StudentDTO studentDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("StudentController.queryAllStudent.dto:{}", JSON.toJSONString(studentDTO));
|
||||
}
|
||||
StudentBO studentBO = StudentInfoDtoConvert.INSTANCE.convertDtoToBO(studentDTO);
|
||||
studentBO.getPageNo();
|
||||
studentBO.getPageSize();
|
||||
PageResult<StudentBO> pageResult = studentDomainService.queryAllStudentByPage(studentBO);
|
||||
return Result.ok(pageResult);
|
||||
} catch (Exception e) {
|
||||
log.error("StudentController.queryAllStudent.error:{}", e.getMessage(), e);
|
||||
return Result.fail("查询失败失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询指定学生的权限
|
||||
* @param: [studentDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.util.List < com.landaiqing.dto.PermissionDTO>>
|
||||
* @author landaiqing
|
||||
* @date: 2024/3/5 12:03
|
||||
*/
|
||||
@RequestMapping("queryPermission")
|
||||
public Result<List<PermissionDTO>> queryStudentPermission(@RequestBody StudentDTO studentDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("StudentController.queryStudentPermission.dto:{}", JSON.toJSONString(studentDTO));
|
||||
}
|
||||
StudentBO studentBO = StudentInfoDtoConvert.INSTANCE.convertDtoToBO(studentDTO);
|
||||
List<PermissionBO> permissionBOS = studentPermissionDomainService.queryStudentPermission(studentBO);
|
||||
List<PermissionDTO> permissionDTOS = PermissionDTOConvert.INSTANCE.convertBoToDtoList(permissionBOS);
|
||||
return Result.ok(permissionDTOS);
|
||||
} catch (Exception e) {
|
||||
log.error("StudentController.queryStudentPermission.error:{}", e.getMessage(), e);
|
||||
return Result.fail("查询失败失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试国际化
|
||||
* en_US 英文 http://127.0.0.1:3001/en_US
|
||||
* zh_CN 中文 http://127.0.0.1:3001/zh_CN
|
||||
*/
|
||||
@GetMapping("/{language}")
|
||||
public String test(@PathVariable String language) {
|
||||
|
||||
String text2 = MessageUtil.get("sutdent_center", language);
|
||||
return text2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 登录
|
||||
* @param: [studentDTO]
|
||||
* @return: com.landaiqing.auth.common.entity.Result<java.lang.Boolean>
|
||||
* @author landaiqing
|
||||
* @date: 2024/3/5 17:28
|
||||
*/
|
||||
@RequestMapping("login")
|
||||
public Result<Boolean> login(@RequestBody StudentDTO studentDTO) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("StudentController.queryStudentPermission.dto:{}", JSON.toJSONString(studentDTO));
|
||||
}
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(studentDTO.getUsername()), "用户名不能为空!");
|
||||
Preconditions.checkArgument(!StringUtils.isBlank(studentDTO.getPassword()), "密码不能为空!");
|
||||
StudentBO studentBO = StudentInfoDtoConvert.INSTANCE.convertDtoToBO(studentDTO);
|
||||
Boolean result = studentDomainService.login(studentBO);
|
||||
return Result.ok(result);
|
||||
} catch (Exception e) {
|
||||
log.error("StudentController.queryStudentPermission.error:{}", e.getMessage(), e);
|
||||
return Result.fail("查询失败失败!");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.landaiqing.convert;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.dto.PermissionDTO;
|
||||
import com.landaiqing.dto.StudentDTO;
|
||||
import com.landaiqing.infra.basic.entity.Permission;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname PermissionDTOConvert
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.convert
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-05 11:55
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface PermissionDTOConvert {
|
||||
PermissionDTOConvert INSTANCE= Mappers.getMapper(PermissionDTOConvert.class);
|
||||
PermissionBO convertDtoToBO(PermissionDTO permissionDTO);
|
||||
List<PermissionDTO> convertBoToDtoList(List<PermissionBO> permissionBOList);
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.landaiqing.convert;
|
||||
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.dto.StudentDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname StudentInfoDtoConvert
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.convert
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-04 23:22
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface StudentInfoDtoConvert {
|
||||
StudentInfoDtoConvert INSTANCE= Mappers.getMapper(StudentInfoDtoConvert.class);
|
||||
|
||||
StudentBO convertDtoToBO(StudentDTO studentDTO);
|
||||
List<StudentDTO> convertBOToDTOList(List<StudentBO> studentBOList);
|
||||
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.landaiqing.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (PermissionBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:35
|
||||
*/
|
||||
@Data
|
||||
public class PermissionDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String menuUrl;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer show;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String permissionKey;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,85 @@
|
||||
package com.landaiqing.dto;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (StudentDTO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:25:32
|
||||
*/
|
||||
@Data
|
||||
public class StudentDTO extends PageInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
private String sno;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
private Integer className;
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
private Integer grade;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 头像链接
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date dateOfBirth;
|
||||
/**
|
||||
* email
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 班级id
|
||||
*/
|
||||
private Long classId;
|
||||
/**
|
||||
* 年级id
|
||||
*/
|
||||
private Long gradeId;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
private String url;
|
||||
|
||||
|
||||
}
|
||||
|
32
sms-auth/sms-auth-domain/pom.xml
Normal file
32
sms-auth/sms-auth-domain/pom.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>sms-auth-domain</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>sms-auth-domain</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-infra</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (AdminBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:28:30
|
||||
*/
|
||||
@Data
|
||||
public class AdminBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
private Integer isDeleted;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (ClazzBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:44:00
|
||||
*/
|
||||
public class ClazzBO implements Serializable {
|
||||
private static final long serialVersionUID = -14659318323663338L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
/**
|
||||
* 班级人数
|
||||
*/
|
||||
private Integer num;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (CounselorBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:04
|
||||
*/
|
||||
@Data
|
||||
public class CounselorBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
private Integer isDeleted;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (GradeBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:20
|
||||
*/
|
||||
@Data
|
||||
public class GradeBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
private String gradeName;
|
||||
/**
|
||||
* 年级人数
|
||||
*/
|
||||
private Long num;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,54 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (PermissionBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:35
|
||||
*/
|
||||
@Data
|
||||
public class PermissionBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String menuUrl;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer show;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String permissionKey;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (RoleBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:56
|
||||
*/
|
||||
@Data
|
||||
public class RoleBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleKey;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (RolePermissionBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:30:14
|
||||
*/
|
||||
@Data
|
||||
public class RolePermissionBO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
private Long permissionId;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,85 @@
|
||||
package com.landaiqing.domain.bo;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (StudentBO)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:25:32
|
||||
*/
|
||||
@Data
|
||||
public class StudentBO extends PageInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
private String sno;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
private Integer className;
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
private Integer grade;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 头像链接
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date dateOfBirth;
|
||||
/**
|
||||
* email
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 班级id
|
||||
*/
|
||||
private Long classId;
|
||||
/**
|
||||
* 年级id
|
||||
*/
|
||||
private Long gradeId;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
private String url;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,15 @@
|
||||
package com.landaiqing.domain.constants;
|
||||
|
||||
/**
|
||||
* auth服务常量
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/19
|
||||
*/
|
||||
public class AuthConstant {
|
||||
|
||||
public static final String STUDENT = "student";
|
||||
public static final String ADMIN = "admin";
|
||||
public static final String COUNSELOR = "counselor";
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.landaiqing.domain.convert;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.infra.basic.entity.Permission;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PermissionBOConvert {
|
||||
PermissionBOConvert INSTANCE= Mappers.getMapper(PermissionBOConvert.class);
|
||||
|
||||
List<PermissionBO> convertToboList(List<Permission> permissions);
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.landaiqing.domain.convert;
|
||||
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface StudentBOConvert {
|
||||
StudentBOConvert INSTANCE= Mappers.getMapper(StudentBOConvert.class);
|
||||
Student convertBOToEntity(StudentBO studentBO);
|
||||
List<StudentBO> convertBOToDTOList(List<Student> students);
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.landaiqing.domain.service;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PermissionDomainService {
|
||||
|
||||
List<PermissionBO> queryPermission(List<Integer> permissionList);
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.landaiqing.domain.service;
|
||||
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RolePermissionDomainService {
|
||||
|
||||
List<Integer> queryPermissionByRoleId(Integer roleId);
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.landaiqing.domain.service;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StudentDomainService {
|
||||
|
||||
Boolean uploadAvatar(StudentBO studentBO);
|
||||
|
||||
PageResult<StudentBO> queryAllStudentByPage(StudentBO studentBO);
|
||||
|
||||
Boolean login(StudentBO studentBO);
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.landaiqing.domain.service;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StudentPermissionDomainService {
|
||||
List<PermissionBO> queryStudentPermission(StudentBO studentBO);
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.landaiqing.domain.service;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StudentRoleDomainService {
|
||||
Integer queryStudentRole(StudentBO studentBO);
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.landaiqing.domain.service.impl;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.domain.convert.PermissionBOConvert;
|
||||
import com.landaiqing.domain.service.*;
|
||||
import com.landaiqing.infra.basic.entity.Permission;
|
||||
import com.landaiqing.infra.basic.service.PermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname StudentPermissionDomainServiceImpl
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.domain.service.impl
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-05 11:59
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class PermissionDomainServiceImpl implements PermissionDomainService {
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
|
||||
@Override
|
||||
public List<PermissionBO> queryPermission(List<Integer> permissionList) {
|
||||
List<Permission> permission= permissionService.queryPermission(permissionList);
|
||||
List<PermissionBO> permissionBOList = PermissionBOConvert.INSTANCE.convertToboList(permission);
|
||||
return permissionBOList;
|
||||
}
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package com.landaiqing.domain.service.impl;
|
||||
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.domain.convert.StudentBOConvert;
|
||||
import com.landaiqing.domain.service.RolePermissionDomainService;
|
||||
import com.landaiqing.domain.service.StudentRoleDomainService;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.service.RolePermissionService;
|
||||
import com.landaiqing.infra.basic.service.StudentRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname StudentPermissionDomainServiceImpl
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.domain.service.impl
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-05 11:59
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class RolePermissionDomainServiceImpl implements RolePermissionDomainService {
|
||||
@Resource
|
||||
private RolePermissionService rolePermissionService;
|
||||
@Override
|
||||
public List<Integer> queryPermissionByRoleId(Integer roleId) {
|
||||
List<Integer> permissionList = rolePermissionService.queryPermissionById(roleId);
|
||||
return permissionList;
|
||||
}
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
package com.landaiqing.domain.service.impl;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.auth.common.enums.IsDeletedFlagEnum;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.domain.convert.StudentBOConvert;
|
||||
import com.landaiqing.domain.service.StudentDomainService;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.service.StudentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Classname StudentDomainServiceImpl
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.domain.service.impl
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-04 23:14
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class StudentDomainServiceImpl implements StudentDomainService {
|
||||
@Resource
|
||||
private StudentService studentService;
|
||||
|
||||
@Override
|
||||
public Boolean uploadAvatar(StudentBO studentBO) {
|
||||
Student student = new Student();
|
||||
student.setId(studentBO.getId());
|
||||
student.setAvatar(studentBO.getUrl());
|
||||
student.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
|
||||
Integer count = studentService.update(student);
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<StudentBO> queryAllStudentByPage(StudentBO studentBO) {
|
||||
PageResult<StudentBO> pageResult = new PageResult<>();
|
||||
pageResult.setPageNo(studentBO.getPageNo());
|
||||
pageResult.setPageSize(studentBO.getPageSize());
|
||||
int start = (studentBO.getPageNo() - 1) * studentBO.getPageSize();
|
||||
Student student = StudentBOConvert.INSTANCE.convertBOToEntity(studentBO);
|
||||
Integer total = studentService.selectCount();
|
||||
if (total == 0) {
|
||||
return pageResult;
|
||||
}
|
||||
List<Student> studentList = studentService.queryPage(student, start, studentBO.getPageSize());
|
||||
List<StudentBO> studentBOS = StudentBOConvert.INSTANCE.convertBOToDTOList(studentList);
|
||||
pageResult.setRecords(studentBOS);
|
||||
pageResult.setTotal(total);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean login(StudentBO studentBO) {
|
||||
Student student = StudentBOConvert.INSTANCE.convertBOToEntity(studentBO);
|
||||
Integer count= studentService.login(student);
|
||||
return count>0;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.domain.service.impl;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.domain.service.*;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname StudentPermissionDomainServiceImpl
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.domain.service.impl
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-05 11:59
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class StudentPermissionDomainServiceImpl implements StudentPermissionDomainService {
|
||||
@Resource
|
||||
private StudentPermissionDomainService studentPermissionDomainService;
|
||||
|
||||
@Resource
|
||||
private StudentRoleDomainService studentRoleDomainService;
|
||||
|
||||
@Resource
|
||||
private StudentDomainService studentDomainService;
|
||||
|
||||
@Resource
|
||||
private RolePermissionDomainService rolePermissionDomainService;
|
||||
@Resource
|
||||
private PermissionDomainService permissionDomainService;
|
||||
@Override
|
||||
public List<PermissionBO> queryStudentPermission(StudentBO studentBO) {
|
||||
Integer roleId = studentRoleDomainService.queryStudentRole(studentBO);
|
||||
List<Integer> permissionList= rolePermissionDomainService.queryPermissionByRoleId(roleId);
|
||||
List<PermissionBO> permissionBOList= permissionDomainService.queryPermission(permissionList);
|
||||
return permissionBOList;
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.landaiqing.domain.service.impl;
|
||||
|
||||
import com.landaiqing.domain.bo.PermissionBO;
|
||||
import com.landaiqing.domain.bo.StudentBO;
|
||||
import com.landaiqing.domain.convert.StudentBOConvert;
|
||||
import com.landaiqing.domain.service.StudentDomainService;
|
||||
import com.landaiqing.domain.service.StudentPermissionDomainService;
|
||||
import com.landaiqing.domain.service.StudentRoleDomainService;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.service.StudentRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Classname StudentPermissionDomainServiceImpl
|
||||
* @BelongsProject: student-Management-system
|
||||
* @BelongsPackage: com.landaiqing.domain.service.impl
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-05 11:59
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class StudentRoleDomainServiceImpl implements StudentRoleDomainService {
|
||||
@Resource
|
||||
private StudentRoleService studentRoleService;
|
||||
|
||||
|
||||
@Override
|
||||
public Integer queryStudentRole(StudentBO studentBO) {
|
||||
|
||||
Student student = StudentBOConvert.INSTANCE.convertBOToEntity(studentBO);
|
||||
Integer roleId = studentRoleService.queryRoleById(student);
|
||||
return roleId;
|
||||
}
|
||||
}
|
47
sms-auth/sms-auth-infra/pom.xml
Normal file
47
sms-auth/sms-auth-infra/pom.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>sms-auth-infra</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>sms-auth-infra</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
<!--jdbcStarter-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<!--druid连接池-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.1.21</version>
|
||||
</dependency>
|
||||
<!--mysql-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
<!--mybatis plus-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,17 @@
|
||||
package com.landaiqing.infra.basic.config;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisConfiguration {
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor(){
|
||||
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
|
||||
mybatisPlusInterceptor.addInnerInterceptor(new MybatisPlusAllSqlLog());
|
||||
return mybatisPlusInterceptor;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,116 @@
|
||||
package com.landaiqing.infra.basic.config;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.mapping.ParameterMapping;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.apache.ibatis.type.TypeHandlerRegistry;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
public class MybatisPlusAllSqlLog implements InnerInterceptor {
|
||||
public static final Logger log = LoggerFactory.getLogger("sys-sql");
|
||||
|
||||
@Override
|
||||
public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
|
||||
logInfo(boundSql, ms, parameter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeUpdate(Executor executor, MappedStatement ms, Object parameter) throws SQLException {
|
||||
BoundSql boundSql = ms.getBoundSql(parameter);
|
||||
logInfo(boundSql, ms, parameter);
|
||||
}
|
||||
|
||||
private static void logInfo(BoundSql boundSql, MappedStatement ms, Object parameter) {
|
||||
try {
|
||||
log.info("parameter = " + parameter);
|
||||
// 获取到节点的id,即sql语句的id
|
||||
String sqlId = ms.getId();
|
||||
log.info("sqlId = " + sqlId);
|
||||
// 获取节点的配置
|
||||
Configuration configuration = ms.getConfiguration();
|
||||
// 获取到最终的sql语句
|
||||
String sql = getSql(configuration, boundSql, sqlId);
|
||||
log.info("完整的sql:{}", sql);
|
||||
} catch (Exception e) {
|
||||
log.error("异常:{}", e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 封装了一下sql语句,使得结果返回完整xml路径下的sql语句节点id + sql语句
|
||||
public static String getSql(Configuration configuration, BoundSql boundSql, String sqlId) {
|
||||
return sqlId + ":" + showSql(configuration, boundSql);
|
||||
}
|
||||
|
||||
// 进行?的替换
|
||||
public static String showSql(Configuration configuration, BoundSql boundSql) {
|
||||
// 获取参数
|
||||
Object parameterObject = boundSql.getParameterObject();
|
||||
List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
|
||||
// sql语句中多个空格都用一个空格代替
|
||||
String sql = boundSql.getSql().replaceAll("[\\s]+", " ");
|
||||
if (!CollectionUtils.isEmpty(parameterMappings) && parameterObject != null) {
|
||||
// 获取类型处理器注册器,类型处理器的功能是进行java类型和数据库类型的转换
|
||||
TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
|
||||
// 如果根据parameterObject.getClass()可以找到对应的类型,则替换
|
||||
if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) {
|
||||
sql = sql.replaceFirst("\\?",
|
||||
Matcher.quoteReplacement(getParameterValue(parameterObject)));
|
||||
} else {
|
||||
// MetaObject主要是封装了originalObject对象,提供了get和set的方法用于获取和设置originalObject的属性值,主要支持对JavaBean、Collection、Map三种类型对象的操作
|
||||
MetaObject metaObject = configuration.newMetaObject(parameterObject);
|
||||
for (ParameterMapping parameterMapping : parameterMappings) {
|
||||
String propertyName = parameterMapping.getProperty();
|
||||
if (metaObject.hasGetter(propertyName)) {
|
||||
Object obj = metaObject.getValue(propertyName);
|
||||
sql = sql.replaceFirst("\\?",
|
||||
Matcher.quoteReplacement(getParameterValue(obj)));
|
||||
} else if (boundSql.hasAdditionalParameter(propertyName)) {
|
||||
// 该分支是动态sql
|
||||
Object obj = boundSql.getAdditionalParameter(propertyName);
|
||||
sql = sql.replaceFirst("\\?",
|
||||
Matcher.quoteReplacement(getParameterValue(obj)));
|
||||
} else {
|
||||
// 打印出缺失,提醒该参数缺失并防止错位
|
||||
sql = sql.replaceFirst("\\?", "缺失");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
// 如果参数是String,则添加单引号, 如果是日期,则转换为时间格式器并加单引号; 对参数是null和不是null的情况作了处理
|
||||
private static String getParameterValue(Object obj) {
|
||||
String value;
|
||||
if (obj instanceof String) {
|
||||
value = "'" + obj.toString() + "'";
|
||||
} else if (obj instanceof Date) {
|
||||
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.DEFAULT,
|
||||
DateFormat.DEFAULT, Locale.CHINA);
|
||||
value = "'" + formatter.format(new Date()) + "'";
|
||||
} else {
|
||||
if (obj != null) {
|
||||
value = obj.toString();
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.landaiqing.infra.basic.config;
|
||||
|
||||
import org.apache.ibatis.cache.CacheKey;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.plugin.*;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
@Intercepts({
|
||||
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class,
|
||||
Object.class}),
|
||||
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class,
|
||||
Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class})})
|
||||
public class SqlStatementInterceptor implements Interceptor {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger("sys-sql");
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
return invocation.proceed();
|
||||
} finally {
|
||||
long timeConsuming = System.currentTimeMillis() - startTime;
|
||||
log.info("执行SQL:{}ms", timeConsuming);
|
||||
if (timeConsuming > 999 && timeConsuming < 5000) {
|
||||
log.info("执行SQL大于1s:{}ms", timeConsuming);
|
||||
} else if (timeConsuming >= 5000 && timeConsuming < 10000) {
|
||||
log.info("执行SQL大于5s:{}ms", timeConsuming);
|
||||
} else if (timeConsuming >= 10000) {
|
||||
log.info("执行SQL大于10s:{}ms", timeConsuming);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object plugin(Object target) {
|
||||
return Plugin.wrap(target, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperties(Properties properties) {
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,83 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Clazz;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.awt.print.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Clazz)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:43:59
|
||||
*/
|
||||
public interface ClazzDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Clazz queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param clazz 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Clazz> queryAllByLimit(Clazz clazz);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param clazz 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(Clazz clazz);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param clazz 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Clazz clazz);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Clazz> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<Clazz> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Clazz> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<Clazz> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param clazz 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Clazz clazz);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,83 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Grade;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Grade)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:20
|
||||
*/
|
||||
public interface GradeDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Grade queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param grade 查询条件
|
||||
* @param pageable 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Grade> queryAllByLimit(Grade grade);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param grade 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(Grade grade);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param grade 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Grade grade);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Grade> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<Grade> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Grade> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<Grade> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param grade 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Grade grade);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,84 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Permission;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.awt.print.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Permission)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:35
|
||||
*/
|
||||
public interface PermissionDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Permission queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param permission 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Permission> queryAllByLimit(Permission permission);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param permission 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(Permission permission);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param permission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Permission permission);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Permission> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<Permission> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Permission> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<Permission> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param permission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Permission permission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
List<Permission> queryPermission(@Param("list") List<Integer> permissionList);
|
||||
}
|
||||
|
@@ -0,0 +1,83 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Role;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.awt.print.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Role)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:56
|
||||
*/
|
||||
public interface RoleDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Role queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param role 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Role> queryAllByLimit(Role role);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param role 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(Role role);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param role 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Role role);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Role> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<Role> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Role> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<Role> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param role 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Role role);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,84 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.RolePermission;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.awt.print.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (RolePermission)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:30:14
|
||||
*/
|
||||
public interface RolePermissionDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
RolePermission queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param rolePermission 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<RolePermission> queryAllByLimit(RolePermission rolePermission);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param rolePermission 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(RolePermission rolePermission);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param rolePermission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(RolePermission rolePermission);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<RolePermission> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<RolePermission> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<RolePermission> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<RolePermission> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param rolePermission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(RolePermission rolePermission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
List<Integer> queryPermissionById(@Param("roleId") Integer roleId);
|
||||
}
|
||||
|
@@ -0,0 +1,90 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Student)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:25:32
|
||||
*/
|
||||
public interface StudentDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Student queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param student 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<Student> queryAllByLimit(Student student);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param student 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(Student student);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param student 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(Student student);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Student> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<Student> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<Student> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<Student> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param student 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(Student student);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
List<Student> queryPage(@Param("student") Student student,
|
||||
@Param("start") int start,
|
||||
@Param("pageSize") Integer pageSize);
|
||||
|
||||
Integer selectCount();
|
||||
|
||||
Integer login(Student student);
|
||||
}
|
||||
|
@@ -0,0 +1,85 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.entity.StudentRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.awt.print.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (StudentRole)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:53
|
||||
*/
|
||||
public interface StudentRoleDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
StudentRole queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param studentRole 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<StudentRole> queryAllByLimit(StudentRole studentRole);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param studentRole 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(StudentRole studentRole);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param studentRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(StudentRole studentRole);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<StudentRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<StudentRole> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<StudentRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<StudentRole> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param studentRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(StudentRole studentRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
Integer queryRoleById(Student student);
|
||||
}
|
||||
|
@@ -0,0 +1,81 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (User)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:20
|
||||
*/
|
||||
public interface UserDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
User queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param user 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<User> queryAllByLimit(User user);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param user 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(User user);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param user 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(User user);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<User> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<User> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<User> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<User> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param user 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(User user);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,83 @@
|
||||
package com.landaiqing.infra.basic.dao;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.UserRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.awt.print.Pageable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (UserRole)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:18:10
|
||||
*/
|
||||
public interface UserRoleDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
UserRole queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param userRole 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<UserRole> queryAllByLimit(UserRole userRole);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param userRole 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(UserRole userRole);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param userRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(UserRole userRole);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<UserRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<UserRole> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<UserRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<UserRole> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param userRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(UserRole userRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (Clazz)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:44:00
|
||||
*/
|
||||
public class Clazz implements Serializable {
|
||||
private static final long serialVersionUID = -14659318323663338L;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
/**
|
||||
* 班级人数
|
||||
*/
|
||||
private Integer num;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (Grade)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:20
|
||||
*/
|
||||
@Data
|
||||
public class Grade implements Serializable {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
private String gradeName;
|
||||
/**
|
||||
* 年级人数
|
||||
*/
|
||||
private Long num;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,54 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (Permission)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:35
|
||||
*/
|
||||
@Data
|
||||
public class Permission implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String menuUrl;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer show;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String permissionKey;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (Role)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:56
|
||||
*/
|
||||
@Data
|
||||
public class Role implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleKey;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (RolePermission)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:30:14
|
||||
*/
|
||||
@Data
|
||||
public class RolePermission implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
private Long permissionId;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,82 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (Student)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:25:32
|
||||
*/
|
||||
@Data
|
||||
public class Student implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
private String sno;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
private Integer className;
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
private Integer grade;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 头像链接
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private Date dateOfBirth;
|
||||
/**
|
||||
* email
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 班级id
|
||||
*/
|
||||
private Long classId;
|
||||
/**
|
||||
* 年级id
|
||||
*/
|
||||
private Long gradeId;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,46 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (StudentRole)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:53
|
||||
*/
|
||||
public class StudentRole implements Serializable {
|
||||
private static final long serialVersionUID = -31879713425539695L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Long studentId;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Long studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,46 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (User)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:20
|
||||
*/
|
||||
public class User implements Serializable {
|
||||
private static final long serialVersionUID = 722350032981333679L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,46 @@
|
||||
package com.landaiqing.infra.basic.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* (UserRole)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:18:10
|
||||
*/
|
||||
public class UserRole implements Serializable {
|
||||
private static final long serialVersionUID = -74671402061801196L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,48 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Clazz;
|
||||
|
||||
|
||||
/**
|
||||
* (Clazz)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:44:00
|
||||
*/
|
||||
public interface ClazzService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Clazz queryById(Integer id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param clazz 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Clazz insert(Clazz clazz);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param clazz 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Clazz update(Clazz clazz);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Grade;
|
||||
|
||||
|
||||
/**
|
||||
* (Grade)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:20
|
||||
*/
|
||||
public interface GradeService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Grade queryById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param grade 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Grade insert(Grade grade);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param grade 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Grade update(Grade grade);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Permission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* (Permission)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:35
|
||||
*/
|
||||
public interface PermissionService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Permission queryById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param permission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Permission insert(Permission permission);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param permission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Permission update(Permission permission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
List<Permission> queryPermission(List<Integer> permissionList);
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.RolePermission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* (RolePermission)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:30:14
|
||||
*/
|
||||
public interface RolePermissionService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
RolePermission queryById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param rolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
RolePermission insert(RolePermission rolePermission);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param rolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
RolePermission update(RolePermission rolePermission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
List<Integer> queryPermissionById(Integer roleId);
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Role;
|
||||
|
||||
|
||||
/**
|
||||
* (Role)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:56
|
||||
*/
|
||||
public interface RoleService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Role queryById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param role 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Role insert(Role role);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param role 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Role update(Role role);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.entity.StudentRole;
|
||||
|
||||
|
||||
/**
|
||||
* (StudentRole)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:53
|
||||
*/
|
||||
public interface StudentRoleService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
StudentRole queryById(Integer id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param studentRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
StudentRole insert(StudentRole studentRole);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param studentRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
StudentRole update(StudentRole studentRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
Integer queryRoleById(Student student);
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Student)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:25:33
|
||||
*/
|
||||
public interface StudentService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
Student queryById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param student 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Student insert(Student student);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param student 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Integer update(Student student);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
List<Student> queryPage(Student student,int start, Integer pageSize);
|
||||
|
||||
Integer selectCount();
|
||||
|
||||
Integer login(Student student);
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.UserRole;
|
||||
|
||||
/**
|
||||
* (UserRole)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:18:10
|
||||
*/
|
||||
public interface UserRoleService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
UserRole queryById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param userRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
UserRole insert(UserRole userRole);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param userRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
UserRole update(UserRole userRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package com.landaiqing.infra.basic.service;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.User;
|
||||
|
||||
|
||||
/**
|
||||
* (User)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:20
|
||||
*/
|
||||
public interface UserService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
User queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param user 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
User insert(User user);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param user 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
User update(User user);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.infra.basic.entity.Clazz;
|
||||
import com.landaiqing.infra.basic.dao.ClazzDao;
|
||||
import com.landaiqing.infra.basic.service.ClazzService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (Clazz)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:44:00
|
||||
*/
|
||||
@Service("clazzService")
|
||||
public class ClazzServiceImpl implements ClazzService {
|
||||
@Resource
|
||||
private ClazzDao clazzDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Clazz queryById(Integer id) {
|
||||
return this.clazzDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param clazz 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Clazz insert(Clazz clazz) {
|
||||
this.clazzDao.insert(clazz);
|
||||
return clazz;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param clazz 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Clazz update(Clazz clazz) {
|
||||
this.clazzDao.update(clazz);
|
||||
return this.queryById(clazz.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.clazzDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Grade;
|
||||
import com.landaiqing.infra.basic.dao.GradeDao;
|
||||
import com.landaiqing.infra.basic.service.GradeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (Grade)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:20
|
||||
*/
|
||||
@Service("gradeService")
|
||||
public class GradeServiceImpl implements GradeService {
|
||||
@Resource
|
||||
private GradeDao gradeDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Grade queryById(Long id) {
|
||||
return this.gradeDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param grade 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Grade insert(Grade grade) {
|
||||
this.gradeDao.insert(grade);
|
||||
return grade;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param grade 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Grade update(Grade grade) {
|
||||
this.gradeDao.update(grade);
|
||||
return this.queryById(grade.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.gradeDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Permission;
|
||||
import com.landaiqing.infra.basic.dao.PermissionDao;
|
||||
import com.landaiqing.infra.basic.service.PermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Permission)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:36
|
||||
*/
|
||||
@Service("permissionService")
|
||||
public class PermissionServiceImpl implements PermissionService {
|
||||
@Resource
|
||||
private PermissionDao permissionDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Permission queryById(Long id) {
|
||||
return this.permissionDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param permission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Permission insert(Permission permission) {
|
||||
this.permissionDao.insert(permission);
|
||||
return permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param permission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Permission update(Permission permission) {
|
||||
this.permissionDao.update(permission);
|
||||
return this.queryById(permission.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.permissionDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Permission> queryPermission(List<Integer> permissionList) {
|
||||
return this.permissionDao.queryPermission(permissionList);
|
||||
}
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.RolePermission;
|
||||
import com.landaiqing.infra.basic.dao.RolePermissionDao;
|
||||
import com.landaiqing.infra.basic.service.RolePermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (RolePermission)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:30:15
|
||||
*/
|
||||
@Service("rolePermissionService")
|
||||
public class RolePermissionServiceImpl implements RolePermissionService {
|
||||
@Resource
|
||||
private RolePermissionDao rolePermissionDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public RolePermission queryById(Long id) {
|
||||
return this.rolePermissionDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param rolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public RolePermission insert(RolePermission rolePermission) {
|
||||
this.rolePermissionDao.insert(rolePermission);
|
||||
return rolePermission;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param rolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public RolePermission update(RolePermission rolePermission) {
|
||||
this.rolePermissionDao.update(rolePermission);
|
||||
return this.queryById(rolePermission.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.rolePermissionDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> queryPermissionById(Integer roleId) {
|
||||
return this.rolePermissionDao.queryPermissionById(roleId);
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Role;
|
||||
import com.landaiqing.infra.basic.dao.RoleDao;
|
||||
import com.landaiqing.infra.basic.service.RoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (Role)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:29:56
|
||||
*/
|
||||
@Service("roleService")
|
||||
public class RoleServiceImpl implements RoleService {
|
||||
@Resource
|
||||
private RoleDao roleDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Role queryById(Long id) {
|
||||
return this.roleDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param role 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Role insert(Role role) {
|
||||
this.roleDao.insert(role);
|
||||
return role;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param role 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Role update(Role role) {
|
||||
this.roleDao.update(role);
|
||||
return this.queryById(role.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.roleDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.entity.StudentRole;
|
||||
import com.landaiqing.infra.basic.dao.StudentRoleDao;
|
||||
import com.landaiqing.infra.basic.service.StudentRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (StudentRole)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:53
|
||||
*/
|
||||
@Service("studentRoleService")
|
||||
public class StudentRoleServiceImpl implements StudentRoleService {
|
||||
@Resource
|
||||
private StudentRoleDao studentRoleDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public StudentRole queryById(Integer id) {
|
||||
return this.studentRoleDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param studentRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public StudentRole insert(StudentRole studentRole) {
|
||||
this.studentRoleDao.insert(studentRole);
|
||||
return studentRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param studentRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public StudentRole update(StudentRole studentRole) {
|
||||
this.studentRoleDao.update(studentRole);
|
||||
return this.queryById(studentRole.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.studentRoleDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer queryRoleById(Student student) {
|
||||
return this.studentRoleDao.queryRoleById(student);
|
||||
}
|
||||
}
|
@@ -0,0 +1,86 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.auth.common.entity.PageResult;
|
||||
import com.landaiqing.infra.basic.entity.Student;
|
||||
import com.landaiqing.infra.basic.dao.StudentDao;
|
||||
import com.landaiqing.infra.basic.service.StudentService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Student)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-04 22:25:33
|
||||
*/
|
||||
@Service("studentService")
|
||||
public class StudentServiceImpl implements StudentService {
|
||||
@Resource
|
||||
private StudentDao studentDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Student queryById(Long id) {
|
||||
return this.studentDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param student 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Student insert(Student student) {
|
||||
this.studentDao.insert(student);
|
||||
return student;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param student 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Integer update(Student student) {
|
||||
return this.studentDao.update(student);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.studentDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Student> queryPage(Student student,int start,Integer pageSize) {
|
||||
return this.studentDao.queryPage(student,start,pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectCount() {
|
||||
return this.studentDao.selectCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer login(Student student) {
|
||||
return this.studentDao.login(student);
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.UserRole;
|
||||
import com.landaiqing.infra.basic.dao.UserRoleDao;
|
||||
import com.landaiqing.infra.basic.service.UserRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (UserRole)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:18:10
|
||||
*/
|
||||
@Service("userRoleService")
|
||||
public class UserRoleServiceImpl implements UserRoleService {
|
||||
@Resource
|
||||
private UserRoleDao userRoleDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public UserRole queryById(Long id) {
|
||||
return this.userRoleDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param userRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public UserRole insert(UserRole userRole) {
|
||||
this.userRoleDao.insert(userRole);
|
||||
return userRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param userRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public UserRole update(UserRole userRole) {
|
||||
this.userRoleDao.update(userRole);
|
||||
return this.queryById(userRole.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.userRoleDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
package com.landaiqing.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.landaiqing.infra.basic.entity.User;
|
||||
import com.landaiqing.infra.basic.dao.UserDao;
|
||||
import com.landaiqing.infra.basic.service.UserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (User)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-05 12:17:20
|
||||
*/
|
||||
@Service("userService")
|
||||
public class UserServiceImpl implements UserService {
|
||||
@Resource
|
||||
private UserDao userDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public User queryById(Integer id) {
|
||||
return this.userDao.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param user 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public User insert(User user) {
|
||||
this.userDao.insert(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param user 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public User update(User user) {
|
||||
this.userDao.update(user);
|
||||
return this.queryById(user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.userDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.landaiqing.infra.basic.utils;
|
||||
|
||||
import com.alibaba.druid.filter.config.ConfigTools;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
|
||||
/**
|
||||
* 数据库加密util
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/7
|
||||
*/
|
||||
public class DruidEncryptUtil {
|
||||
|
||||
private static String publicKey;
|
||||
|
||||
private static String privateKey;
|
||||
|
||||
static {
|
||||
try {
|
||||
String[] keyPair = ConfigTools.genKeyPair(512);
|
||||
privateKey=keyPair[0];
|
||||
System.out.println("privateKey:"+privateKey);
|
||||
publicKey=keyPair[1];
|
||||
System.out.println("publicKey:"+publicKey);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NoSuchProviderException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
public static String encrypt(String plainText) throws Exception {
|
||||
String encrypt = ConfigTools.encrypt(privateKey, plainText);
|
||||
System.out.println("encrypt:"+encrypt);
|
||||
return encrypt;
|
||||
}
|
||||
public static String decrypt(String encryptText) throws Exception {
|
||||
String decrypt = ConfigTools.decrypt(publicKey, encryptText);
|
||||
System.out.println("decrypt:"+decrypt);
|
||||
return decrypt;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String encrypt = encrypt("1611");
|
||||
System.out.println("encrypt:"+encrypt);
|
||||
}
|
||||
}
|
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.ClazzDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.Clazz" id="ClazzMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="className" column="class_name" jdbcType="VARCHAR"/>
|
||||
<result property="num" column="num" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="ClazzMap">
|
||||
select
|
||||
id,class_name,num
|
||||
from clazz
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="ClazzMap">
|
||||
select
|
||||
id,class_name,num
|
||||
from clazz
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="className != null and className != ''">
|
||||
and class_name = #{className}
|
||||
</if>
|
||||
<if test="num != null">
|
||||
and num = #{num}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from clazz
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="className != null and className != ''">
|
||||
and class_name = #{className}
|
||||
</if>
|
||||
<if test="num != null">
|
||||
and num = #{num}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into clazz(class_name, num)
|
||||
values (#{className}, #{num})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into clazz(class_name,num)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.className},#{entity.num})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into clazz(class_name,num)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.className},#{entity.num})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
class_name = values(class_name)num = values(num)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update clazz
|
||||
<set>
|
||||
<if test="className != null and className != ''">
|
||||
class_name = #{className},
|
||||
</if>
|
||||
<if test="num != null">
|
||||
num = #{num},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from clazz where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
100
sms-auth/sms-auth-infra/src/main/resources/mapper/GradeDao.xml
Normal file
100
sms-auth/sms-auth-infra/src/main/resources/mapper/GradeDao.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.GradeDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.Grade" id="GradeMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="gradeName" column="grade_name" jdbcType="VARCHAR"/>
|
||||
<result property="num" column="num" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="GradeMap">
|
||||
select id,grade_name,num
|
||||
from grade
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="GradeMap">
|
||||
select
|
||||
id,grade_name,num
|
||||
from grade
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="gradeName != null and gradeName != ''">
|
||||
and grade_name = #{gradeName}
|
||||
</if>
|
||||
<if test="num != null">
|
||||
and num = #{num}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from grade
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="gradeName != null and gradeName != ''">
|
||||
and grade_name = #{gradeName}
|
||||
</if>
|
||||
<if test="num != null">
|
||||
and num = #{num}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into grade(grade_name,num)
|
||||
values (#{gradeName},#{num})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into grade(grade_name,num)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.gradeName},#{entity.num})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into grade(grade_name,num)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.gradeName},#{entity.num})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
grade_name = values(grade_name)num = values(num)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update grade
|
||||
<set>
|
||||
<if test="gradeName != null and gradeName != ''">
|
||||
grade_name = #{gradeName},
|
||||
</if>
|
||||
<if test="num != null">
|
||||
num = #{num},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from grade
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.PermissionDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.Permission" id="PermissionMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="menuUrl" column="menu_url" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="show" column="show" jdbcType="INTEGER"/>
|
||||
<result property="icon" column="icon" jdbcType="VARCHAR"/>
|
||||
<result property="permissionKey" column="permission_key" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="PermissionMap">
|
||||
select id,name,parent_id,`type`,menu_url,status,`show`,icon,permission_key,created_by,created_time,update_by,update_time,is_deleted
|
||||
from permission
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="PermissionMap">
|
||||
select id,name,parent_id,`type`,menu_url,status,`show`,icon,permission_key,created_by,created_time,update_by,update_time,is_deleted
|
||||
from permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and `type` = #{type}
|
||||
</if>
|
||||
<if test="menuUrl != null and menuUrl != ''">
|
||||
and menu_url = #{menuUrl}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and `status` = #{status}
|
||||
</if>
|
||||
<if test="show != null">
|
||||
and `show` = #{show}
|
||||
</if>
|
||||
<if test="icon != null and icon != ''">
|
||||
and icon = #{icon}
|
||||
</if>
|
||||
<if test="permissionKey != null and permissionKey != ''">
|
||||
and permission_key = #{permissionKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and `type` = #{type}
|
||||
</if>
|
||||
<if test="menuUrl != null and menuUrl != ''">
|
||||
and menu_url = #{menuUrl}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and `status` = #{status}
|
||||
</if>
|
||||
<if test="show != null">
|
||||
and `show` = #{show}
|
||||
</if>
|
||||
<if test="icon != null and icon != ''">
|
||||
and icon = #{icon}
|
||||
</if>
|
||||
<if test="permissionKey != null and permissionKey != ''">
|
||||
and permission_key = #{permissionKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryPermission" resultMap="PermissionMap">
|
||||
select *
|
||||
from permission
|
||||
where id in
|
||||
<foreach open="(" close=")" collection="list" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into permission(name,parent_id,`type`,menu_url,status,`show`,icon,permission_key,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values (#{name},#{parentId},#{type},#{menuUrl},#{status},#{show},#{icon},#{permissionKey},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into
|
||||
permission(name,parent_id,`type`,menu_url,status,`show`,icon,permission_key,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.name},#{entity.parentId},#{entity.type},#{entity.menuUrl},#{entity.status},#{entity.show},#{entity.icon},#{entity.permissionKey},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into
|
||||
permission(name,parent_id,`type`,menu_url,status,`show`,icon,permission_key,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.name},#{entity.parentId},#{entity.type},#{entity.menuUrl},#{entity.status},#{entity.show},#{entity.icon},#{entity.permissionKey},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
name = values(name)parent_id = values(parent_id)type = values(type)menu_url = values(menu_url)status =
|
||||
values(status)show = values(show)icon = values(icon)permission_key = values(permission_key)created_by =
|
||||
values(created_by)created_time = values(created_time)update_by = values(update_by)update_time =
|
||||
values(update_time)is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update permission
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type},
|
||||
</if>
|
||||
<if test="menuUrl != null and menuUrl != ''">
|
||||
menu_url = #{menuUrl},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="show != null">
|
||||
show = #{show},
|
||||
</if>
|
||||
<if test="icon != null and icon != ''">
|
||||
icon = #{icon},
|
||||
</if>
|
||||
<if test="permissionKey != null and permissionKey != ''">
|
||||
permission_key = #{permissionKey},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from permission
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
152
sms-auth/sms-auth-infra/src/main/resources/mapper/RoleDao.xml
Normal file
152
sms-auth/sms-auth-infra/src/main/resources/mapper/RoleDao.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.RoleDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.Role" id="RoleMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
||||
<result property="roleKey" column="role_key" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="RoleMap">
|
||||
select id,role_name,role_key,created_by,created_time,update_by,update_time,is_deleted
|
||||
from role
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="RoleMap">
|
||||
select
|
||||
id,role_name,role_key,created_by,created_time,update_by,update_time,is_deleted
|
||||
from role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and role_name = #{roleName}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
and role_key = #{roleKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and role_name = #{roleName}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
and role_key = #{roleKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into role(role_name,role_key,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values (#{roleName},#{roleKey},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into role(role_name,role_key,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleName},#{entity.roleKey},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into role(role_name,role_key,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleName},#{entity.roleKey},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
role_name = values(role_name)role_key = values(role_key)created_by = values(created_by)created_time =
|
||||
values(created_time)update_by = values(update_by)update_time = values(update_time)is_deleted =
|
||||
values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
role_name = #{roleName},
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
role_key = #{roleKey},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from role
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.RolePermissionDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.RolePermission" id="RolePermissionMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
<result property="permissionId" column="permission_id" jdbcType="INTEGER"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="RolePermissionMap">
|
||||
select id,role_id,permission_id,created_by,created_time,update_by,update_time,is_deleted
|
||||
from role_permission
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="RolePermissionMap">
|
||||
select
|
||||
id,role_id,permission_id,created_by,created_time,update_by,update_time,is_deleted
|
||||
from role_permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="permissionId != null">
|
||||
and permission_id = #{permissionId}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from role_permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="permissionId != null">
|
||||
and permission_id = #{permissionId}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryPermissionById" resultType="java.lang.Integer">
|
||||
select role_permission.permission_id
|
||||
from role_permission
|
||||
where role_id=#{roleId}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into role_permission(role_id,permission_id,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values (#{roleId},#{permissionId},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into role_permission(role_id,permission_id,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleId},#{entity.permissionId},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into role_permission(role_id,permission_id,created_by,created_time,update_by,update_time,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleId},#{entity.permissionId},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
role_id = values(role_id)permission_id = values(permission_id)created_by = values(created_by)created_time =
|
||||
values(created_time)update_by = values(update_by)update_time = values(update_time)is_deleted =
|
||||
values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update role_permission
|
||||
<set>
|
||||
<if test="roleId != null">
|
||||
role_id = #{roleId},
|
||||
</if>
|
||||
<if test="permissionId != null">
|
||||
permission_id = #{permissionId},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from role_permission
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
242
sms-auth/sms-auth-infra/src/main/resources/mapper/StudentDao.xml
Normal file
242
sms-auth/sms-auth-infra/src/main/resources/mapper/StudentDao.xml
Normal file
@@ -0,0 +1,242 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.StudentDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.Student" id="StudentMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="sno" column="sno" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="password" jdbcType="VARCHAR"/>
|
||||
<result property="username" column="username" jdbcType="VARCHAR"/>
|
||||
<result property="className" column="class_name" jdbcType="INTEGER"/>
|
||||
<result property="grade" column="grade" jdbcType="INTEGER"/>
|
||||
<result property="age" column="age" jdbcType="INTEGER"/>
|
||||
<result property="sex" column="sex" jdbcType="INTEGER"/>
|
||||
<result property="avatar" column="avatar" jdbcType="VARCHAR"/>
|
||||
<result property="dateOfBirth" column="date_of_birth" jdbcType="TIMESTAMP"/>
|
||||
<result property="email" column="email" jdbcType="VARCHAR"/>
|
||||
<result property="phoneNumber" column="phone_number" jdbcType="VARCHAR"/>
|
||||
<result property="classId" column="class_id" jdbcType="INTEGER"/>
|
||||
<result property="gradeId" column="grade_id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="StudentMap">
|
||||
select
|
||||
id,sno,password,username,class_name,grade,age,sex,avatar,date_of_birth,email,phone_number,class_id,grade_id,role_id,is_deleted
|
||||
from student
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="StudentMap">
|
||||
select
|
||||
id,sno,password,username,class_name,grade,age,sex,avatar,date_of_birth,email,phone_number,class_id,grade_id,role_id,is_deleted
|
||||
from student
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="sno != null and sno != ''">
|
||||
and sno = #{sno}
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and password = #{password}
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
and username = #{username}
|
||||
</if>
|
||||
<if test="className != null">
|
||||
and class_name = #{className}
|
||||
</if>
|
||||
<if test="grade != null">
|
||||
and grade = #{grade}
|
||||
</if>
|
||||
<if test="age != null">
|
||||
and age = #{age}
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
and sex = #{sex}
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
and avatar = #{avatar}
|
||||
</if>
|
||||
<if test="dateOfBirth != null">
|
||||
and date_of_birth = #{dateOfBirth}
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
and email = #{email}
|
||||
</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''">
|
||||
and phone_number = #{phoneNumber}
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
and class_id = #{classId}
|
||||
</if>
|
||||
<if test="gradeId != null">
|
||||
and grade_id = #{gradeId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from student
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="sno != null and sno != ''">
|
||||
and sno = #{sno}
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and password = #{password}
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
and username = #{username}
|
||||
</if>
|
||||
<if test="className != null">
|
||||
and class_name = #{className}
|
||||
</if>
|
||||
<if test="grade != null">
|
||||
and grade = #{grade}
|
||||
</if>
|
||||
<if test="age != null">
|
||||
and age = #{age}
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
and sex = #{sex}
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
and avatar = #{avatar}
|
||||
</if>
|
||||
<if test="dateOfBirth != null">
|
||||
and date_of_birth = #{dateOfBirth}
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
and email = #{email}
|
||||
</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''">
|
||||
and phone_number = #{phoneNumber}
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
and class_id = #{classId}
|
||||
</if>
|
||||
<if test="gradeId != null">
|
||||
and grade_id = #{gradeId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryPage" resultMap="StudentMap">
|
||||
select *
|
||||
from student
|
||||
limit #{start},#{pageSize}
|
||||
</select>
|
||||
<select id="selectCount" resultType="java.lang.Integer">
|
||||
select count(1) from student
|
||||
</select>
|
||||
<select id="login" resultType="java.lang.Integer">
|
||||
select * from student
|
||||
where username=#{username}
|
||||
and password=#{password}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into student(sno,password,username,class_name,grade,age,sex,avatar,date_of_birth,email,phone_number,class_id,grade_id,role_id,is_deleted)
|
||||
values (#{sno},#{password},#{username},#{className},#{grade},#{age},#{sex},#{avatar},#{dateOfBirth},#{email},#{phoneNumber},#{classId},#{gradeId},#{roleId},#{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into student(sno,password,username,class_name,grade,age,sex,avatar,date_of_birth,email,phone_number,class_id,grade_id,role_id,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.sno},#{entity.password},#{entity.username},#{entity.className},#{entity.grade},#{entity.age},#{entity.sex},#{entity.avatar},#{entity.dateOfBirth},#{entity.email},#{entity.phoneNumber},#{entity.classId},#{entity.gradeId},#{entity.roleId},#{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into student(sno,password,username,class_name,grade,age,sex,avatar,date_of_birth,email,phone_number,class_id,grade_id,role_id,is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.sno},#{entity.password},#{entity.username},#{entity.className},#{entity.grade},#{entity.age},#{entity.sex},#{entity.avatar},#{entity.dateOfBirth},#{entity.email},#{entity.phoneNumber},#{entity.classId},#{entity.gradeId},#{entity.roleId},#{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
sno = values(sno)password = values(password)username = values(username)class_name = values(class_name)grade = values(grade)age = values(age)sex = values(sex)avatar = values(avatar)date_of_birth = values(date_of_birth)email = values(email)phone_number = values(phone_number)class_id = values(class_id)grade_id = values(grade_id)role_id = values(role_id)is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update student
|
||||
<set>
|
||||
<if test="sno != null and sno != ''">
|
||||
sno = #{sno},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
`password` = #{password},
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
username = #{username},
|
||||
</if>
|
||||
<if test="className != null">
|
||||
class_name = #{className},
|
||||
</if>
|
||||
<if test="grade != null">
|
||||
grade = #{grade},
|
||||
</if>
|
||||
<if test="age != null">
|
||||
age = #{age},
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
sex = #{sex},
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
avatar = #{avatar},
|
||||
</if>
|
||||
<if test="dateOfBirth != null">
|
||||
date_of_birth = #{dateOfBirth},
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
email = #{email},
|
||||
</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''">
|
||||
phone_number = #{phoneNumber},
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
class_id = #{classId},
|
||||
</if>
|
||||
<if test="gradeId != null">
|
||||
grade_id = #{gradeId},
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
role_id = #{roleId},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from student where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.StudentRoleDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.StudentRole" id="StudentRoleMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="studentId" column="student_id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="StudentRoleMap">
|
||||
select id,student_id,role_id
|
||||
from student_role
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="StudentRoleMap">
|
||||
select
|
||||
id,student_id,role_id
|
||||
from student_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
and student_id = #{studentId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from student_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
and student_id = #{studentId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryRoleById" resultType="java.lang.Integer">
|
||||
select role_id
|
||||
from student_role
|
||||
where student_id=#{id}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into student_role(student_id,role_id)
|
||||
values (#{studentId},#{roleId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into student_role(student_id,role_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.studentId},#{entity.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into student_role(student_id,role_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.studentId},#{entity.roleId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
student_id = values(student_id)role_id = values(role_id)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update student_role
|
||||
<set>
|
||||
<if test="studentId != null">
|
||||
student_id = #{studentId},
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
role_id = #{roleId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from student_role
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.UserDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.User" id="UserMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="username" column="username" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="password" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="UserMap">
|
||||
select
|
||||
id,username,password
|
||||
from user
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="UserMap">
|
||||
select
|
||||
id,username,password
|
||||
from user
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
and username = #{username}
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and password = #{password}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from user
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
and username = #{username}
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and password = #{password}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into user(username,password)
|
||||
values (#{username},#{password})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into user(username,password)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.username},#{entity.password})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into user(username,password)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.username},#{entity.password})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
username = values(username)password = values(password)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update user
|
||||
<set>
|
||||
<if test="username != null and username != ''">
|
||||
username = #{username},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
password = #{password},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from user where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.landaiqing.infra.basic.dao.UserRoleDao">
|
||||
|
||||
<resultMap type="com.landaiqing.infra.basic.entity.UserRole" id="UserRoleMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="UserRoleMap">
|
||||
select id,user_id,role_id
|
||||
from user_role
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="UserRoleMap">
|
||||
select
|
||||
id,user_id,role_id
|
||||
from user_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from user_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into user_role(user_id,role_id)
|
||||
values (#{userId},#{roleId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into user_role(user_id,role_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId},#{entity.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into user_role(user_id,role_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId},#{entity.roleId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
user_id = values(user_id)role_id = values(role_id)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update user_role
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
role_id = #{roleId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from user_role
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
93
sms-auth/sms-auth-start/pom.xml
Normal file
93
sms-auth/sms-auth-start/pom.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>sms-auth-starter</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>qing-yu-club-auth-starter</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>2.4.2</spring-boot.version>
|
||||
<spring-cloud-alibaba.version>2021.1</spring-cloud-alibaba.version>
|
||||
<spring-cloud.version>2020.0.6</spring-cloud.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.4.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-infra</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-auth-controller</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<!--打包成jar包时的名字-->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.3.0.RELEASE</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@@ -0,0 +1,21 @@
|
||||
package com.landaiqing.auth;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* 服务启动类
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/7
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ComponentScan("com.landaiqing")
|
||||
@MapperScan("com.landaiqing.**.dao")
|
||||
public class AuthApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AuthApplication.class);
|
||||
}
|
||||
}
|
82
sms-auth/sms-auth-start/src/main/resources/application.yml
Normal file
82
sms-auth/sms-auth-start/src/main/resources/application.yml
Normal file
@@ -0,0 +1,82 @@
|
||||
server:
|
||||
port: 3001
|
||||
|
||||
spring:
|
||||
messages:
|
||||
basename: i18n/messages
|
||||
datasource:
|
||||
username: root
|
||||
password: fJbWjC0gnwYGDiUV1CWZAnQCfoujrWqoN8sTwz+B5PGqgZi8ohRPSOQYVPnKPQ3mTbdYRLY7S2DQMQwLDySX8g==
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/sutdent-management-system?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=true
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
initial-size: 20
|
||||
min-idle: 20
|
||||
max-active: 100
|
||||
max-wait: 60000
|
||||
connectionProperties: config.decrypt=true;config.decrypt.key=${publicKey};
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
login-username: admin
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
slow-sql-millis: 2000
|
||||
log-slow-sql: true
|
||||
wall:
|
||||
enabled: true
|
||||
config:
|
||||
enabled: true
|
||||
# # redis配置
|
||||
# redis:
|
||||
# # Redis数据库索引(默认为0)
|
||||
# database: 1
|
||||
# # Redis服务器地址
|
||||
# host: 116.196.80.239
|
||||
# # Redis服务器连接端口
|
||||
# port: 6379
|
||||
# # Redis服务器连接密码(默认为空)
|
||||
# password: LDQ20020618xxx
|
||||
# # 连接超时时间
|
||||
# timeout: 2s
|
||||
# lettuce:
|
||||
# pool:
|
||||
# # 连接池最大连接数
|
||||
# max-active: 200
|
||||
# # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
# max-wait: -1ms
|
||||
# # 连接池中的最大空闲连接
|
||||
# max-idle: 10
|
||||
# # 连接池中的最小空闲连接
|
||||
# min-idle: 0
|
||||
publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAItqJKHg8SmHDzR2WyWQMY1vXCAYMqtRJTvHrmME9se4xL6/pR0+bXrPW1R/HHmOqba6WuyxveIYh/9m5brJr5cCAwEAAQ==
|
||||
logging:
|
||||
config: classpath:log4j2-spring.xml
|
||||
|
||||
#mybatis-plus:
|
||||
# configuration:
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
||||
#sa-token:
|
||||
# # token 名称(同时也是 cookie 名称)
|
||||
# token-name: satoken
|
||||
# # token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
||||
# timeout: 2592000
|
||||
# # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
|
||||
# active-timeout: -1
|
||||
# # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
||||
# is-concurrent: true
|
||||
# # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
||||
# is-share: true
|
||||
# # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
||||
# token-style: random-32
|
||||
# # 是否输出操作日志
|
||||
# is-log: true
|
||||
# token-prefix: auth
|
||||
|
||||
|
||||
|
87
sms-auth/sms-auth-start/src/main/resources/log4j2-spring.xml
Normal file
87
sms-auth/sms-auth-start/src/main/resources/log4j2-spring.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--Configuration后面的status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出-->
|
||||
<!--monitorInterval:Log4j能够自动检测修改配置 文件和重新配置本身,设置间隔秒数-->
|
||||
<configuration status="INFO" monitorInterval="5">
|
||||
<!--日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
|
||||
<!--变量配置-->
|
||||
<Properties>
|
||||
<!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
|
||||
<!-- %logger{36} 表示 Logger 名字最长36个字符 -->
|
||||
<property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} %X{PFTID} [%thread] %-5level %logger{36} - %msg%n" />
|
||||
<!-- 定义日志存储的路径 -->
|
||||
<property name="FILE_PATH" value="../log" />
|
||||
<property name="FILE_NAME" value="qing-yuClub.log" />
|
||||
</Properties>
|
||||
|
||||
<!--https://logging.apache.org/log4j/2.x/manual/appenders.html-->
|
||||
<appenders>
|
||||
|
||||
<console name="Console" target="SYSTEM_OUT">
|
||||
<!--输出日志的格式-->
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
<!--控制台只输出level及其以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</console>
|
||||
|
||||
<!--文件会打印出所有信息,这个log每次运行程序会自动清空,由append属性决定,适合临时测试用-->
|
||||
<File name="fileLog" fileName="${FILE_PATH}/temp.log" append="false">
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
</File>
|
||||
|
||||
<!-- 这个会打印出所有的info及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
|
||||
<RollingFile name="RollingFileInfo" fileName="${FILE_PATH}/info.log" filePattern="${FILE_PATH}/${FILE_NAME}-INFO-%d{yyyy-MM-dd}_%i.log.gz">
|
||||
<!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
<Policies>
|
||||
<!--interval属性用来指定多久滚动一次,默认是1 hour-->
|
||||
<TimeBasedTriggeringPolicy interval="1"/>
|
||||
<SizeBasedTriggeringPolicy size="10MB"/>
|
||||
</Policies>
|
||||
<!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
|
||||
<DefaultRolloverStrategy max="15"/>
|
||||
</RollingFile>
|
||||
|
||||
<!-- 这个会打印出所有的warn及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
|
||||
<RollingFile name="RollingFileWarn" fileName="${FILE_PATH}/warn.log" filePattern="${FILE_PATH}/${FILE_NAME}-WARN-%d{yyyy-MM-dd}_%i.log.gz">
|
||||
<!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
<Policies>
|
||||
<!--interval属性用来指定多久滚动一次,默认是1 hour-->
|
||||
<TimeBasedTriggeringPolicy interval="1"/>
|
||||
<SizeBasedTriggeringPolicy size="10MB"/>
|
||||
</Policies>
|
||||
<!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
|
||||
<DefaultRolloverStrategy max="15"/>
|
||||
</RollingFile>
|
||||
|
||||
<!-- 这个会打印出所有的error及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
|
||||
<RollingFile name="RollingFileError" fileName="${FILE_PATH}/error.log" filePattern="${FILE_PATH}/${FILE_NAME}-ERROR-%d{yyyy-MM-dd}_%i.log.gz">
|
||||
<!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
<Policies>
|
||||
<!--interval属性用来指定多久滚动一次,默认是1 hour-->
|
||||
<TimeBasedTriggeringPolicy interval="1"/>
|
||||
<SizeBasedTriggeringPolicy size="10MB"/>
|
||||
</Policies>
|
||||
<!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
|
||||
<DefaultRolloverStrategy max="15"/>
|
||||
</RollingFile>
|
||||
|
||||
</appenders>
|
||||
|
||||
<!--Logger节点用来单独指定日志的形式,比如要为指定包下的class指定不同的日志级别等。-->
|
||||
<!--然后定义loggers,只有定义了logger并引入的appender,appender才会生效-->
|
||||
<loggers>
|
||||
<root level="info">
|
||||
<appender-ref ref="Console"/>
|
||||
<appender-ref ref="RollingFileInfo"/>
|
||||
<appender-ref ref="RollingFileWarn"/>
|
||||
<appender-ref ref="RollingFileError"/>
|
||||
<appender-ref ref="fileLog"/>
|
||||
</root>
|
||||
</loggers>
|
||||
|
||||
</configuration>
|
111
sms-oss/pom.xml
Normal file
111
sms-oss/pom.xml
Normal file
@@ -0,0 +1,111 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>sms-oss</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>sms-oss</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>2.4.2</spring-boot.version>
|
||||
<spring-cloud-alibaba.version>2021.1</spring-cloud-alibaba.version>
|
||||
<spring-cloud.version>2020.0.6</spring-cloud.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<!--打包成jar包时的名字-->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.3.0.RELEASE</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>central</id>
|
||||
<name>aliyun maven</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<layout>default</layout>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user