gongyu project
This commit is contained in:
commit
8312e81829
|
@ -0,0 +1,70 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>lease</artifactId>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!--依赖model模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<artifactId>model</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-util</artifactId>
|
||||||
|
<version>9.3.7.v20160115</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>4.2.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpcore</artifactId>
|
||||||
|
<version>4.2.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.atguigu.lease.common.config;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
|
import org.springdoc.core.models.GroupedOpenApi;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class Knife4jConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public OpenAPI customOpenAPI() {
|
||||||
|
|
||||||
|
return new OpenAPI().info(
|
||||||
|
new Info()
|
||||||
|
.title("后台管理系统API")
|
||||||
|
.version("1.0")
|
||||||
|
.description("后台管理系统API"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi systemAPI() {
|
||||||
|
|
||||||
|
return GroupedOpenApi.builder().group("系统信息管理").
|
||||||
|
pathsToMatch(
|
||||||
|
"/admin/system/**"
|
||||||
|
).
|
||||||
|
build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi loginAPI() {
|
||||||
|
|
||||||
|
return GroupedOpenApi.builder().group("后台登录管理").
|
||||||
|
pathsToMatch(
|
||||||
|
"/admin/login/**",
|
||||||
|
"/admin/info"
|
||||||
|
).
|
||||||
|
build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi apartmentAPI() {
|
||||||
|
|
||||||
|
return GroupedOpenApi.builder().group("公寓信息管理").
|
||||||
|
pathsToMatch(
|
||||||
|
"/admin/apartment/**",
|
||||||
|
"/admin/room/**",
|
||||||
|
"/admin/label/**",
|
||||||
|
"/admin/facility/**",
|
||||||
|
"/admin/fee/**",
|
||||||
|
"/admin/attr/**",
|
||||||
|
"/admin/payment/**",
|
||||||
|
"/admin/region/**",
|
||||||
|
"/admin/term/**",
|
||||||
|
"/admin/file/**"
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi leaseAPI() {
|
||||||
|
return GroupedOpenApi.builder().group("租赁信息管理").
|
||||||
|
pathsToMatch(
|
||||||
|
"/admin/appointment/**",
|
||||||
|
"/admin/agreement/**"
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi userAPI() {
|
||||||
|
return GroupedOpenApi.builder().group("平台用户管理").
|
||||||
|
pathsToMatch(
|
||||||
|
"/admin/user/**"
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi allAPI() {
|
||||||
|
return GroupedOpenApi.builder().group("全部接口").
|
||||||
|
pathsToMatch(
|
||||||
|
"/**"
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.common.config;
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.minio.MinioProperties;
|
||||||
|
import io.minio.MinioClient;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Y1NanPing
|
||||||
|
* @create 2025/5/27 上午9:22
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class MinioConfiguration {
|
||||||
|
@Autowired
|
||||||
|
private MinioProperties minioProperties;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public MinioClient minioClient(){
|
||||||
|
return MinioClient.builder()
|
||||||
|
.endpoint(minioProperties.getEndpoint())
|
||||||
|
.credentials(minioProperties.getAccesskey(),
|
||||||
|
minioProperties.getSecretkey())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.atguigu.lease.common.constant;
|
||||||
|
|
||||||
|
public class RedisConstant {
|
||||||
|
|
||||||
|
public static final String ADMIN_LOGIN_PREFIX = "admin:login:";
|
||||||
|
public static final Integer ADMIN_LOGIN_CAPTCHA_TTL_SEC = 60;
|
||||||
|
public static final String APP_LOGIN_PREFIX = "app:login:";
|
||||||
|
public static final Integer APP_LOGIN_CODE_RESEND_TIME_SEC = 60;
|
||||||
|
public static final Integer APP_LOGIN_CODE_TTL_SEC = 60 * 10;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atguigu.lease.common.exception;
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
@ControllerAdvice
|
||||||
|
public class GlobalExceptionHandler {
|
||||||
|
|
||||||
|
//切面类: 把增强 应用到 切入点
|
||||||
|
//我们现在增强是什么: 异常处理
|
||||||
|
//我们现在切入点:出现异常的方法
|
||||||
|
//难点:知道哪个方法出现了异常 @ExceptionHandler
|
||||||
|
|
||||||
|
//出现异常执行的方法
|
||||||
|
@ExceptionHandler(Exception.class)
|
||||||
|
@ResponseBody
|
||||||
|
public Result error(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
@ExceptionHandler(LeaseException.class)
|
||||||
|
@ResponseBody
|
||||||
|
public Result error(LeaseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Integer code = e.getCode();
|
||||||
|
String message = e.getMessage();
|
||||||
|
return Result.fail(code,message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.atguigu.lease.common.exception;
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.ResultCodeEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LeaseException extends RuntimeException {
|
||||||
|
|
||||||
|
//异常状态码
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过状态码和错误消息创建异常对象
|
||||||
|
* @param message
|
||||||
|
* @param code
|
||||||
|
*/
|
||||||
|
public LeaseException(String message, Integer code) {
|
||||||
|
super(message);
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据响应结果枚举对象创建异常对象
|
||||||
|
* @param resultCodeEnum
|
||||||
|
*/
|
||||||
|
public LeaseException(ResultCodeEnum resultCodeEnum) {
|
||||||
|
super(resultCodeEnum.getMessage());
|
||||||
|
this.code = resultCodeEnum.getCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LeaseException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", message=" + this.getMessage() +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.atguigu.lease.common.minio;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Y1NanPing
|
||||||
|
* @create 2025/5/27 上午9:18
|
||||||
|
*/
|
||||||
|
@ConfigurationProperties(prefix = "minio")
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
public class MinioProperties {
|
||||||
|
|
||||||
|
private String endpoint;
|
||||||
|
|
||||||
|
private String accesskey;
|
||||||
|
|
||||||
|
private String secretkey;
|
||||||
|
|
||||||
|
private String bucketname;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.atguigu.lease.common.mybatisplus;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springdoc.core.models.GroupedOpenApi;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@MapperScan("com.atguigu.lease.web.*.mapper")
|
||||||
|
public class MybatisPlusConfiguration {
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||||
|
return interceptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.atguigu.lease.common.result;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局统一返回结果类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class Result<T> {
|
||||||
|
|
||||||
|
//返回码
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
//返回消息
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
//返回数据
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public Result() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <T> Result<T> build(T data) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
if (data != null)
|
||||||
|
result.setData(data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> build(T body, ResultCodeEnum resultCodeEnum) {
|
||||||
|
Result<T> result = build(body);
|
||||||
|
result.setCode(resultCodeEnum.getCode());
|
||||||
|
result.setMessage(resultCodeEnum.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static <T> Result<T> ok(T data) {
|
||||||
|
return build(data, ResultCodeEnum.SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> ok() {
|
||||||
|
return Result.ok(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> fail() {
|
||||||
|
return build(null, ResultCodeEnum.FAIL);
|
||||||
|
}
|
||||||
|
public static <T> Result<T> fail(Integer code, String message) {
|
||||||
|
Result<T> result = build(null);
|
||||||
|
result.setCode(code);
|
||||||
|
result.setMessage(message);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.atguigu.lease.common.result;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一返回结果状态信息类
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum ResultCodeEnum {
|
||||||
|
|
||||||
|
SUCCESS(200, "成功"),
|
||||||
|
FAIL(201, "失败"),
|
||||||
|
PARAM_ERROR(202, "参数不正确"),
|
||||||
|
SERVICE_ERROR(203, "服务异常"),
|
||||||
|
DATA_ERROR(204, "数据异常"),
|
||||||
|
ILLEGAL_REQUEST(205, "非法请求"),
|
||||||
|
REPEAT_SUBMIT(206, "重复提交"),
|
||||||
|
DELETE_ERROR(207, "请先删除子集"),
|
||||||
|
|
||||||
|
ADMIN_ACCOUNT_EXIST_ERROR(301, "账号已存在"),
|
||||||
|
ADMIN_CAPTCHA_CODE_ERROR(302, "验证码错误"),
|
||||||
|
ADMIN_CAPTCHA_CODE_EXPIRED(303, "验证码已过期"),
|
||||||
|
ADMIN_CAPTCHA_CODE_NOT_FOUND(304, "未输入验证码"),
|
||||||
|
|
||||||
|
|
||||||
|
ADMIN_LOGIN_AUTH(305, "未登陆"),
|
||||||
|
ADMIN_ACCOUNT_NOT_EXIST_ERROR(306, "账号不存在"),
|
||||||
|
ADMIN_ACCOUNT_ERROR(307, "用户名或密码错误"),
|
||||||
|
ADMIN_ACCOUNT_DISABLED_ERROR(308, "该用户已被禁用"),
|
||||||
|
ADMIN_ACCESS_FORBIDDEN(309, "无访问权限"),
|
||||||
|
|
||||||
|
APP_LOGIN_AUTH(501, "未登陆"),
|
||||||
|
APP_LOGIN_PHONE_EMPTY(502, "手机号码为空"),
|
||||||
|
APP_LOGIN_CODE_EMPTY(503, "验证码为空"),
|
||||||
|
APP_SEND_SMS_TOO_OFTEN(504, "验证法发送过于频繁"),
|
||||||
|
APP_LOGIN_CODE_EXPIRED(505, "验证码已过期"),
|
||||||
|
APP_LOGIN_CODE_ERROR(506, "验证码错误"),
|
||||||
|
APP_ACCOUNT_DISABLED_ERROR(507, "该用户已被禁用"),
|
||||||
|
|
||||||
|
|
||||||
|
TOKEN_EXPIRED(601, "token过期"),
|
||||||
|
TOKEN_INVALID(602, "token非法");
|
||||||
|
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
ResultCodeEnum(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,311 @@
|
||||||
|
package com.atguigu.lease.common.utils;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.HttpDelete;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.client.methods.HttpPut;
|
||||||
|
import org.apache.http.conn.ClientConnectionManager;
|
||||||
|
import org.apache.http.conn.scheme.Scheme;
|
||||||
|
import org.apache.http.conn.scheme.SchemeRegistry;
|
||||||
|
import org.apache.http.conn.ssl.SSLSocketFactory;
|
||||||
|
import org.apache.http.entity.ByteArrayEntity;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.DefaultHttpClient;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.security.KeyManagementException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class HttpUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doGet(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpGet request = new HttpGet(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* post form
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @param bodys
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doPost(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys,
|
||||||
|
Map<String, String> bodys)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpPost request = new HttpPost(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bodys != null) {
|
||||||
|
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
|
||||||
|
|
||||||
|
for (String key : bodys.keySet()) {
|
||||||
|
nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
|
||||||
|
}
|
||||||
|
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
|
||||||
|
formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
|
||||||
|
request.setEntity(formEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Post String
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doPost(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys,
|
||||||
|
String body)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpPost request = new HttpPost(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(body)) {
|
||||||
|
request.setEntity(new StringEntity(body, "utf-8"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Post stream
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doPost(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys,
|
||||||
|
byte[] body)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpPost request = new HttpPost(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body != null) {
|
||||||
|
request.setEntity(new ByteArrayEntity(body));
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put String
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doPut(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys,
|
||||||
|
String body)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpPut request = new HttpPut(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(body)) {
|
||||||
|
request.setEntity(new StringEntity(body, "utf-8"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put stream
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doPut(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys,
|
||||||
|
byte[] body)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpPut request = new HttpPut(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body != null) {
|
||||||
|
request.setEntity(new ByteArrayEntity(body));
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* @param path
|
||||||
|
* @param method
|
||||||
|
* @param headers
|
||||||
|
* @param querys
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static HttpResponse doDelete(String host, String path, String method,
|
||||||
|
Map<String, String> headers,
|
||||||
|
Map<String, String> querys)
|
||||||
|
throws Exception {
|
||||||
|
HttpClient httpClient = wrapClient(host);
|
||||||
|
|
||||||
|
HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
|
||||||
|
for (Map.Entry<String, String> e : headers.entrySet()) {
|
||||||
|
request.addHeader(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient.execute(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
|
||||||
|
StringBuilder sbUrl = new StringBuilder();
|
||||||
|
sbUrl.append(host);
|
||||||
|
if (!StringUtils.isBlank(path)) {
|
||||||
|
sbUrl.append(path);
|
||||||
|
}
|
||||||
|
if (null != querys) {
|
||||||
|
StringBuilder sbQuery = new StringBuilder();
|
||||||
|
for (Map.Entry<String, String> query : querys.entrySet()) {
|
||||||
|
if (0 < sbQuery.length()) {
|
||||||
|
sbQuery.append("&");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
|
||||||
|
sbQuery.append(query.getValue());
|
||||||
|
}
|
||||||
|
if (!StringUtils.isBlank(query.getKey())) {
|
||||||
|
sbQuery.append(query.getKey());
|
||||||
|
if (!StringUtils.isBlank(query.getValue())) {
|
||||||
|
sbQuery.append("=");
|
||||||
|
sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (0 < sbQuery.length()) {
|
||||||
|
sbUrl.append("?").append(sbQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sbUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static HttpClient wrapClient(String host) {
|
||||||
|
HttpClient httpClient = new DefaultHttpClient();
|
||||||
|
if (host.startsWith("https://")) {
|
||||||
|
sslClient(httpClient);
|
||||||
|
}
|
||||||
|
|
||||||
|
return httpClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sslClient(HttpClient httpClient) {
|
||||||
|
try {
|
||||||
|
SSLContext ctx = SSLContext.getInstance("TLS");
|
||||||
|
X509TrustManager tm = new X509TrustManager() {
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public void checkClientTrusted(X509Certificate[] xcs, String str) {
|
||||||
|
|
||||||
|
}
|
||||||
|
public void checkServerTrusted(X509Certificate[] xcs, String str) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ctx.init(null, new TrustManager[] { tm }, null);
|
||||||
|
SSLSocketFactory ssf = new SSLSocketFactory(ctx);
|
||||||
|
ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
|
||||||
|
ClientConnectionManager ccm = httpClient.getConnectionManager();
|
||||||
|
SchemeRegistry registry = ccm.getSchemeRegistry();
|
||||||
|
registry.register(new Scheme("https", 443, ssf));
|
||||||
|
} catch (KeyManagementException ex) {
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
} catch (NoSuchAlgorithmException ex) {
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.atguigu.lease.common.utils;
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.ResultCodeEnum;
|
||||||
|
import io.jsonwebtoken.*;
|
||||||
|
import io.jsonwebtoken.security.Keys;
|
||||||
|
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class JwtUtil {
|
||||||
|
|
||||||
|
//token过期时间固定值
|
||||||
|
private static long tokenExpiration = 60 * 60 * 1000L;
|
||||||
|
|
||||||
|
//加密秘钥
|
||||||
|
private static SecretKey tokenSignKey =
|
||||||
|
Keys.hmacShaKeyFor("M0PKKI6pYGVWWfDZw90a0lTpGYX1d4AQ".getBytes());
|
||||||
|
|
||||||
|
//生成token方法,参数用户id和用户名称
|
||||||
|
public static String createToken(Long userId, String username) {
|
||||||
|
String token = Jwts.builder().
|
||||||
|
//设置分类
|
||||||
|
setSubject("USER_INFO").
|
||||||
|
//设置生成token过期时间
|
||||||
|
setExpiration(new Date(System.currentTimeMillis() + tokenExpiration)).
|
||||||
|
//jwt负载内容,设置用户信息到token
|
||||||
|
claim("userId", userId).
|
||||||
|
claim("username", username).
|
||||||
|
//根据秘钥进行加密
|
||||||
|
signWith(tokenSignKey).
|
||||||
|
//把生成token压缩
|
||||||
|
compressWith(CompressionCodecs.GZIP).
|
||||||
|
compact();
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验jwttoken,从token获取数据
|
||||||
|
public static Claims parseToken(String token) {
|
||||||
|
try {
|
||||||
|
Jws<Claims> claimsJws = Jwts.parserBuilder().
|
||||||
|
//设置解密密钥
|
||||||
|
setSigningKey(tokenSignKey).
|
||||||
|
//从解密字符串获取设置负载数据
|
||||||
|
build().parseClaimsJws(token);
|
||||||
|
return claimsJws.getBody();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
//1 生成token
|
||||||
|
String token = JwtUtil.createToken(9l, "lucy");
|
||||||
|
System.out.println(token);
|
||||||
|
|
||||||
|
//2 解析token
|
||||||
|
Claims claims = JwtUtil.parseToken(token);
|
||||||
|
Object username = claims.get("username");
|
||||||
|
Object userId = claims.get("userId");
|
||||||
|
System.out.println(userId+" :: "+username);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.atguigu.lease.common.utils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LoginUser {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private String username;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.atguigu.lease.common.utils;
|
||||||
|
|
||||||
|
public class LoginUserContext {
|
||||||
|
|
||||||
|
private static final ThreadLocal<LoginUser> userThreadLocal = new ThreadLocal<>();
|
||||||
|
|
||||||
|
//放
|
||||||
|
public static void setLoginUser(LoginUser loginUser) {
|
||||||
|
userThreadLocal.set(loginUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取
|
||||||
|
public static LoginUser getLoginUser() {
|
||||||
|
return userThreadLocal.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
//清除
|
||||||
|
public static void clear() {
|
||||||
|
userThreadLocal.remove();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.atguigu.lease.common.utils;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class VerifyCodeUtil {
|
||||||
|
public static String getVerifyCode(int length) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
Random random = new Random();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
builder.append(random.nextInt(10));
|
||||||
|
}
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>lease</artifactId>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>model</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!--mybatis-plus-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||||
|
<version>4.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "公寓&配套关系")
|
||||||
|
@TableName(value = "apartment_facility")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class ApartmentFacility extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "公寓id")
|
||||||
|
@TableField(value = "apartment_id")
|
||||||
|
private Long apartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "设施id")
|
||||||
|
@TableField(value = "facility_id")
|
||||||
|
private Long facilityId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "公寓&杂费关联表")
|
||||||
|
@TableName(value = "apartment_fee_value")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class ApartmentFeeValue extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "公寓id")
|
||||||
|
@TableField(value = "apartment_id")
|
||||||
|
private Long apartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "收费项value_id")
|
||||||
|
@TableField(value = "fee_value_id")
|
||||||
|
private Long feeValueId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.ReleaseStatus;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "公寓信息表")
|
||||||
|
@TableName(value = "apartment_info")
|
||||||
|
@Data
|
||||||
|
public class ApartmentInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "公寓名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公寓介绍")
|
||||||
|
@TableField(value = "introduction")
|
||||||
|
private String introduction;
|
||||||
|
|
||||||
|
@Schema(description = "所处区域id")
|
||||||
|
@TableField(value = "district_id")
|
||||||
|
private Long districtId;
|
||||||
|
|
||||||
|
@Schema(description = "所处区域名称")
|
||||||
|
@TableField(value = "district_name")
|
||||||
|
private String districtName;
|
||||||
|
|
||||||
|
@Schema(description = "所处城市id")
|
||||||
|
@TableField(value = "city_id")
|
||||||
|
private Long cityId;
|
||||||
|
|
||||||
|
@Schema(description = "所处城市名称")
|
||||||
|
@TableField(value = "city_name")
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
@Schema(description = "所处省份id")
|
||||||
|
@TableField(value = "province_id")
|
||||||
|
private Long provinceId;
|
||||||
|
|
||||||
|
@Schema(description = "所处区域名称")
|
||||||
|
@TableField(value = "province_name")
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
@Schema(description = "详细地址")
|
||||||
|
@TableField(value = "address_detail")
|
||||||
|
private String addressDetail;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
@TableField(value = "latitude")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
@TableField(value = "longitude")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@Schema(description = "公寓前台电话")
|
||||||
|
@TableField(value = "phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "是否发布")
|
||||||
|
@TableField(value = "is_release")
|
||||||
|
private ReleaseStatus isRelease;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "公寓标签关联表")
|
||||||
|
@TableName(value = "apartment_label")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class ApartmentLabel extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "公寓id")
|
||||||
|
@TableField(value = "apartment_id")
|
||||||
|
private Long apartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "标签id")
|
||||||
|
@TableField(value = "label_id")
|
||||||
|
private Long labelId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "房间基本属性表")
|
||||||
|
@TableName(value = "attr_key")
|
||||||
|
@Data
|
||||||
|
public class AttrKey extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "属性key")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "房间基本属性值表")
|
||||||
|
@TableName(value = "attr_value")
|
||||||
|
@Data
|
||||||
|
public class AttrValue extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "属性value")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "对应的属性key_id")
|
||||||
|
@TableField(value = "attr_key_id")
|
||||||
|
private Long attrKeyId;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Schema(description = "主键")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@TableField(value = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@TableField(value = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "逻辑删除")
|
||||||
|
@TableField("is_deleted")
|
||||||
|
private Byte isDeleted;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @TableName browsing_history
|
||||||
|
*/
|
||||||
|
@TableName(value = "browsing_history")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class BrowsingHistory extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
@TableField("user_id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "房间id")
|
||||||
|
@TableField("room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "浏览时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@TableField("browse_time")
|
||||||
|
private Date browseTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "城市信息表")
|
||||||
|
@TableName(value = "city_info")
|
||||||
|
@Data
|
||||||
|
public class CityInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "城市名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "所属省份id")
|
||||||
|
@TableField(value = "province_id")
|
||||||
|
private Integer provinceId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "地区信息表")
|
||||||
|
@TableName(value = "district_info")
|
||||||
|
@Data
|
||||||
|
public class DistrictInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "区域名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "所属城市id")
|
||||||
|
@TableField(value = "city_id")
|
||||||
|
private Integer cityId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "配套信息表")
|
||||||
|
@TableName(value = "facility_info")
|
||||||
|
@Data
|
||||||
|
public class FacilityInfo extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "配套所属对象类型")
|
||||||
|
@TableField(value = "type")
|
||||||
|
private ItemType type;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "图标")
|
||||||
|
@TableField(value = "icon")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@Schema(description = "逻辑删除")
|
||||||
|
@TableField("is_deleted")
|
||||||
|
@TableLogic
|
||||||
|
private Byte isDeleted;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "杂项费用名称表")
|
||||||
|
@TableName(value = "fee_key")
|
||||||
|
@Data
|
||||||
|
public class FeeKey extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "付款项key")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "杂项费用值表")
|
||||||
|
@TableName(value = "fee_value")
|
||||||
|
@Data
|
||||||
|
public class FeeValue extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "费用value")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "收费单位")
|
||||||
|
@TableField(value = "unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "费用所对的fee_key编码")
|
||||||
|
@TableField(value = "fee_key_id")
|
||||||
|
private Long feeKeyId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Schema(description = "图片信息表")
|
||||||
|
@TableName(value = "graph_info")
|
||||||
|
@Data
|
||||||
|
public class GraphInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "图片名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "图片所属对象类型")
|
||||||
|
@TableField(value = "item_type")
|
||||||
|
private ItemType itemType;
|
||||||
|
|
||||||
|
@Schema(description = "图片所有对象id")
|
||||||
|
@TableField(value = "item_id")
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
|
@Schema(description = "图片地址")
|
||||||
|
@TableField(value = "url")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "标签信息表")
|
||||||
|
@TableName(value = "label_info")
|
||||||
|
@Data
|
||||||
|
public class LabelInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "类型")
|
||||||
|
@TableField(value = "type")
|
||||||
|
private ItemType type;
|
||||||
|
|
||||||
|
@Schema(description = "标签名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "逻辑删除")
|
||||||
|
@TableField("is_deleted")
|
||||||
|
@TableLogic
|
||||||
|
private Byte isDeleted;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.atguigu.lease.model.enums.LeaseSourceType;
|
||||||
|
import com.atguigu.lease.model.enums.LeaseStatus;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Schema(description = "租约信息表")
|
||||||
|
@TableName(value = "lease_agreement")
|
||||||
|
@Data
|
||||||
|
public class LeaseAgreement extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "承租人手机号码")
|
||||||
|
@TableField(value = "phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "承租人姓名")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "承租人身份证号码")
|
||||||
|
@TableField(value = "identification_number")
|
||||||
|
private String identificationNumber;
|
||||||
|
|
||||||
|
@Schema(description = "签约公寓id")
|
||||||
|
@TableField(value = "apartment_id")
|
||||||
|
private Long apartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "签约房间id")
|
||||||
|
@TableField(value = "room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "租约开始日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@TableField(value = "lease_start_date")
|
||||||
|
private Date leaseStartDate;
|
||||||
|
|
||||||
|
@Schema(description = "租约结束日期")
|
||||||
|
@TableField(value = "lease_end_date")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date leaseEndDate;
|
||||||
|
|
||||||
|
@Schema(description = "租期id")
|
||||||
|
@TableField(value = "lease_term_id")
|
||||||
|
private Long leaseTermId;
|
||||||
|
|
||||||
|
@Schema(description = "租金(元/月)")
|
||||||
|
@TableField(value = "rent")
|
||||||
|
private BigDecimal rent;
|
||||||
|
|
||||||
|
@Schema(description = "押金(元)")
|
||||||
|
@TableField(value = "deposit")
|
||||||
|
private BigDecimal deposit;
|
||||||
|
|
||||||
|
@Schema(description = "支付类型id")
|
||||||
|
@TableField(value = "payment_type_id")
|
||||||
|
private Long paymentTypeId;
|
||||||
|
|
||||||
|
@Schema(description = "租约状态")
|
||||||
|
@TableField(value = "status")
|
||||||
|
private LeaseStatus status;
|
||||||
|
|
||||||
|
@Schema(description = "租约来源")
|
||||||
|
@TableField(value = "source_type")
|
||||||
|
private LeaseSourceType sourceType;
|
||||||
|
|
||||||
|
@Schema(description = "备注信息")
|
||||||
|
@TableField(value = "additional_info")
|
||||||
|
private String additionalInfo;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @TableName lease_term
|
||||||
|
*/
|
||||||
|
@TableName(value = "lease_term")
|
||||||
|
@Data
|
||||||
|
@Schema(description = "租期信息")
|
||||||
|
public class LeaseTerm extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "租期月数")
|
||||||
|
@TableField("month_count")
|
||||||
|
private Integer monthCount;
|
||||||
|
|
||||||
|
@Schema(description = "租期单位:月")
|
||||||
|
@TableField("unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "逻辑删除")
|
||||||
|
@TableField("is_deleted")
|
||||||
|
@TableLogic
|
||||||
|
private Byte isDeleted;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "支付方式表")
|
||||||
|
@TableName(value = "payment_type")
|
||||||
|
@Data
|
||||||
|
public class PaymentType extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "付款方式名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "每次支付租期数")
|
||||||
|
@TableField(value = "pay_month_count")
|
||||||
|
private String payMonthCount;
|
||||||
|
|
||||||
|
@Schema(description = "付费说明")
|
||||||
|
@TableField(value = "additional_info")
|
||||||
|
private String additionalInfo;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除")
|
||||||
|
@TableField(value = "is_deleted")
|
||||||
|
@TableLogic
|
||||||
|
private Byte isDeleted;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "省份信息表")
|
||||||
|
@TableName(value = "province_info")
|
||||||
|
@Data
|
||||||
|
public class ProvinceInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "省份名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "房间&基本属性值关联表")
|
||||||
|
@TableName(value = "room_attr_value")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class RoomAttrValue extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "房间id")
|
||||||
|
@TableField(value = "room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "属性值id")
|
||||||
|
@TableField(value = "attr_value_id")
|
||||||
|
private Long attrValueId;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "房间&配套关联表")
|
||||||
|
@TableName(value = "room_facility")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class RoomFacility extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "房间id")
|
||||||
|
@TableField(value = "room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "房间设施id")
|
||||||
|
@TableField(value = "facility_id")
|
||||||
|
private Long facilityId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.ReleaseStatus;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "房间信息表")
|
||||||
|
@TableName(value = "room_info")
|
||||||
|
@Data
|
||||||
|
public class RoomInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "房间号")
|
||||||
|
@TableField(value = "room_number")
|
||||||
|
private String roomNumber;
|
||||||
|
|
||||||
|
@Schema(description = "租金(元/月)")
|
||||||
|
@TableField(value = "rent")
|
||||||
|
private BigDecimal rent;
|
||||||
|
|
||||||
|
@Schema(description = "所属公寓id")
|
||||||
|
@TableField(value = "apartment_id")
|
||||||
|
private Long apartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "是否发布")
|
||||||
|
@TableField(value = "is_release")
|
||||||
|
private ReleaseStatus isRelease;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "房间&标签关联表")
|
||||||
|
@TableName(value = "room_label")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class RoomLabel extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "房间id")
|
||||||
|
@TableField(value = "room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "标签id")
|
||||||
|
@TableField(value = "label_id")
|
||||||
|
private Long labelId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @TableName room_lease_term
|
||||||
|
*/
|
||||||
|
@TableName(value = "room_lease_term")
|
||||||
|
@Data
|
||||||
|
@Schema(description = "房间租期关系表")
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class RoomLeaseTerm extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "房间id")
|
||||||
|
@TableField("room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "租期id")
|
||||||
|
@TableField("lease_term_id")
|
||||||
|
private Long leaseTermId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "房间&支付方式关联表")
|
||||||
|
@TableName(value = "room_payment_type")
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class RoomPaymentType extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "房间id")
|
||||||
|
@TableField(value = "room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
@Schema(description = "支付类型id")
|
||||||
|
@TableField(value = "payment_type_id")
|
||||||
|
private Long paymentTypeId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.BaseStatus;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位信息表
|
||||||
|
*
|
||||||
|
* @TableName system_post
|
||||||
|
*/
|
||||||
|
@TableName(value = "system_post")
|
||||||
|
@Data
|
||||||
|
public class SystemPost extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "岗位编码")
|
||||||
|
@TableField(value = "code")
|
||||||
|
private String postCode;
|
||||||
|
|
||||||
|
@Schema(description = "岗位名称")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "岗位描述信息")
|
||||||
|
@TableField(value = "description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "岗位状态")
|
||||||
|
@TableField(value = "status")
|
||||||
|
private BaseStatus status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.BaseStatus;
|
||||||
|
import com.atguigu.lease.model.enums.SystemUserType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "员工信息")
|
||||||
|
@TableName(value = "system_user")
|
||||||
|
@Data
|
||||||
|
public class SystemUser extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "用户名")
|
||||||
|
@TableField(value = "username")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@Schema(description = "密码")
|
||||||
|
@TableField(value = "password")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Schema(description = "姓名")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "用户类型")
|
||||||
|
@TableField(value = "type")
|
||||||
|
private SystemUserType type;
|
||||||
|
|
||||||
|
@Schema(description = "手机号码")
|
||||||
|
@TableField(value = "phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "头像地址")
|
||||||
|
@TableField(value = "avatar_url")
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@Schema(description = "备注信息")
|
||||||
|
@TableField(value = "additional_info")
|
||||||
|
private String additionalInfo;
|
||||||
|
|
||||||
|
@Schema(description = "岗位id")
|
||||||
|
@TableField(value = "post_id")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@Schema(description = "账号状态")
|
||||||
|
@TableField(value = "status")
|
||||||
|
private BaseStatus status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.BaseStatus;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Schema(description = "用户信息表")
|
||||||
|
@TableName(value = "user_info")
|
||||||
|
@Data
|
||||||
|
public class UserInfo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "手机号码(用做登录用户名)")
|
||||||
|
@TableField(value = "phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "密码")
|
||||||
|
@TableField(value = "password")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Schema(description = "头像url")
|
||||||
|
@TableField(value = "avatar_url")
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@Schema(description = "昵称")
|
||||||
|
@TableField(value = "nickname")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "账号状态")
|
||||||
|
@TableField(value = "status")
|
||||||
|
private BaseStatus status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.atguigu.lease.model.entity;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.AppointmentStatus;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Schema(description = "预约看房信息表")
|
||||||
|
@TableName(value = "view_appointment")
|
||||||
|
@Data
|
||||||
|
public class ViewAppointment extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
@TableField(value = "user_id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "用户姓名")
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "用户手机号码")
|
||||||
|
@TableField(value = "phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "公寓id")
|
||||||
|
@TableField(value = "apartment_id")
|
||||||
|
private Long apartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "预约时间")
|
||||||
|
@TableField(value = "appointment_time")
|
||||||
|
private Date appointmentTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注信息")
|
||||||
|
@TableField(value = "additional_info")
|
||||||
|
private String additionalInfo;
|
||||||
|
|
||||||
|
@Schema(description = "预约状态")
|
||||||
|
@TableField(value = "appointment_status")
|
||||||
|
private AppointmentStatus appointmentStatus;
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
public enum AppointmentStatus implements BaseEnum {
|
||||||
|
|
||||||
|
|
||||||
|
WAITING(1, "待看房"),
|
||||||
|
|
||||||
|
CANCELED(2, "已取消"),
|
||||||
|
|
||||||
|
VIEWED(3, "已看房");
|
||||||
|
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
AppointmentStatus(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
public interface BaseEnum {
|
||||||
|
|
||||||
|
Integer getCode();
|
||||||
|
|
||||||
|
String getName();
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
|
||||||
|
public enum BaseStatus implements BaseEnum {
|
||||||
|
|
||||||
|
|
||||||
|
ENABLE(1, "正常"),
|
||||||
|
|
||||||
|
DISABLE(0, "禁用");
|
||||||
|
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
BaseStatus(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public enum ItemType implements BaseEnum {
|
||||||
|
|
||||||
|
APARTMENT(1, "公寓"),
|
||||||
|
|
||||||
|
ROOM(2, "房间");
|
||||||
|
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue
|
||||||
|
private Integer code;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemType(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
|
||||||
|
public enum LeaseSourceType implements BaseEnum {
|
||||||
|
|
||||||
|
NEW(1, "新签"),
|
||||||
|
RENEW(2, "续约");
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
|
@EnumValue
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
LeaseSourceType(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
public enum LeaseStatus implements BaseEnum {
|
||||||
|
|
||||||
|
SIGNING(1, "签约待确认"),
|
||||||
|
SIGNED(2, "已签约"),
|
||||||
|
CANCELED(3, "已取消"),
|
||||||
|
EXPIRED(4, "已到期"),
|
||||||
|
WITHDRAWING(5, "退租待确认"),
|
||||||
|
WITHDRAWN(6, "已退租"),
|
||||||
|
RENEWING(7, "续约待确认");
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
LeaseStatus(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
public enum ReleaseStatus implements BaseEnum {
|
||||||
|
|
||||||
|
RELEASED(1, "已发布"),
|
||||||
|
NOT_RELEASED(0, "未发布");
|
||||||
|
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
ReleaseStatus(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atguigu.lease.model.enums;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
public enum SystemUserType implements BaseEnum {
|
||||||
|
|
||||||
|
ADMIN(0, "管理员"),
|
||||||
|
COMMON(1, "普通用户");
|
||||||
|
|
||||||
|
@EnumValue
|
||||||
|
@JsonValue
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
SystemUserType(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,112 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>3.0.5</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<artifactId>lease</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<modules>
|
||||||
|
<module>common</module>
|
||||||
|
<module>model</module>
|
||||||
|
<module>web</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
||||||
|
<swagger.version>2.9.2</swagger.version>
|
||||||
|
<jwt.version>0.11.2</jwt.version>
|
||||||
|
<easycaptcha.version>1.6.2</easycaptcha.version>
|
||||||
|
<minio.version>8.2.0</minio.version>
|
||||||
|
<knife4j.version>4.1.0</knife4j.version>
|
||||||
|
<aliyun.sms.version>2.0.23</aliyun.sms.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<!--配置dependencyManagement统一管理依赖版本-->
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<!--mybatis-plus-->
|
||||||
|
<!--官方文档:https://baomidou.com/pages/bab2db/ -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>${mybatis-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--knife4j文档-->
|
||||||
|
<!--官方文档:https://doc.xiaominfo.com/docs/quick-start -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||||
|
<version>${knife4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--JWT登录认证相关-->
|
||||||
|
<!--官方文档:https://github.com/jwtk/jjwt#install-jdk-maven -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>${jwt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<version>${jwt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<version>${jwt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--图形验证码-->
|
||||||
|
<!--官方文档:https://gitee.com/ele-admin/EasyCaptcha -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
<version>${easycaptcha.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--对象存储,用于存储图像等非结构化数据-->
|
||||||
|
<!--官方文档:https://min.io/docs/minio/linux/developers/minio-drivers.html?ref=docs#java-sdk -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.minio</groupId>
|
||||||
|
<artifactId>minio</artifactId>
|
||||||
|
<version>${minio.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--阿里云短信客户端,用于发送短信验证码-->
|
||||||
|
<!--官方文档:https://help.aliyun.com/document_detail/215759.html?spm=a2c4g.215759.0.0.49f32807f4Yc0y -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>dysmsapi20170525</artifactId>
|
||||||
|
<version>${aliyun.sms.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||||
|
<version>4.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.minio</groupId>
|
||||||
|
<artifactId>minio</artifactId>
|
||||||
|
<version>8.5.3</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,59 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>lease</artifactId>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>web</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>web-admin</module>
|
||||||
|
<module>web-app</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--包含spring web相关依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--包含spring test相关依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--mysql驱动-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>web</artifactId>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>web-admin</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.atguigu.lease;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
public class AdminWebApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(AdminWebApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.ApartmentInfo;
|
||||||
|
import com.atguigu.lease.model.enums.ReleaseStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.ApartmentInfoService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.apartment.ApartmentDetailVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.apartment.ApartmentItemVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.apartment.ApartmentQueryVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.apartment.ApartmentSubmitVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "公寓信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/apartment")
|
||||||
|
public class ApartmentController {
|
||||||
|
@Autowired
|
||||||
|
private ApartmentInfoService apartmentInfoService;
|
||||||
|
@Operation(summary = "保存或更新公寓信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdate(@RequestBody ApartmentSubmitVo apartmentSubmitVo) {
|
||||||
|
apartmentInfoService.saveOrUpdateApartment(apartmentSubmitVo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据条件分页查询公寓列表")
|
||||||
|
@GetMapping("pageItem")
|
||||||
|
public Result<IPage<ApartmentItemVo>> pageItem(@RequestParam long current, @RequestParam long size, ApartmentQueryVo queryVo) {
|
||||||
|
Page<ApartmentItemVo> page = new Page<>(current,size);
|
||||||
|
IPage<ApartmentItemVo> pageModel =
|
||||||
|
apartmentInfoService.selectApartmentInfoPage(page,queryVo);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID获取公寓详细信息")
|
||||||
|
@GetMapping("getDetailById")
|
||||||
|
public Result<ApartmentDetailVo> getDetailById(@RequestParam Long id) {
|
||||||
|
ApartmentDetailVo detailById = apartmentInfoService.getDetailById(id);
|
||||||
|
return Result.ok(detailById);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除公寓信息")
|
||||||
|
@DeleteMapping("removeById")
|
||||||
|
public Result removeById(@RequestParam Long id) {
|
||||||
|
apartmentInfoService.removeApartmentById(id);
|
||||||
|
return Result.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id修改公寓发布状态")
|
||||||
|
@PostMapping("updateReleaseStatusById")
|
||||||
|
public Result updateReleaseStatusById(@RequestParam Long id, @RequestParam ReleaseStatus status) {
|
||||||
|
ApartmentInfo byId = apartmentInfoService.getById(id);
|
||||||
|
byId.setIsRelease(status);
|
||||||
|
apartmentInfoService.updateById(byId);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据区县id查询公寓信息列表")
|
||||||
|
@GetMapping("listInfoByDistrictId")
|
||||||
|
public Result<List<ApartmentInfo>> listInfoByDistrictId(@RequestParam Long id) {
|
||||||
|
LambdaQueryWrapper<ApartmentInfo> query = new LambdaQueryWrapper<>();
|
||||||
|
query.eq(ApartmentInfo::getDistrictId,id);
|
||||||
|
List<ApartmentInfo> list = apartmentInfoService.list(query);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.AttrKey;
|
||||||
|
import com.atguigu.lease.model.entity.AttrValue;
|
||||||
|
import com.atguigu.lease.web.admin.service.AttrKeyService;
|
||||||
|
import com.atguigu.lease.web.admin.service.AttrValueService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.attr.AttrKeyVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "房间属性管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/attr")
|
||||||
|
public class AttrController {
|
||||||
|
@Autowired
|
||||||
|
private AttrKeyService attrKeyService;
|
||||||
|
@Autowired
|
||||||
|
private AttrValueService attrValueService;
|
||||||
|
@Operation(summary = "新增或更新属性名称")
|
||||||
|
@PostMapping("key/saveOrUpdate")
|
||||||
|
public Result saveOrUpdateAttrKey(@RequestBody AttrKey attrKey) {
|
||||||
|
attrKeyService.saveOrUpdate(attrKey);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增或更新属性值")
|
||||||
|
@PostMapping("value/saveOrUpdate")
|
||||||
|
public Result saveOrUpdateAttrValue(@RequestBody AttrValue attrValue) {
|
||||||
|
attrValueService.saveOrUpdate(attrValue);
|
||||||
|
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部属性名称和属性值列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<AttrKeyVo>> listAttrInfo() {
|
||||||
|
List<AttrKeyVo> attrKeyVos = attrKeyService.listAttrInfo();
|
||||||
|
return Result.ok(attrKeyVos);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除属性名称")
|
||||||
|
@DeleteMapping("key/deleteById")
|
||||||
|
public Result removeAttrKeyById(@RequestParam Long attrKeyId) {
|
||||||
|
LambdaQueryWrapper<AttrValue> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(AttrValue::getAttrKeyId,attrKeyId);
|
||||||
|
attrValueService.remove(wrapper);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除属性值")
|
||||||
|
@DeleteMapping("value/deleteById")
|
||||||
|
public Result removeAttrValueById(@RequestParam Long id) {
|
||||||
|
attrValueService.removeById(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.FacilityInfo;
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.atguigu.lease.web.admin.service.FacilityInfoService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "配套管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/facility")
|
||||||
|
public class FacilityController {
|
||||||
|
@Autowired
|
||||||
|
private FacilityInfoService facilityInfoService;
|
||||||
|
@Operation(summary = "[根据类型]查询配套信息列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<FacilityInfo>> listFacility(@RequestParam(required = false) ItemType type) {
|
||||||
|
LambdaQueryWrapper<FacilityInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
LambdaQueryWrapper<FacilityInfo> eq = queryWrapper.eq(FacilityInfo::getType, type);
|
||||||
|
List<FacilityInfo> list = facilityInfoService.list(eq);
|
||||||
|
return Result.ok(list);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增或修改配套信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdate(@RequestBody FacilityInfo facilityInfo) {
|
||||||
|
boolean b = facilityInfoService.saveOrUpdate(facilityInfo);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除配套信息")
|
||||||
|
@DeleteMapping("deleteById")
|
||||||
|
public Result removeFacilityById(@RequestParam Long id) {
|
||||||
|
boolean b = facilityInfoService.removeById(id);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.FeeKey;
|
||||||
|
import com.atguigu.lease.model.entity.FeeValue;
|
||||||
|
|
||||||
|
import com.atguigu.lease.web.admin.service.FeeKeyService;
|
||||||
|
import com.atguigu.lease.web.admin.service.FeeValueService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.fee.FeeKeyVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "房间杂费管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/fee")
|
||||||
|
public class FeeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FeeKeyService feeKeyService;
|
||||||
|
@Autowired
|
||||||
|
private FeeValueService feeValueService;
|
||||||
|
|
||||||
|
@Operation(summary = "保存或更新杂费名称")
|
||||||
|
@PostMapping("key/saveOrUpdate")
|
||||||
|
public Result saveOrUpdateFeeKey(@RequestBody FeeKey feeKey) {
|
||||||
|
feeKeyService.saveOrUpdate(feeKey);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "保存或更新杂费值")
|
||||||
|
@PostMapping("value/saveOrUpdate")
|
||||||
|
public Result saveOrUpdateFeeValue(@RequestBody FeeValue feeValue) {
|
||||||
|
feeValueService.saveOrUpdate(feeValue);
|
||||||
|
return Result.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询全部杂费名称和杂费值列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<FeeKeyVo>> feeInfoList() {
|
||||||
|
List<FeeKeyVo> feeKeyVos = feeKeyService.saveOrUpdateFeeKey();
|
||||||
|
return Result.ok(feeKeyVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除杂费名称")
|
||||||
|
@DeleteMapping("key/deleteById")
|
||||||
|
public Result deleteFeeKeyById(@RequestParam Long feeKeyId) {
|
||||||
|
LambdaQueryWrapper<FeeKey> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(FeeKey::getId, feeKeyId);
|
||||||
|
feeKeyService.remove(wrapper);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除杂费值")
|
||||||
|
@DeleteMapping("value/deleteById")
|
||||||
|
public Result deleteFeeValueById(@RequestParam Long id) {
|
||||||
|
boolean b = feeValueService.removeById(id);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.web.admin.service.FileService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "文件管理")
|
||||||
|
@RequestMapping("/admin/file")
|
||||||
|
@RestController
|
||||||
|
public class FileUploadController {
|
||||||
|
@Autowired
|
||||||
|
private FileService fileService;
|
||||||
|
@Operation(summary = "上传文件")
|
||||||
|
@PostMapping("upload")
|
||||||
|
public Result<String> upload(@RequestParam MultipartFile file) {
|
||||||
|
String url = fileService.upload(file);
|
||||||
|
return Result.ok(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.LabelInfo;
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.atguigu.lease.web.admin.service.LabelInfoService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "标签管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/label")
|
||||||
|
public class LabelController {
|
||||||
|
@Autowired
|
||||||
|
private LabelInfoService labelInfoService;
|
||||||
|
|
||||||
|
@Operation(summary = "(根据类型)查询标签列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<LabelInfo>> labelList(@RequestParam(required = false) ItemType itemType) {
|
||||||
|
LambdaQueryWrapper<LabelInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(LabelInfo::getType,itemType);
|
||||||
|
List<LabelInfo> list = labelInfoService.list(queryWrapper);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增或修改标签信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdateLabel(@RequestBody LabelInfo labelInfo) {
|
||||||
|
boolean b = labelInfoService.saveOrUpdate(labelInfo);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除标签信息")
|
||||||
|
@DeleteMapping("deleteById")
|
||||||
|
public Result deleteLabelById(@RequestParam Long id) {
|
||||||
|
boolean b = labelInfoService.removeById(id);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.LeaseTerm;
|
||||||
|
import com.atguigu.lease.web.admin.service.LeaseTermService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "租期管理")
|
||||||
|
@RequestMapping("/admin/term")
|
||||||
|
@RestController
|
||||||
|
public class LeaseTermController {
|
||||||
|
@Autowired
|
||||||
|
private LeaseTermService leaseTermService;
|
||||||
|
@GetMapping("list")
|
||||||
|
@Operation(summary = "查询全部租期列表")
|
||||||
|
public Result<List<LeaseTerm>> listLeaseTerm() {
|
||||||
|
List<LeaseTerm> list = leaseTermService.list();
|
||||||
|
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
@Operation(summary = "保存或更新租期信息")
|
||||||
|
public Result saveOrUpdate(@RequestBody LeaseTerm leaseTerm) {
|
||||||
|
boolean b = leaseTermService.saveOrUpdate(leaseTerm);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("deleteById")
|
||||||
|
@Operation(summary = "根据ID删除租期")
|
||||||
|
public Result deleteLeaseTermById(@RequestParam Long id) {
|
||||||
|
boolean b = leaseTermService.removeById(id);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.PaymentType;
|
||||||
|
import com.atguigu.lease.web.admin.service.PaymentTypeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "支付方式管理")
|
||||||
|
@RequestMapping("/admin/payment")
|
||||||
|
@RestController
|
||||||
|
public class PaymentTypeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PaymentTypeService paymentTypeService;
|
||||||
|
@Operation(summary = "查询全部支付方式列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<PaymentType>> listPaymentType() {
|
||||||
|
List<PaymentType> list = paymentTypeService.list();
|
||||||
|
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "保存或更新支付方式")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdatePaymentType(@RequestBody PaymentType paymentType) {
|
||||||
|
boolean b = paymentTypeService.saveOrUpdate(paymentType);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID删除支付方式")
|
||||||
|
@DeleteMapping("deleteById")
|
||||||
|
public Result deletePaymentById(@RequestParam Long id) {
|
||||||
|
boolean b = paymentTypeService.removeById(id);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
return Result.fail();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.CityInfo;
|
||||||
|
import com.atguigu.lease.model.entity.DistrictInfo;
|
||||||
|
import com.atguigu.lease.model.entity.ProvinceInfo;
|
||||||
|
import com.atguigu.lease.web.admin.service.CityInfoService;
|
||||||
|
import com.atguigu.lease.web.admin.service.DistrictInfoService;
|
||||||
|
import com.atguigu.lease.web.admin.service.ProvinceInfoService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "地区信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/region")
|
||||||
|
public class RegionInfoController {
|
||||||
|
@Autowired
|
||||||
|
private ProvinceInfoService provinceInfoService;
|
||||||
|
@Autowired
|
||||||
|
private CityInfoService cityInfoService;
|
||||||
|
@Autowired
|
||||||
|
private DistrictInfoService districtInfoService;
|
||||||
|
@Operation(summary = "查询省份信息列表")
|
||||||
|
@GetMapping("province/list")
|
||||||
|
public Result<List<ProvinceInfo>> listProvince() {
|
||||||
|
List<ProvinceInfo> list = provinceInfoService.list();
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据省份id查询城市信息列表")
|
||||||
|
@GetMapping("city/listByProvinceId")
|
||||||
|
public Result<List<CityInfo>> listCityInfoByProvinceId(@RequestParam Long id) {
|
||||||
|
LambdaQueryWrapper<CityInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CityInfo::getProvinceId, id);
|
||||||
|
List<CityInfo> list = cityInfoService.list(queryWrapper);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("district/listByCityId")
|
||||||
|
@Operation(summary = "根据城市id查询区县信息")
|
||||||
|
public Result<List<DistrictInfo>> listDistrictInfoByCityId(@RequestParam Long id) {
|
||||||
|
LambdaQueryWrapper<DistrictInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(DistrictInfo::getCityId, id);
|
||||||
|
List<DistrictInfo> list = districtInfoService.list(queryWrapper);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.apartment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.ApartmentLabel;
|
||||||
|
import com.atguigu.lease.model.entity.RoomInfo;
|
||||||
|
import com.atguigu.lease.model.enums.ReleaseStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.RoomInfoService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomDetailVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomItemVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomQueryVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomSubmitVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "房间信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/room")
|
||||||
|
public class RoomController {
|
||||||
|
@Autowired
|
||||||
|
private RoomInfoService roomInfoService;
|
||||||
|
|
||||||
|
@Operation(summary = "保存或更新房间信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdate(@RequestBody RoomSubmitVo roomSubmitVo) {
|
||||||
|
roomInfoService.saveOrUpdateRoomInfo(roomSubmitVo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据条件分页查询房间列表")
|
||||||
|
@GetMapping("pageItem")
|
||||||
|
public Result<IPage<RoomItemVo>> pageItem(@RequestParam long current, @RequestParam long size, RoomQueryVo queryVo) {
|
||||||
|
Page<RoomItemVo> page =new Page<>(current,size);
|
||||||
|
IPage<RoomItemVo> pageModel = roomInfoService.selectRoomInfoPage(page,queryVo);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id获取房间详细信息")
|
||||||
|
@GetMapping("getDetailById")
|
||||||
|
public Result<RoomDetailVo> getDetailById(@RequestParam Long id) {
|
||||||
|
RoomDetailVo detailById = roomInfoService.getDetailById(id);
|
||||||
|
return Result.ok(detailById);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除房间信息")
|
||||||
|
@DeleteMapping("removeById")
|
||||||
|
public Result removeById(@RequestParam Long id) {
|
||||||
|
roomInfoService.removeRoomById(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id修改房间发布状态")
|
||||||
|
@PostMapping("updateReleaseStatusById")
|
||||||
|
public Result updateReleaseStatusById(Long id, ReleaseStatus status) {
|
||||||
|
LambdaUpdateWrapper<RoomInfo> queryWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
queryWrapper.eq(RoomInfo::getId, id);
|
||||||
|
queryWrapper.set(RoomInfo::getIsRelease, status);
|
||||||
|
roomInfoService.update(queryWrapper);
|
||||||
|
return Result.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("listBasicByApartmentId")
|
||||||
|
@Operation(summary = "根据公寓id查询房间列表")
|
||||||
|
public Result<List<RoomInfo>> listBasicByApartmentId(Long id) {
|
||||||
|
LambdaQueryWrapper<RoomInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(RoomInfo::getApartmentId, id);
|
||||||
|
queryWrapper.eq(RoomInfo::getIsRelease, ReleaseStatus.RELEASED);
|
||||||
|
List<RoomInfo> list = roomInfoService.list(queryWrapper);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.lease;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.LeaseAgreement;
|
||||||
|
import com.atguigu.lease.model.enums.LeaseStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.LeaseAgreementService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.agreement.AgreementQueryVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.agreement.AgreementVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "租约管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/agreement")
|
||||||
|
public class LeaseAgreementController {
|
||||||
|
@Autowired
|
||||||
|
private LeaseAgreementService leaseAgreementService;
|
||||||
|
@Operation(summary = "保存或修改租约信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdate(@RequestBody LeaseAgreement leaseAgreement) {
|
||||||
|
leaseAgreementService.saveOrUpdate(leaseAgreement);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据条件分页查询租约列表")
|
||||||
|
@GetMapping("page")
|
||||||
|
public Result<IPage<AgreementVo>> page(@RequestParam long current, @RequestParam long size, AgreementQueryVo queryVo) {
|
||||||
|
Page<AgreementVo> page = new Page<>(current, size);
|
||||||
|
IPage<AgreementVo> pageModel = leaseAgreementService.selectPageAgreement(page,queryVo);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id查询租约信息")
|
||||||
|
@GetMapping(name = "getById")
|
||||||
|
public Result<AgreementVo> getById(@RequestParam Long id) {
|
||||||
|
AgreementVo agreementVo = leaseAgreementService.getAgreement(id);
|
||||||
|
return Result.ok(agreementVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id删除租约信息")
|
||||||
|
@DeleteMapping("removeById")
|
||||||
|
public Result removeById(@RequestParam Long id) {
|
||||||
|
boolean b = leaseAgreementService.removeById(id);
|
||||||
|
if (b){
|
||||||
|
return Result.ok();
|
||||||
|
}else{
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id更新租约状态")
|
||||||
|
@PostMapping("updateStatusById")
|
||||||
|
public Result updateStatusById(@RequestParam Long id, @RequestParam LeaseStatus status) {
|
||||||
|
LambdaUpdateWrapper<LeaseAgreement> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(LeaseAgreement::getId, id);
|
||||||
|
updateWrapper.set(LeaseAgreement::getStatus, status);
|
||||||
|
leaseAgreementService.update(updateWrapper);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.lease;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.ViewAppointment;
|
||||||
|
import com.atguigu.lease.model.enums.AppointmentStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.ViewAppointmentService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.appointment.AppointmentQueryVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.appointment.AppointmentVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "预约看房管理")
|
||||||
|
@RequestMapping("/admin/appointment")
|
||||||
|
@RestController
|
||||||
|
public class ViewAppointmentController {
|
||||||
|
@Autowired
|
||||||
|
private ViewAppointmentService viewAppointmentService;
|
||||||
|
@Operation(summary = "分页查询预约信息")
|
||||||
|
@GetMapping("page")
|
||||||
|
public Result<IPage<AppointmentVo>> page(@RequestParam long current, @RequestParam long size, AppointmentQueryVo queryVo) {
|
||||||
|
Page<AppointmentVo> page = new Page<>(current, size);
|
||||||
|
IPage<AppointmentVo> pageModel =
|
||||||
|
viewAppointmentService.selectAppointmentInfoPage(page, queryVo);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据id更新预约状态")
|
||||||
|
@PostMapping("updateStatusById")
|
||||||
|
public Result updateStatusById(@RequestParam Long id, @RequestParam AppointmentStatus status) {
|
||||||
|
LambdaQueryWrapper<ViewAppointment> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(ViewAppointment::getId, id);
|
||||||
|
viewAppointmentService.update(wrapper);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.login;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.common.utils.LoginUser;
|
||||||
|
import com.atguigu.lease.common.utils.LoginUserContext;
|
||||||
|
import com.atguigu.lease.web.admin.service.LoginService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.login.CaptchaVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.login.LoginVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.system.user.SystemUserInfoVo;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@Tag(name = "后台管理系统登录管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin")
|
||||||
|
public class LoginController {
|
||||||
|
@Autowired
|
||||||
|
private LoginService loginService;
|
||||||
|
@Operation(summary = "获取图形验证码")
|
||||||
|
@GetMapping("login/captcha")
|
||||||
|
public Result<CaptchaVo> getCaptcha() {
|
||||||
|
CaptchaVo captchaVo = loginService.getCaptcha();
|
||||||
|
return Result.ok(captchaVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "登录")
|
||||||
|
@PostMapping("login")
|
||||||
|
public Result<String> login(@RequestBody LoginVo loginVo) {
|
||||||
|
String token = loginService.login(loginVo);
|
||||||
|
return Result.ok(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取登陆用户个人信息")
|
||||||
|
@GetMapping("info")
|
||||||
|
public Result<SystemUserInfoVo> info() {
|
||||||
|
//1 从请求头,获取当前登录用户id
|
||||||
|
// 用户id在请求头token里面
|
||||||
|
//String token = request.getHeader("access-token");
|
||||||
|
// 解析token 使用jwt
|
||||||
|
//Claims claims = JwtUtil.parseToken(token);
|
||||||
|
//Long userId = claims.get("userId",Long.class);
|
||||||
|
|
||||||
|
//直接从ThreadLocal获取userId
|
||||||
|
LoginUser loginUser = LoginUserContext.getLoginUser();
|
||||||
|
Long userId = loginUser.getUserId();
|
||||||
|
|
||||||
|
//TODO 2 根据用户id查询数据库表获取用户信息
|
||||||
|
SystemUserInfoVo user = loginService.getSystemUserInfoById(LoginUserContext.getLoginUser().getUserId());
|
||||||
|
return Result.ok(user);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.system;
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.SystemPost;
|
||||||
|
import com.atguigu.lease.model.enums.BaseStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.SystemPostService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "后台用户岗位管理")
|
||||||
|
@RequestMapping("/admin/system/post")
|
||||||
|
public class SystemPostController {
|
||||||
|
@Autowired
|
||||||
|
private SystemPostService systemPostService;
|
||||||
|
@Operation(summary = "分页获取岗位信息")
|
||||||
|
@GetMapping("page")
|
||||||
|
private Result<IPage<SystemPost>> page(@RequestParam long current, @RequestParam long size) {
|
||||||
|
Page<SystemPost> page = new Page<>(current, size);
|
||||||
|
IPage<SystemPost> pageModel = systemPostService.page(page);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "保存或更新岗位信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdate(@RequestBody SystemPost systemPost) {
|
||||||
|
systemPostService.saveOrUpdate(systemPost);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("deleteById")
|
||||||
|
@Operation(summary = "根据id删除岗位")
|
||||||
|
public Result removeById(@RequestParam Long id) {
|
||||||
|
|
||||||
|
boolean b = systemPostService.removeById(id);
|
||||||
|
if(b){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getById")
|
||||||
|
@Operation(summary = "根据id获取岗位信息")
|
||||||
|
public Result<SystemPost> getById(@RequestParam Long id) {
|
||||||
|
SystemPost byId = systemPostService.getById(id);
|
||||||
|
return Result.ok(byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取全部岗位列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<SystemPost>> list() {
|
||||||
|
List<SystemPost> list = systemPostService.list();
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据岗位id修改状态")
|
||||||
|
@PostMapping("updateStatusByPostId")
|
||||||
|
public Result updateStatusByPostId(@RequestParam Long id, @RequestParam BaseStatus status) {
|
||||||
|
LambdaUpdateWrapper<SystemPost> wrapper = new LambdaUpdateWrapper<>();
|
||||||
|
wrapper.eq(SystemPost::getId, id);
|
||||||
|
wrapper.set(SystemPost::getStatus, status);
|
||||||
|
systemPostService.update(wrapper);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.system;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.SystemUser;
|
||||||
|
import com.atguigu.lease.model.enums.BaseStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.SystemUserService;
|
||||||
|
import com.atguigu.lease.web.admin.service.impl.SystemUserServiceImpl;
|
||||||
|
import com.atguigu.lease.web.admin.vo.system.user.SystemUserItemVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.system.user.SystemUserQueryVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "后台用户信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/system/user")
|
||||||
|
public class SystemUserController {
|
||||||
|
@Autowired
|
||||||
|
private SystemUserService systemUserService;
|
||||||
|
@Operation(summary = "根据条件分页查询后台用户列表")
|
||||||
|
@GetMapping("page")
|
||||||
|
public Result<IPage<SystemUserItemVo>> page(@RequestParam long current, @RequestParam long size, SystemUserQueryVo queryVo) {
|
||||||
|
Page<SystemUserItemVo> page = new Page<>(current,size);
|
||||||
|
IPage<SystemUserItemVo> pageModel = systemUserService.selectPageSystemUser(page,queryVo);
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID查询后台用户信息")
|
||||||
|
@GetMapping("getById")
|
||||||
|
public Result<SystemUserItemVo> getById(@RequestParam Long id) {
|
||||||
|
SystemUserItemVo list = systemUserService.getUserById(id);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "保存或更新后台用户信息")
|
||||||
|
@PostMapping("saveOrUpdate")
|
||||||
|
public Result saveOrUpdate(@RequestBody SystemUser systemUser) {
|
||||||
|
if (systemUser.getId() == null){
|
||||||
|
systemUser.setPassword(DigestUtils.md5Hex(systemUser.getPassword()));
|
||||||
|
}
|
||||||
|
systemUserService.saveOrUpdate(systemUser);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "判断后台用户名是否可用")
|
||||||
|
@GetMapping("isUserNameAvailable")
|
||||||
|
public Result<Boolean> isUsernameExists(@RequestParam String username) {
|
||||||
|
LambdaQueryWrapper<SystemUser> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(SystemUser::getUsername,username);
|
||||||
|
long count = systemUserService.count(wrapper);
|
||||||
|
if(count==0){
|
||||||
|
return Result.ok();
|
||||||
|
}else {
|
||||||
|
return Result.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("deleteById")
|
||||||
|
@Operation(summary = "根据ID删除后台用户信息")
|
||||||
|
public Result removeById(@RequestParam Long id) {
|
||||||
|
systemUserService.removeById(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID修改后台用户状态")
|
||||||
|
@PostMapping("updateStatusByUserId")
|
||||||
|
public Result updateStatusByUserId(@RequestParam Long id, @RequestParam BaseStatus status) {
|
||||||
|
LambdaUpdateWrapper<SystemUser> wrapper = new LambdaUpdateWrapper<>();
|
||||||
|
wrapper.eq(SystemUser::getId, id);
|
||||||
|
wrapper.set(SystemUser::getStatus, status);
|
||||||
|
systemUserService.update(wrapper);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.atguigu.lease.web.admin.controller.user;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.result.Result;
|
||||||
|
import com.atguigu.lease.model.entity.UserInfo;
|
||||||
|
import com.atguigu.lease.model.enums.BaseStatus;
|
||||||
|
import com.atguigu.lease.web.admin.service.UserInfoService;
|
||||||
|
import com.atguigu.lease.web.admin.vo.user.UserInfoQueryVo;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@Tag(name = "用户信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/user")
|
||||||
|
public class UserInfoController {
|
||||||
|
@Autowired
|
||||||
|
private UserInfoService userInfoService;
|
||||||
|
@Operation(summary = "分页查询用户信息")
|
||||||
|
@GetMapping("page")
|
||||||
|
public Result<IPage<UserInfo>> pageUserInfo(@RequestParam long current, @RequestParam long size, UserInfoQueryVo queryVo) {
|
||||||
|
Page<UserInfo> pageParam = new Page<>(current,size);
|
||||||
|
//封装条件
|
||||||
|
LambdaQueryWrapper<UserInfo> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
//wrapper.like(queryVo.getPhone() != null, UserInfo::getPhone, queryVo.getPhone());
|
||||||
|
|
||||||
|
//if(!StringUtils.isEmpty(queryVo.getPhone())) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
if(StringUtils.hasText(queryVo.getPhone())) {
|
||||||
|
wrapper.eq(UserInfo::getPhone,queryVo.getPhone());
|
||||||
|
}
|
||||||
|
if(queryVo.getStatus() != null){
|
||||||
|
wrapper.eq(UserInfo::getStatus,queryVo.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
IPage<UserInfo> pageModel = userInfoService.page(pageParam, wrapper);
|
||||||
|
|
||||||
|
return Result.ok(pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据用户id更新账号状态")
|
||||||
|
@PostMapping("updateStatusById")
|
||||||
|
public Result updateStatusById(@RequestParam Long id, @RequestParam BaseStatus status) {
|
||||||
|
LambdaUpdateWrapper<UserInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(UserInfo::getId, id);
|
||||||
|
|
||||||
|
updateWrapper.set(UserInfo::getStatus, status);
|
||||||
|
|
||||||
|
userInfoService.update(updateWrapper);
|
||||||
|
return Result.ok();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.web.admin.custom.converter;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.enums.BaseEnum;
|
||||||
|
import org.springframework.core.convert.converter.Converter;
|
||||||
|
import org.springframework.core.convert.converter.ConverterFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class StringToBaseEnumConverterFactory implements ConverterFactory<String, BaseEnum> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T extends BaseEnum> Converter<String, T> getConverter(Class<T> targetType) {
|
||||||
|
return new Converter<String, T>() {
|
||||||
|
@Override
|
||||||
|
public T convert(String source) {
|
||||||
|
//Class.getEnumConstants() 方法是 Java 反射 API 中的一个方法,用于获取表示枚举类型的 Class 对象中所有枚举常量的数组
|
||||||
|
for (T enumConstant : targetType.getEnumConstants()) {
|
||||||
|
if (enumConstant.getCode().equals(Integer.valueOf(source))) {
|
||||||
|
return enumConstant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("非法的枚举值:" + source);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.custom.converter;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.format.FormatterRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebMvcConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StringToBaseEnumConverterFactory stringToBaseEnumConverterFactory;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addFormatters(FormatterRegistry registry) {
|
||||||
|
registry.addConverterFactory(this.stringToBaseEnumConverterFactory);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.atguigu.lease.web.admin.interceptor;
|
||||||
|
|
||||||
|
import com.atguigu.lease.common.utils.JwtUtil;
|
||||||
|
import com.atguigu.lease.common.utils.LoginUser;
|
||||||
|
import com.atguigu.lease.common.utils.LoginUserContext;
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class AuthenticationInterceptor implements HandlerInterceptor {
|
||||||
|
|
||||||
|
//之前执行
|
||||||
|
@Override
|
||||||
|
public boolean preHandle(HttpServletRequest request,
|
||||||
|
HttpServletResponse response,
|
||||||
|
Object handler) throws Exception {
|
||||||
|
//进行是否登录判断
|
||||||
|
//1 获取请求头token access-token和前端一致
|
||||||
|
String token = request.getHeader("access-token");
|
||||||
|
|
||||||
|
//String token = "abdcds";
|
||||||
|
//String token = "eyJhbGciOiJIUzI1NiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAA_6tWKi5NUrJSCg12DYr39HPzV9JRSq0oULIyNDexMLWwNDEx1FEqLU4t8kxRsrKEMPMSc1OBWnJKkyuVagENPxd4QQAAAA.a1GC3ew6N35MURDSHjDUUcD05M7BLJS8-jBS1ovOwHM";
|
||||||
|
|
||||||
|
//2 判断token是否为空,如果空,提示用户
|
||||||
|
if(token == null) {
|
||||||
|
throw new RuntimeException();
|
||||||
|
} else { //3 如果不为空,解析token
|
||||||
|
Claims claims = JwtUtil.parseToken(token);
|
||||||
|
Long userId = claims.get("userId",Long.class);
|
||||||
|
String username = claims.get("username", String.class);
|
||||||
|
//TODO 解析token成功之后,根据userId查询数据库,用户是否正常
|
||||||
|
|
||||||
|
//把userId放到ThreadLocal里面
|
||||||
|
LoginUser loginUser = new LoginUser();
|
||||||
|
loginUser.setUserId(userId);
|
||||||
|
loginUser.setUsername(username);
|
||||||
|
LoginUserContext.setLoginUser(loginUser);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//清除ThreadLocal值,防止内存泄漏
|
||||||
|
@Override
|
||||||
|
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception {
|
||||||
|
LoginUserContext.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.atguigu.lease.web.admin.interceptor;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class LoginWebMvcConfigurer implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuthenticationInterceptor authenticationInterceptor;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
registry.addInterceptor(authenticationInterceptor)
|
||||||
|
.addPathPatterns("/admin/**")
|
||||||
|
.excludePathPatterns("/admin/login/**");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.ApartmentFacility;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【apartment_facility(公寓&配套关联表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.ApartmentFacility
|
||||||
|
*/
|
||||||
|
public interface ApartmentFacilityMapper extends BaseMapper<ApartmentFacility> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.ApartmentFeeValue;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【apartment_fee_value(公寓&杂费关联表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.ApartmentFeeValue
|
||||||
|
*/
|
||||||
|
public interface ApartmentFeeValueMapper extends BaseMapper<ApartmentFeeValue> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.ApartmentInfo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.apartment.ApartmentItemVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.apartment.ApartmentQueryVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【apartment_info(公寓信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.ApartmentInfo
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ApartmentInfoMapper extends BaseMapper<ApartmentInfo> {
|
||||||
|
|
||||||
|
|
||||||
|
IPage<ApartmentItemVo> selectApartmentInfoPage(Page<ApartmentItemVo> page, ApartmentQueryVo queryVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.ApartmentLabel;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【apartment_label(公寓标签关联表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.ApartmentLabel
|
||||||
|
*/
|
||||||
|
public interface ApartmentLabelMapper extends BaseMapper<ApartmentLabel> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.AttrKey;
|
||||||
|
import com.atguigu.lease.web.admin.vo.attr.AttrKeyVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【attr_key(房间基本属性表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.AttrKey
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface AttrKeyMapper extends BaseMapper<AttrKey> {
|
||||||
|
|
||||||
|
List<AttrKeyVo> listAttrInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.AttrValue;
|
||||||
|
import com.atguigu.lease.web.admin.vo.attr.AttrValueVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【attr_value(房间基本属性值表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.AttrValue
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface AttrValueMapper extends BaseMapper<AttrValue> {
|
||||||
|
|
||||||
|
List<AttrValueVo> selectListByRoomId(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.BrowsingHistory;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【browsing_history(浏览历史)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.BrowsingHistory
|
||||||
|
*/
|
||||||
|
public interface BrowsingHistoryMapper extends BaseMapper<BrowsingHistory> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.CityInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【city_info】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.CityInfo
|
||||||
|
*/
|
||||||
|
public interface CityInfoMapper extends BaseMapper<CityInfo> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.DistrictInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【district_info】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.DistrictInfo
|
||||||
|
*/
|
||||||
|
public interface DistrictInfoMapper extends BaseMapper<DistrictInfo> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.FacilityInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【facility_info(配套信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.FacilityInfo
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface FacilityInfoMapper extends BaseMapper<FacilityInfo> {
|
||||||
|
List<FacilityInfo> findFacilityListByApartmentId(Long id);
|
||||||
|
|
||||||
|
List<FacilityInfo> findFacilityListByRoomId(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.FeeKey;
|
||||||
|
import com.atguigu.lease.web.admin.vo.fee.FeeKeyVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【fee_key(杂项费用名称表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.FeeKey
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface FeeKeyMapper extends BaseMapper<FeeKey> {
|
||||||
|
List<FeeKeyVo> saveOrUpdateFeeKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.FeeValue;
|
||||||
|
import com.atguigu.lease.web.admin.vo.fee.FeeValueVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【fee_value(杂项费用值表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.FeeValue
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface FeeValueMapper extends BaseMapper<FeeValue> {
|
||||||
|
List<FeeValueVo> findLabelListByApartmentId(Long id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.GraphInfo;
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.atguigu.lease.web.admin.vo.graph.GraphVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【graph_info(图片信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.GraphInfo
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface GraphInfoMapper extends BaseMapper<GraphInfo> {
|
||||||
|
List<GraphVo> selectGraphListByApartmentId(@Param("itemType") ItemType itemType,
|
||||||
|
@Param("itemId") Long itemId);
|
||||||
|
|
||||||
|
List<GraphVo> selectGraphListByRoomId(@Param("itemType")ItemType itemType,
|
||||||
|
@Param("itemId") Long itemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.LabelInfo;
|
||||||
|
import com.atguigu.lease.model.enums.ItemType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【label_info(标签信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.LabelInfo
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface LabelInfoMapper extends BaseMapper<LabelInfo> {
|
||||||
|
List<LabelInfo> findLabelListByApartmentId(Long id);
|
||||||
|
|
||||||
|
List<LabelInfo> selectListByRoomId(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.LeaseAgreement;
|
||||||
|
import com.atguigu.lease.web.admin.vo.agreement.AgreementQueryVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.agreement.AgreementVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【lease_agreement(租约信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.LeaseAgreement
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface LeaseAgreementMapper extends BaseMapper<LeaseAgreement> {
|
||||||
|
|
||||||
|
IPage<AgreementVo> selectPageAgreement(Page<AgreementVo> page, AgreementQueryVo queryVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.LeaseTerm;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【lease_term(租期)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.LeaseTerm
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface LeaseTermMapper extends BaseMapper<LeaseTerm> {
|
||||||
|
|
||||||
|
List<LeaseTerm> selectListByRoomId(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.PaymentType;
|
||||||
|
import com.atguigu.lease.model.entity.RoomPaymentType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【payment_type(支付方式表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.PaymentType
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface PaymentTypeMapper extends BaseMapper<PaymentType> {
|
||||||
|
|
||||||
|
List<PaymentType> selectListByRoomId(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.ProvinceInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【province_info】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.ProvinceInfo
|
||||||
|
*/
|
||||||
|
public interface ProvinceInfoMapper extends BaseMapper<ProvinceInfo> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.RoomAttrValue;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【room_attr_value(房间&基本属性值关联表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.RoomAttrValue
|
||||||
|
*/
|
||||||
|
public interface RoomAttrValueMapper extends BaseMapper<RoomAttrValue> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.RoomFacility;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【room_facility(房间&配套关联表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.RoomFacility
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface RoomFacilityMapper extends BaseMapper<RoomFacility> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.RoomInfo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomDetailVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomItemVo;
|
||||||
|
import com.atguigu.lease.web.admin.vo.room.RoomQueryVo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【room_info(房间信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.RoomInfo
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface RoomInfoMapper extends BaseMapper<RoomInfo> {
|
||||||
|
|
||||||
|
IPage<RoomItemVo> selectRoomInfoPage(Page<RoomItemVo> page, RoomQueryVo queryVo);
|
||||||
|
Long countRoomMany();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.RoomLabel;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【room_label(房间&标签关联表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.RoomLabel
|
||||||
|
*/
|
||||||
|
public interface RoomLabelMapper extends BaseMapper<RoomLabel> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.atguigu.lease.web.admin.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.lease.model.entity.RoomLeaseTerm;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liubo
|
||||||
|
* @description 针对表【room_lease_term(房间租期管理表)】的数据库操作Mapper
|
||||||
|
* @createDate 2023-07-24 15:48:00
|
||||||
|
* @Entity com.atguigu.lease.model.RoomLeaseTerm
|
||||||
|
*/
|
||||||
|
public interface RoomLeaseTermMapper extends BaseMapper<RoomLeaseTerm> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue