# project-gCigJu **Repository Path**: qinsJs/gCigJu ## Basic Information - **Project Name**: project-gCigJu - **Description**: 学习工具:好词好句收录。gCigJu = good ci good ju - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: http://ci.q123q.cc - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-10 - **Last Updated**: 2023-04-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 学习助手:好词好句收录 [ci.q123q.cc](http://ci.q123q.cc/) > 起因: > > 看书的时候,经常会遇到一些陌生词。 > > 每次都想回头记下来,但是每次都没有记下来! > > 最后,有了这个 SPA 来记录 ## v 1.0 - [x] jwt 登录 - [x] 记录词 和 句 ```sql DROP TABLE IF EXISTS `dream`; CREATE TABLE `dream` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增长id', `user_id` varchar(32) NOT NULL COMMENT '用户id', `type` varchar(12) NOT NULL COMMENT 'ci 词 | ju 句 ', `content` text NOT NULL COMMENT '内容', `excerpt` text NOT NULL DEFAULT (_utf8mb4'') COMMENT '摘录于 ... ', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间', `version` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '乐观锁版本号', `remark` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`) ) ``` ## v 1.1 - [x] 前端 build 后,上传 cdn,后段直接返回 index.html! 解决了 serverless 前后端部署时 ,path 的问题 ## v 1.2 分类细化 - ci 词 - 成语 - 词语 - 例 - ju 句 - 好句 - cento 摘录 ## SQLite3 版本 ```sql DROP TABLE IF EXISTS `ci`; CREATE TABLE `ci` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, -- '自增长id', `user_id` varchar(32) NOT NULL, -- '用户 uuid', `type` varchar(12) NOT NULL DEFAULT ('plain'), -- 'idiom 成语 | plain 词语 ', `content` text NOT NULL, -- '内容', `example` text DEFAULT (''), -- 例: `excerpt` text DEFAULT (''), -- '摘录于 ... ', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '更新时间', `deleted_at` datetime DEFAULT NULL -- '删除时间', ); ``` ```sql DROP TABLE IF EXISTS `ju`; CREATE TABLE `ju` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, -- '自增长id', `user_id` varchar(32) NOT NULL, -- '用户 uuid', `type` varchar(12) NOT NULL DEFAULT ('sentence'), -- 'good 好句 | cento 书摘 | sentence 句子', `content` text NOT NULL, -- '内容', `excerpt` text DEFAULT (''), -- '摘录于 ... ', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '更新时间', `deleted_at` datetime DEFAULT NULL -- '删除时间', ); ``` [sqlite ON UPDATE CURRENT_TIMESTAMP](https://stackoverflow.com/questions/6578439/on-update-current-timestamp-with-sqlite) ### MySQL 版本 ```sql DROP TABLE IF EXISTS `ci`; CREATE TABLE `ci` ( `id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL, -- '自增长id', `user_id` varchar(32) NOT NULL, -- '用户 uuid', `type` varchar(12) NOT NULL DEFAULT ('plain'), -- 'idiom 成语 | plain 词语 ', `content` text NOT NULL, -- '内容', `example` text DEFAULT (''), -- 例: `excerpt` text DEFAULT (''), -- '摘录于 ... ', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- '更新时间', `deleted_at` datetime DEFAULT NULL -- '删除时间', ); ``` ```sql DROP TABLE IF EXISTS `ju`; CREATE TABLE `ju` ( `id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL, -- '自增长id', `user_id` varchar(32) NOT NULL, -- '用户 uuid', `type` varchar(12) NOT NULL DEFAULT ('sentence'), -- 'good 好句 | cento 书摘 | sentence 句子', `content` text NOT NULL, -- '内容', `excerpt` text DEFAULT (''), -- '摘录于 ... ', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, -- '创建时间', `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- '更新时间', `deleted_at` datetime DEFAULT NULL -- '删除时间', ); ``` ### 迁移数据 SQL 记录 ```sql INSERT INTO ci (user_id,type,content,excerpt,created_at,updated_at,deleted_at) SELECT user_id,'plain',content,excerpt,created_at,updated_at,deleted_at from dream WHERE type = 'ci' AND user_id = '618e95eccdc09c1f2418a51b'; INSERT INTO ju (user_id,type,content,excerpt,created_at,updated_at,deleted_at) SELECT user_id,'sentence',content,excerpt,created_at,updated_at,deleted_at from dream WHERE type = 'ju' AND user_id = '618e95eccdc09c1f2418a51b'; ``` ## v 1.3 新增 个人分类 - me 个人 - url 链接 - think 感想 ```sql ``` ## v1.4 将数据库从 Ali 的 MySQL 迁移到 TiDB ```sql CREATE TABLE `ci` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` varchar(32) NOT NULL, `type` varchar(12) NOT NULL DEFAULT 'plain', `content` text NOT NULL, `example` text , `excerpt` text , `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `deleted_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `ju` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` varchar(32) NOT NULL, `type` varchar(12) NOT NULL DEFAULT 'sentence', `content` text NOT NULL, `excerpt` text , `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `deleted_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ``` tidb 只有一年的使用,并不是永久免费。。。 迁移,但是并不使用 ## v 2.0 - [ ] 即可设计 - [ ] 好词界面美化 - [ ] 好句界面美化 ## next - [ ] 接入百度翻译 - [ ] 详情 - [ ] 编辑 ## next next - [ ] 喜欢/排序强度 - [ ] 删除 - [ ] 回收站 ## next next next - 历史 - 排序 - 时间分割 - ORC - 切换至 MongoDB