Compare commits

...

2 Commits

Author SHA1 Message Date
42bcfcf70e add db.sql 2025-12-15 10:30:55 +08:00
d82c5200e7 refactor travel 2025-12-15 10:30:45 +08:00
11 changed files with 1319 additions and 0 deletions

View File

@ -0,0 +1,97 @@
package com.imyeyu.api.modules.journal.controller;
import com.imyeyu.api.modules.common.service.AttachmentService;
import com.imyeyu.api.modules.journal.entity.Travel;
import com.imyeyu.api.modules.journal.service.TravelService;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
import com.imyeyu.spring.annotation.RequestSingleParam;
import com.imyeyu.spring.bean.Page;
import com.imyeyu.spring.bean.PageResult;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 旅行计划接口
*
* @author 夜雨
* @since 2025-12-12 14:50
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/journal/travel")
public class TravelController {
private final TravelService service;
private final AttachmentService attachmentService;
/**
* 创建旅行计划
*
* @param travel 旅行计划
*/
@AOPLog
@RequestRateLimit
@PostMapping("/create")
public void create(@RequestBody @Valid Travel travel) {
service.create(travel);
}
/**
* 更新旅行计划
*
* @param travel 旅行计划
*/
@AOPLog
@RequestRateLimit
@PostMapping("/update")
public void update(@RequestBody @Valid Travel travel) {
service.update(travel);
}
/**
* 删除旅行计划(级联删除关联地点和附件)
*
* @param id 旅行 ID
*/
@AOPLog
@RequestRateLimit
@PostMapping("/delete")
public void delete(@RequestSingleParam Long id) {
service.delete(id);
}
/**
* 查询旅行计划详情
*
* @param id 旅行 ID
* @return 旅行计划
*/
@AOPLog
@RequestRateLimit
@GetMapping("/{id}")
public Travel detail(@PathVariable Long id) {
return service.get(id);
}
/**
* 旅行计划列表
*
* @param page 分页参数
* @return 旅行列表
*/
@AOPLog
@RequestRateLimit
@PostMapping("/list")
public PageResult<Travel> list(@RequestBody Page<Travel> page) {
return service.page(page);
}
}

View File

@ -0,0 +1,136 @@
package com.imyeyu.api.modules.journal.controller;
import com.imyeyu.api.bean.PreviewPage;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.api.modules.common.service.AttachmentService;
import com.imyeyu.api.modules.journal.entity.TravelLocation;
import com.imyeyu.api.modules.journal.service.TravelLocationService;
import com.imyeyu.spring.annotation.AOPLog;
import com.imyeyu.spring.annotation.RequestRateLimit;
import com.imyeyu.spring.annotation.RequestSingleParam;
import com.imyeyu.spring.bean.Page;
import com.imyeyu.spring.bean.PageResult;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 旅行地点接口
*
* @author 夜雨
* @since 2025-12-12 14:50
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/journal/travel/location")
public class TravelLocationController {
private final AttachmentService attachmentService;
private final TravelLocationService service;
/**
* 创建旅行地点
*
* @param location 旅行地点
*/
@AOPLog
@RequestRateLimit
@PostMapping("/create")
public void create(@RequestBody @Valid TravelLocation location) {
service.create(location);
}
/**
* 更新旅行地点
*
* @param location 旅行地点
*/
@AOPLog
@RequestRateLimit
@PostMapping("/update")
public void update(@RequestBody @Valid TravelLocation location) {
service.update(location);
}
/**
* 删除旅行地点(级联删除附件)
*
* @param id 地点 ID
*/
@AOPLog
@RequestRateLimit
@PostMapping("/delete")
public void delete(@RequestSingleParam Long id) {
service.delete(id);
}
/**
* 查询旅行地点详情
*
* @param id 地点 ID
* @return 旅行地点
*/
@AOPLog
@RequestRateLimit
@GetMapping("/{id}")
public TravelLocation detail(@PathVariable Long id) {
TravelLocation location = service.get(id);
location.setItems(attachmentService.listByBizId(Attachment.BizType.JOURNAL_TRAVEL, location.getId()));
return location;
}
/**
* 旅行地点列表
*
* @param page 分页参数
* @return 地点列表
*/
@AOPLog
@RequestRateLimit
@PostMapping("/list")
public PageResult<TravelLocation> list(@RequestBody PreviewPage<TravelLocation> page) {
PageResult<TravelLocation> result = service.page(page);
for (TravelLocation location : result.getList()) {
Page<Attachment> attachPage = new Page<>();
{
Attachment example = new Attachment();
example.setBizType(Attachment.BizType.JOURNAL_TRAVEL);
example.setBizId(location.getId());
attachPage.setEqualsExample(example);
}
attachPage.setIndex(0);
attachPage.setSize(1); // 列表接口只允许预览
location.setItems(attachmentService.page(attachPage).getList());
}
return result;
}
@AOPLog
@RequestRateLimit
@PostMapping("/list/ids")
public List<TravelLocation> listByIds(@RequestBody Long[] ids) {
List<TravelLocation> locationList = service.listByIds(ids);
for (TravelLocation location : locationList) {
Page<Attachment> attachPage = new Page<>();
{
Attachment example = new Attachment();
example.setBizType(Attachment.BizType.JOURNAL_TRAVEL);
example.setBizId(location.getId());
attachPage.setEqualsExample(example);
}
attachPage.setIndex(0);
attachPage.setSize(Long.MAX_VALUE);
location.setItems(attachmentService.page(attachPage).getList());
}
return locationList;
}
}

