feat: 项目初始化及当前全部内容提交

This commit is contained in:
2025-07-15 17:37:50 +08:00
parent ec817067f1
commit e78f192d34
622 changed files with 75174 additions and 383 deletions
@@ -0,0 +1,21 @@
package com.emotionmuseum.explore;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* 地图探索服务启动类
*
* @author emotion-museum
* @since 2025-07-12
*/
@SpringBootApplication
@MapperScan("com.emotionmuseum.explore.mapper")
public class ExploreApplication {
public static void main(String[] args) {
SpringApplication.run(ExploreApplication.class, args);
}
}
@@ -0,0 +1,49 @@
package com.emotionmuseum.explore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.emotionmuseum.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 评论实体
*
* @author emotion-museum
* @since 2025-07-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("comment")
public class Comment extends BaseEntity {
/**
* 帖子ID
*/
@TableField("post_id")
private String postId;
/**
* 用户ID
*/
@TableField("user_id")
private String userId;
/**
* 评论内容
*/
@TableField("content")
private String content;
/**
* 回复的评论ID
*/
@TableField("reply_to_id")
private String replyToId;
/**
* 点赞数
*/
@TableField("likes")
private Integer likes;
}
@@ -0,0 +1,88 @@
package com.emotionmuseum.explore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.emotionmuseum.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 社区帖子实体
*
* @author emotion-museum
* @since 2025-07-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "community_post", autoResultMap = true)
public class CommunityPost extends BaseEntity {
/**
* 用户ID
*/
@TableField("user_id")
private String userId;
/**
* 地点ID
*/
@TableField("location_id")
private String locationId;
/**
* 标题
*/
@TableField("title")
private String title;
/**
* 内容
*/
@TableField("content")
private String content;
/**
* 帖子类型
*/
@TableField("type")
private String type;
/**
* 图片列表
*/
@TableField(value = "images", typeHandler = JacksonTypeHandler.class)
private List<String> images;
/**
* 标签
*/
@TableField(value = "tags", typeHandler = JacksonTypeHandler.class)
private List<String> tags;
/**
* 点赞数
*/
@TableField("likes")
private Integer likes;
/**
* 浏览数
*/
@TableField("view_count")
private Integer viewCount;
/**
* 评论数
*/
@TableField("comment_count")
private Integer commentCount;
/**
* 是否私密: 0-公开, 1-私密
*/
@TableField("is_private")
private Integer isPrivate;
}
@@ -0,0 +1,96 @@
package com.emotionmuseum.explore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.emotionmuseum.common.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 地点标记实体
*
* @author emotion-museum
* @since 2025-07-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("location_pin")
public class LocationPin extends BaseEntity {
/**
* 地点名称
*/
@TableField("name")
private String name;
/**
* 地点类型
*/
@TableField("type")
private String type;
/**
* 地点分类
*/
@TableField("category")
private String category;
/**
* 纬度
*/
@TableField("latitude")
private BigDecimal latitude;
/**
* 经度
*/
@TableField("longitude")
private BigDecimal longitude;
/**
* 地址
*/
@TableField("address")
private String address;
/**
* 描述
*/
@TableField("description")
private String description;
/**
* 创建者
*/
@TableField("created_by")
private String createdBy;
/**
* 点赞数
*/
@TableField("likes")
private Integer likes;
/**
* 访问数
*/
@TableField("visits")
private Integer visits;
/**
* 是否收藏: 0-未收藏, 1-已收藏
*/
@TableField("is_bookmarked")
private Integer isBookmarked;
/**
* 最后访问时间
*/
@TableField("last_visit_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastVisitTime;
}
@@ -0,0 +1,80 @@
server:
port: 19005
spring:
application:
name: emotion-explore
# 数据源配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: 123456
# Redis配置
data:
redis:
host: localhost
port: 6379
password:
database: 4
timeout: 10000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# MyBatis Plus配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-field: isDeleted
logic-delete-value: 1
logic-not-delete-value: 0
# Nacos配置
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
enabled: true
register-enabled: true
heart-beat-interval: 5000
heart-beat-timeout: 15000
ip-delete-timeout: 30000
config:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
file-extension: yml
enabled: false
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.web: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
file:
name: logs/emotion-explore-local.log
# 管理端点配置
management:
endpoints:
web:
exposure:
include: health,info,metrics
endpoint:
health:
show-details: always
@@ -0,0 +1,70 @@
server:
port: 19005
spring:
application:
name: emotion-explore
profiles:
active: dev
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace: emotion-dev
group: DEFAULT_GROUP
enabled: false
config:
enabled: false
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
redis:
host: localhost
port: 6379
password:
database: 0
timeout: 10000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# 监控配置
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
metrics:
export:
prometheus:
enabled: true
# 日志配置
logging:
level:
com.emotionmuseum: debug
com.baomidou.mybatisplus: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"