View File

@ -0,0 +1,83 @@
package com.imyeyu.api.modules.journal.entity;
import com.imyeyu.spring.annotation.table.PageIgnore;
import com.imyeyu.spring.entity.Entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 旅行计划
*
* @author 夜雨
* @since 2025-12-12 14:30
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class Travel extends Entity {
/**
* 交通类型
*
* @author 夜雨
* @since 2025-12-12 14:30
*/
public enum TransportationType {
/** 飞机 */
PLANE,
/** 火车 */
TRAIN,
/** 汽车 */
CAR,
/** 轮船 */
SHIP,
/** 自驾 */
SELF_DRIVING,
/** 其他 */
OTHER
}
/**
* 旅行状态
*
* @author 夜雨
* @since 2025-12-12 14:30
*/
public enum Status {
/** 计划中 */
PLANNING,
/** 进行中 */
ONGOING,
/** 已完成 */
COMPLETED,
}
/** 交通类型 */
@PageIgnore
private TransportationType transportationType;
/** 标题 */
private String title;
/** 内容 */
@PageIgnore
private String content;
/** 出行时间 */
private Long travelAt;
/** 天数 */
@PageIgnore
private Integer days;
/** 状态 */
private Status status;
}

View File

@ -0,0 +1,87 @@
package com.imyeyu.api.modules.journal.entity;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.spring.annotation.table.Transient;
import com.imyeyu.spring.entity.Entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
/**
* 旅行地点
*
* @author 夜雨
* @since 2025-12-12 14:30
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TravelLocation extends Entity {
/**
* 地点类型
*
* @author 夜雨
* @since 2025-12-12 14:30
*/
public enum Type {
/** 景点 */
ATTRACTION,
/** 酒店 */
HOTEL,
/** 餐厅 */
RESTAURANT,
/** 交通站点 */
TRANSPORT,
/** 购物 */
SHOPPING,
/** 其他 */
OTHER
}
/** 旅行计划 ID */
private Long travelId;
/** 类型 */
private Type type;
/** 标题 */
private String title;
/** 说明 */
private String description;
/** 纬度 */
private Double lat;
/** 经度 */
private Double lng;
/** 位置 */
private String location;
/** 费用 */
private BigDecimal amount;
/** true 为需要身份证 */
private Boolean requireIdCard;
/** 必要评分 */
private Integer score;
@Transient
private Long[] attachmentIds;
@Transient
private String[] tempFileIds;
@Transient
private List<Attachment> items;
}

View File

@ -0,0 +1,17 @@
package com.imyeyu.api.modules.journal.mapper;
import com.imyeyu.api.modules.journal.entity.TravelLocation;
import com.imyeyu.spring.mapper.BaseMapper;
import java.util.List;
/**
* 旅行地点 Mapper
*
* @author 夜雨
* @since 2025-12-12 14:35
*/
public interface TravelLocationMapper extends BaseMapper<TravelLocation, Long> {
List<TravelLocation> listByIds(Long[] ids);
}

View File

@ -0,0 +1,32 @@
package com.imyeyu.api.modules.journal.mapper;
import com.imyeyu.api.modules.journal.entity.Travel;
import com.imyeyu.spring.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 旅行计划 Mapper
*
* @author 夜雨
* @since 2025-12-12 14:35
*/
public interface TravelMapper extends BaseMapper<Travel, Long> {
/**
* 根据 ID 列表查询
*
* @param ids ID 列表
* @return 旅行列表
*/
List<Travel> listByIds(@Param("ids") Long[] ids);
/**
* 根据状态查询
*
* @param status 状态
* @return 旅行列表
*/
List<Travel> listByStatus(@Param("status") Travel.Status status);
}

View File

@ -0,0 +1,26 @@
package com.imyeyu.api.modules.journal.service;
import com.imyeyu.api.modules.journal.entity.TravelLocation;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.service.BaseService;
import java.util.List;
/**
* 旅行地点服务
*
* @author 夜雨
* @since 2025-12-12 14:40
*/
public interface TravelLocationService extends BaseService<TravelLocation, Long> {
List<TravelLocation> listByIds(Long... ids);
/**
* 根据旅行 ID 删除所有地点
*
* @param travelId 旅行 ID
* @throws TimiException 服务异常
*/
void deleteByTravelId(Long travelId) throws TimiException;
}

View File

@ -0,0 +1,13 @@
package com.imyeyu.api.modules.journal.service;
import com.imyeyu.api.modules.journal.entity.Travel;
import com.imyeyu.spring.service.BaseService;
/**
* 旅行计划服务
*
* @author 夜雨
* @since 2025-12-12 14:40
*/
public interface TravelService extends BaseService<Travel, Long> {
}

View File

@ -0,0 +1,111 @@
package com.imyeyu.api.modules.journal.service.implement;
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
import com.imyeyu.api.modules.common.bean.MediaAttach;
import com.imyeyu.api.modules.common.bean.TempFileMetaData;
import com.imyeyu.api.modules.common.entity.Attachment;
import com.imyeyu.api.modules.common.service.AttachmentService;
import com.imyeyu.api.modules.common.service.TempFileService;
import com.imyeyu.api.modules.journal.entity.TravelLocation;
import com.imyeyu.api.modules.journal.mapper.TravelLocationMapper;
import com.imyeyu.api.modules.journal.service.TravelLocationService;
import com.imyeyu.java.TimiJava;
import com.imyeyu.java.bean.timi.TimiException;
import com.imyeyu.spring.mapper.BaseMapper;
import com.imyeyu.spring.service.AbstractEntityService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 旅行地点服务实现
*
* @author 夜雨
* @since 2025-12-12 14:45
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class TravelLocationServiceImplement extends AbstractEntityService<TravelLocation, Long> implements TravelLocationService {
private final TempFileService tempFileService;
private final AttachmentService attachmentService;
private final TravelLocationMapper mapper;
@Override
protected BaseMapper<TravelLocation, Long> mapper() {
return mapper;
}
@Transactional(TimiServerDBConfig.ROLLBACKER)
@Override
public void create(TravelLocation travelLocation) {
super.create(travelLocation);
for (String tempFileId : travelLocation.getTempFileIds()) {
TempFileMetaData metadata = tempFileService.metadata(tempFileId);
Attachment attach = new Attachment();
attach.setName(metadata.getOriginalName());
attach.setBizType(Attachment.BizType.JOURNAL_TRAVEL);
attach.setBizId(travelLocation.getId());
attach.setInputStream(tempFileService.getInputStream(tempFileId));
attachmentService.createMedia(attach);
}
}
@Transactional(TimiServerDBConfig.ROLLBACKER)
@Override
public void update(TravelLocation travelLocation) {
super.update(travelLocation);
// 删除
Set<Long> dbAttachSet = attachmentService.listByBizId(Attachment.BizType.JOURNAL_TRAVEL, travelLocation.getId(), MediaAttach.Type.THUMB)
.stream()
.map(Attachment::getId)
.collect(Collectors.toSet());
Set<Long> retainIds = Set.of(TimiJava.firstNotEmpty(travelLocation.getAttachmentIds(), new Long[0]));
dbAttachSet.removeAll(retainIds);
for (Long removeId : dbAttachSet) {
attachmentService.deleteMedia(removeId);
}
// 新增
for (String tempFileId : TimiJava.firstNotNull(travelLocation.getTempFileIds(), new String[0])) {
TempFileMetaData metadata = tempFileService.metadata(tempFileId);
Attachment attach = new Attachment();
attach.setName(metadata.getOriginalName());
attach.setBizType(Attachment.BizType.JOURNAL_TRAVEL);
attach.setBizId(travelLocation.getId());
attach.setInputStream(tempFileService.getInputStream(tempFileId));
attachmentService.createMedia(attach);
}
}
@Transactional(TimiServerDBConfig.ROLLBACKER)
@Override
public void delete(Long id) {
super.delete(id);
attachmentService.deleteByBizId(Attachment.BizType.JOURNAL_TRAVEL, id);
}
@Override
public List<TravelLocation> listByIds(Long... ids) {
return mapper.listByIds(ids);
}
@Transactional(TimiServerDBConfig.ROLLBACKER)
@Override
public void deleteByTravelId(Long travelId) throws TimiException {
TravelLocation example = new TravelLocation();
example.setTravelId(travelId);
List<TravelLocation> locationList = mapper.selectAllByExample(example);
for (TravelLocation location : locationList) {
delete(location.getId());
}
}
}

View File

@ -0,0 +1,40 @@
package com.imyeyu.api.modules.journal.service.implement;
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
import com.imyeyu.api.modules.journal.entity.Travel;
import com.imyeyu.api.modules.journal.mapper.TravelMapper;
import com.imyeyu.api.modules.journal.service.TravelLocationService;
import com.imyeyu.api.modules.journal.service.TravelService;
import com.imyeyu.spring.mapper.BaseMapper;
import com.imyeyu.spring.service.AbstractEntityService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 旅行计划服务实现
*
* @author 夜雨
* @since 2025-12-12 14:45
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class TravelServiceImplement extends AbstractEntityService<Travel, Long> implements TravelService {
private final TravelMapper mapper;
private final TravelLocationService travelLocationService;
@Override
protected BaseMapper<Travel, Long> mapper() {
return mapper;
}
@Transactional(TimiServerDBConfig.ROLLBACKER)
@Override
public void delete(Long id) {
super.delete(id);
travelLocationService.deleteByTravelId(id);
}
}

677
src/main/resources/db.sql Normal file
View File

@ -0,0 +1,677 @@
/*
Navicat Premium Dump SQL
Source Server : dev_mariadb
Source Server Type : MariaDB
Source Server Version : 110802 (11.8.2-MariaDB-ubu2404)
Source Host : vm.imyeyu.dev:3307
Source Schema : timi_server
Target Server Type : MariaDB
Target Server Version : 110802 (11.8.2-MariaDB-ubu2404)
File Encoding : 65001
Date: 12/12/2025 14:24:29
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标题',
`type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '类型',
`digest` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '摘要',
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '数据',
`extend_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '扩展数据 JSON' CHECK (json_valid(`extend_data`)),
`reads` int(11) NULL DEFAULT 0 COMMENT '阅读',
`likes` int(11) NULL DEFAULT 0 COMMENT '喜欢',
`show_comment` tinyint(1) NULL DEFAULT 1 COMMENT '1 为显示历史评论',
`can_comment` tinyint(1) NULL DEFAULT 1 COMMENT '1 为允许评论',
`can_ranking` tinyint(1) NULL DEFAULT 1 COMMENT '1 为允许进入每周排行列表',
`can_list` tinyint(1) NULL DEFAULT NULL COMMENT '1 为允许通过列表查询',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文章' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for async_task
-- ----------------------------
DROP TABLE IF EXISTS `async_task`;
CREATE TABLE `async_task` (
`uuid` varchar(38) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`message` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`status` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`progress` double NULL DEFAULT NULL,
`start_at` bigint(20) NULL DEFAULT NULL,
`interrupt_at` bigint(20) NULL DEFAULT NULL,
`error_at` bigint(20) NULL DEFAULT NULL,
`died_at` bigint(20) NULL DEFAULT NULL,
`can_pause` tinyint(1) NULL DEFAULT NULL,
`can_interrupt` tinyint(1) NULL DEFAULT NULL,
`is_periodical` tinyint(1) NULL DEFAULT NULL,
`cron` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`uuid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for attachment
-- ----------------------------
DROP TABLE IF EXISTS `attachment`;
CREATE TABLE `attachment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`biz_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`biz_id` bigint(20) NOT NULL,
`attach_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`mongo_id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`mime_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`size` bigint(20) NULL DEFAULT NULL,
`md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`ext` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NOT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
`destroy_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 530 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '附件' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for bill
-- ----------------------------
DROP TABLE IF EXISTS `bill`;
CREATE TABLE `bill` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`revenue_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '收入类型',
`expenditure_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '支出类型',
`description` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '说明',
`remarks` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
`decimal` bigint(20) NOT NULL DEFAULT 0 COMMENT '金额(放大了 100 倍)',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3687 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消费账单' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`biz_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关联业务',
`biz_id` bigint(20) NOT NULL COMMENT '关联业务 ID',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '评论者',
`nick` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论者昵称',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '内容',
`ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 69 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '评论' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for comment_remind_queue
-- ----------------------------
DROP TABLE IF EXISTS `comment_remind_queue`;
CREATE TABLE `comment_remind_queue` (
`uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'UUID',
`user_id` bigint(20) NOT NULL COMMENT '被回复用户 ID',
`reply_id` bigint(20) NOT NULL COMMENT '回复 ID',
PRIMARY KEY (`uuid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '评论回复提醒队列,被回复用户是注册用户并且开启邮件推送时,缓存在本表,由邮件推送服务操作' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for comment_reply
-- ----------------------------
DROP TABLE IF EXISTS `comment_reply`;
CREATE TABLE `comment_reply` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`comment_id` bigint(20) NOT NULL,
`reply_id` bigint(20) NULL DEFAULT NULL COMMENT '被回复的回复,回复主评论时为 NULL',
`sender_id` bigint(20) NULL DEFAULT NULL COMMENT '回复者',
`receiver_id` bigint(20) NULL DEFAULT NULL COMMENT '被回复者',
`sender_nick` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '回复者昵称',
`receiver_nick` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '被回复者昵称',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '内容',
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '回复时 IP',
`ignored_at` bigint(20) NULL DEFAULT NULL COMMENT '被回复者忽略该回复的时间',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '评论回复' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for comment_reply_record
-- ----------------------------
DROP TABLE IF EXISTS `comment_reply_record`;
CREATE TABLE `comment_reply_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL COMMENT '用户 ID',
`reply_id` bigint(20) NOT NULL COMMENT '回复 ID',
`created_at` bigint(20) NOT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '评论回复记录(显示在个人空间\"回复我的\"),因“仅删除回复记录不删除实体回复”功能而作此表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for email_filter
-- ----------------------------
DROP TABLE IF EXISTS `email_filter`;
CREATE TABLE `email_filter` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`from` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '通过邮件直接拒绝系统发送的列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for email_queue
-- ----------------------------
DROP TABLE IF EXISTS `email_queue`;
CREATE TABLE `email_queue` (
`uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'UUID',
`biz_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'EmailType 推送类型',
`biz_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '推送数据 ID',
`send_at` bigint(20) NOT NULL DEFAULT 0 COMMENT '推送时间',
PRIMARY KEY (`uuid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '邮件推送队列' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for email_queue_log
-- ----------------------------
DROP TABLE IF EXISTS `email_queue_log`;
CREATE TABLE `email_queue_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '队列 UUID',
`biz_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'EmailType 类型',
`biz_id` bigint(20) NULL DEFAULT NULL COMMENT '数据 ID',
`send_to` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '目标',
`send_at` bigint(20) NULL DEFAULT NULL COMMENT '时间',
`is_sent` tinyint(4) NULL DEFAULT NULL COMMENT '1 为成功',
`exception_msg` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '异常信息',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '邮件推送队列日志' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for feedback
-- ----------------------------
DROP TABLE IF EXISTS `feedback`;
CREATE TABLE `feedback` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`from` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '来自',
`email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系邮箱',
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '内容',
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'IP',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '反馈' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for friend
-- ----------------------------
DROP TABLE IF EXISTS `friend`;
CREATE TABLE `friend` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`icon` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '图标 Base64',
`name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标题',
`link` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '链接',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '友链' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for git_issue
-- ----------------------------
DROP TABLE IF EXISTS `git_issue`;
CREATE TABLE `git_issue` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`repository_id` bigint(20) NOT NULL COMMENT '所属仓库 ID',
`publisher_id` bigint(20) NULL DEFAULT NULL COMMENT '所属用户 ID',
`publisher_nick` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '游客昵称',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '类型',
`version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '版本',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标题',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '说明',
`status` varbinary(50) NULL DEFAULT NULL COMMENT '状态',
`confirmed_at` bigint(20) NULL DEFAULT NULL COMMENT '确认时间',
`develop_at` bigint(20) NULL DEFAULT NULL COMMENT '开发时间',
`closed_at` bigint(20) NULL DEFAULT NULL COMMENT '关闭时间',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Git 问题报告' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for git_merge
-- ----------------------------
DROP TABLE IF EXISTS `git_merge`;
CREATE TABLE `git_merge` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`repository_id` bigint(20) NOT NULL COMMENT '所属仓库 ID',
`requester_id` bigint(20) NOT NULL COMMENT '请求用户 ID',
`issue_id` bigint(20) NULL DEFAULT NULL COMMENT '相关反馈 ID',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '类型',
`from_branch` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '来源分支',
`to_branch` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '去向分支',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标题',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '说明',
`checked_at` bigint(20) NULL DEFAULT NULL COMMENT '通过审查时间',
`merged_at` bigint(20) NULL DEFAULT NULL COMMENT '合并时间',
`rejected_at` bigint(20) NULL DEFAULT NULL COMMENT '拒绝时间',
`reject_reason` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '拒绝原因',
`closed_at` bigint(20) NULL DEFAULT NULL COMMENT '关闭时间',
`status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '状态',
`created_at` bigint(20) NOT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Git 合并申请' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for git_release
-- ----------------------------
DROP TABLE IF EXISTS `git_release`;
CREATE TABLE `git_release` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`repository_id` bigint(20) NOT NULL COMMENT '所属仓库 ID',
`version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '版本',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '说明',
`sha1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '版本 SHA1',
`commits` int(11) NOT NULL DEFAULT 0 COMMENT '此版本后提交次数',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Git 版本发布' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for icon
-- ----------------------------
DROP TABLE IF EXISTS `icon`;
CREATE TABLE `icon` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`unicode` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`svg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 150 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字体图标' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for journal
-- ----------------------------
DROP TABLE IF EXISTS `journal`;
CREATE TABLE `journal` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`idea` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`lat` double NULL DEFAULT NULL,
`lng` double NULL DEFAULT NULL,
`location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`weather` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`pusher` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 48 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for lyric
-- ----------------------------
DROP TABLE IF EXISTS `lyric`;
CREATE TABLE `lyric` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`song` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '歌曲名',
`singer` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '演唱',
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '歌词',
`citations` bigint(20) NOT NULL DEFAULT 0 COMMENT '被引用次数,更新者不为空时开始计数',
`updated_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者 ID',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '歌词' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for lyric_corrects
-- ----------------------------
DROP TABLE IF EXISTS `lyric_corrects`;
CREATE TABLE `lyric_corrects` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`lyric_id` bigint(20) NULL DEFAULT NULL COMMENT '申请更新歌词 ID',
`song` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '歌曲名',
`singer` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '演唱',
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '歌词',
`request_by` bigint(20) NULL DEFAULT NULL COMMENT '申请人',
`request_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '申请人 IP',
`cancel_at` bigint(20) NULL DEFAULT NULL COMMENT '取消时间',
`approval_at` bigint(20) NULL DEFAULT NULL COMMENT '通过时间',
`reject_at` bigint(20) NULL DEFAULT NULL COMMENT '拒绝时间',
`reject_reason` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '拒绝原因',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '歌词更新申请' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for minecraft_pack
-- ----------------------------
DROP TABLE IF EXISTS `minecraft_pack`;
CREATE TABLE `minecraft_pack` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '游戏 ID',
`ver` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '整合包版本',
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '标题',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '简介',
`game_ver` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '游戏版本',
`def_option` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '默认配置',
`size` bigint(20) NOT NULL DEFAULT 0 COMMENT '文件大小',
`is_deprecated` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'true 为已过时',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Minecraft 客户端列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for minecraft_pack_source
-- ----------------------------
DROP TABLE IF EXISTS `minecraft_pack_source`;
CREATE TABLE `minecraft_pack_source` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`pack_id` bigint(20) NOT NULL COMMENT '整合版 ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '数据源名称',
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '数据类型',
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '数据',
`order` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
`is_default` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'true 为默认',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Minecraft 客户端下载源' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for minecraft_player
-- ----------------------------
DROP TABLE IF EXISTS `minecraft_player`;
CREATE TABLE `minecraft_player` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL COMMENT '关联 User.id',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '游戏名',
`last_login_ip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '最近登录 IP',
`last_login_at` bigint(20) NULL DEFAULT NULL COMMENT '最近登录',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`, `user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Minecraft 玩家' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for mirror
-- ----------------------------
DROP TABLE IF EXISTS `mirror`;
CREATE TABLE `mirror` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`bean` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '执行类',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称',
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '镜像数据',
`period` int(11) NOT NULL COMMENT '周期(分钟)',
`last_sync_at` bigint(20) NULL DEFAULT NULL COMMENT '最近同步时间',
`is_enable` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'true 为启用同步',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '镜像' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for multilingual
-- ----------------------------
DROP TABLE IF EXISTS `multilingual`;
CREATE TABLE `multilingual` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`zh_cn` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`zh_tw` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`en_us` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`ru_ru` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`ja_jp` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`de_de` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`ko_kr` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 795 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '多语言映射' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for setting
-- ----------------------------
DROP TABLE IF EXISTS `setting`;
CREATE TABLE `setting` (
`key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`is_private` tinyint(1) NOT NULL DEFAULT 1,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统配置' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for tag
-- ----------------------------
DROP TABLE IF EXISTS `tag`;
CREATE TABLE `tag` (
`id` bigint(20) NOT NULL,
`biz_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`biz_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for task
-- ----------------------------
DROP TABLE IF EXISTS `task`;
CREATE TABLE `task` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称',
`digest` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '摘要',
`status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '状态',
`is_public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'true 为公开',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '任务列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for task_detail
-- ----------------------------
DROP TABLE IF EXISTS `task_detail`;
CREATE TABLE `task_detail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`task_id` bigint(20) NOT NULL,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '类型',
`status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '任务状态',
`digest` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '摘要',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附加说明',
`complete_at` bigint(20) NULL DEFAULT NULL COMMENT '完成时间',
`close_at` bigint(20) NULL DEFAULT NULL COMMENT '关闭时间',
`close_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '关闭原因',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '任务详细列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for template
-- ----------------------------
DROP TABLE IF EXISTS `template`;
CREATE TABLE `template` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`biz_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`biz_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '模板' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for travel
-- ----------------------------
DROP TABLE IF EXISTS `travel`;
CREATE TABLE `travel` (
`id` bigint(20) NOT NULL,
`transportation_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '交通类型',
`title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标题',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '内容',
`travel_at` bigint(20) NULL DEFAULT NULL COMMENT '出行时间',
`days` int(11) NULL DEFAULT NULL COMMENT '天数',
`status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '状态',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '旅行计划' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for travel_location
-- ----------------------------
DROP TABLE IF EXISTS `travel_location`;
CREATE TABLE `travel_location` (
`id` bigint(20) NOT NULL,
`travel_id` bigint(20) NOT NULL COMMENT '旅行计划 ID',
`type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '类型',
`title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标题',
`description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '说明',
`lat` double NULL DEFAULT NULL COMMENT '经度',
`lng` double NULL DEFAULT NULL COMMENT '维度',
`location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '位置',
`amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '费用',
`require_id_card` tinyint(4) NULL DEFAULT NULL COMMENT '1 为需要身份证',
`score` int(11) NULL DEFAULT NULL COMMENT '必要评分',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '旅行地点' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
`password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码摘要',
`email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮箱',
`email_verify_at` bigint(20) NULL DEFAULT NULL COMMENT '邮箱验证时间',
`unmute_at` bigint(20) NULL DEFAULT NULL COMMENT '解除禁言时间',
`unban_at` bigint(20) NULL DEFAULT NULL COMMENT '解除封禁时间',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_config
-- ----------------------------
DROP TABLE IF EXISTS `user_config`;
CREATE TABLE `user_config` (
`user_id` bigint(20) NOT NULL,
`email_reply_remind` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1 为邮箱接收回复提醒',
`updated_at` bigint(20) NULL DEFAULT NULL COMMENT '配置更新时间',
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户配置' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_privacy
-- ----------------------------
DROP TABLE IF EXISTS `user_privacy`;
CREATE TABLE `user_privacy` (
`user_id` bigint(20) NOT NULL,
`email` tinyint(1) NOT NULL DEFAULT 1,
`sex` tinyint(1) NOT NULL DEFAULT 1,
`birthdate` tinyint(1) NOT NULL DEFAULT 1,
`qq` tinyint(1) NOT NULL DEFAULT 1,
`last_login_at` tinyint(1) NOT NULL DEFAULT 1,
`created_at` tinyint(1) NOT NULL DEFAULT 1,
`updated_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户隐私控制user_id 关联用户updated_at 为本表更新时间,其他字段 1 为公开0 为不公开' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_profile
-- ----------------------------
DROP TABLE IF EXISTS `user_profile`;
CREATE TABLE `user_profile` (
`user_id` bigint(20) NOT NULL COMMENT '用户 ID',
`wrapper_type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PIXELATED' COMMENT '背景图渲染算法',
`avatar_type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PIXELATED' COMMENT '头像渲染算法',
`exp` int(11) NOT NULL DEFAULT 0 COMMENT '经验值',
`sex` int(11) NULL DEFAULT NULL COMMENT '性别0 女1 男',
`birthdate` bigint(20) NULL DEFAULT NULL COMMENT '出生日期',
`qq` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'QQ',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '说明',
`last_login_ip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '上次登录 IP',
`last_login_at` bigint(20) NULL DEFAULT NULL COMMENT '上次登录时间',
`updated_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户资料' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for version
-- ----------------------------
DROP TABLE IF EXISTS `version`;
CREATE TABLE `version` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '名称',
`version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '版本',
`content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新摘要',
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新地址',
`created_at` bigint(20) NULL DEFAULT NULL,
`updated_at` bigint(20) NULL DEFAULT NULL,
`deleted_at` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '软件版本管理' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;