docs(website): 添加简记memo产品原型和UI设计规范文档

- 新增「简记memo」一体化小程序产品原型设计文档
- 新增简记memo完整版UI视觉设计规范和界面细节
- 添加IDEA项目配置文件.gitignore
- 创建404页面HTML文件,包含响应式布局和错误提示
- 添加关于页面HTML文件,展示品牌介绍和团队信息
- 实现AES加解密工具函数,支持请求体加密
- 添加用户协议页面基础框架
This commit is contained in:
sunct
2026-07-31 14:12:32 +08:00
commit 3c3bf53ae4
115 changed files with 21304 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
// 账单表:sm_bill
package models
import "gorm.io/gorm"
type Bill struct {
gorm.Model
ID uint `gorm:"primarykey" json:"id"`
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index;comment:用户ID" json:"user_id" db:"user_id"`
Type int `gorm:"column:type;type:tinyint(1);not null;default:0;comment:类型 1支出 2收入 3转账" json:"type" db:"type"`
Money float64 `gorm:"column:money;type:decimal(10,2);not null;default:0.00;comment:金额" json:"money" db:"money"`
Cate string `gorm:"column:cate;type:varchar(20);default:'';comment:分类名称" json:"cate" db:"cate"`
Note string `gorm:"column:note;type:varchar(100);default:'';comment:备注" json:"note" db:"note"`
Channel string `gorm:"column:channel;type:varchar(20);default:'';comment:渠道" json:"channel" db:"channel"`
Date string `gorm:"column:date;type:varchar(10);not null;index;comment:日期 2025-05-01" json:"date" db:"date"`
FromAccount string `gorm:"column:from_account;type:varchar(20);default:'';comment:转出账户" json:"from_account" db:"from_account"`
ToAccount string `gorm:"column:to_account;type:varchar(20);default:'';comment:转入账户" json:"to_account" db:"to_account"`
}
+14
View File
@@ -0,0 +1,14 @@
// 预算表:sm_budget
package models
import "gorm.io/gorm"
// Budget 月度预算表
// 表名:sm_budget
type Budget struct {
gorm.Model // 包含 ID, CreatedAt, UpdatedAt, DeletedAt
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index:idx_user_month;comment:用户ID" json:"user_id" db:"user_id"`
Month string `gorm:"column:month;type:varchar(10);not null;index:idx_user_month;comment:月份 2025-05" json:"month" db:"month"`
Amount float64 `gorm:"column:amount;type:decimal(10,2);not null;default:0.00;comment:月度预算金额" json:"amount" db:"amount"`
}
+13
View File
@@ -0,0 +1,13 @@
// 分类表:sm_category
package models
import "gorm.io/gorm"
type Category struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index:idx_user_type;comment:用户ID 0=系统内置" json:"user_id" db:"user_id"`
Name string `gorm:"column:name;type:varchar(20);not null;comment:分类名称" json:"name" db:"name"`
Type int `gorm:"column:type;type:tinyint(1);not null;index:idx_user_type;comment:类型 1支出 2收入" json:"type" db:"type"`
Icon string `gorm:"column:icon;type:varchar(50);default:'';comment:分类图标" json:"icon" db:"icon"`
Color string `gorm:"column:color;type:varchar(20);default:'#666666';comment:分类颜色" json:"color" db:"color"`
}
+19
View File
@@ -0,0 +1,19 @@
// 每日进度表:sm_daily_progress
package models
import "gorm.io/gorm"
type DailyProgress struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;not null;uniqueIndex:idx_user_date;comment:用户ID" json:"user_id" db:"user_id"`
RecordDate string `gorm:"column:record_date;type:varchar(10);not null;uniqueIndex:idx_user_date;comment:日期 yyyy-MM-dd" json:"record_date" db:"record_date"`
TaskCount int `gorm:"column:task_count;type:int;default:0;comment:完成任务数" json:"task_count" db:"task_count"`
TotalTasks int `gorm:"column:total_tasks;type:int;default:0;comment:当日待办总数" json:"total_tasks" db:"total_tasks"`
BillCount int `gorm:"column:bill_count;type:int;default:0;comment:记账笔数" json:"bill_count" db:"bill_count"`
MoodRecorded bool `gorm:"column:mood_recorded;type:tinyint(1);default:0;comment:是否记录心情" json:"mood_recorded" db:"mood_recorded"`
MoodType string `gorm:"column:mood_type;type:varchar(20);default:'';comment:心情类型 happy/normal/sad" json:"mood_type" db:"mood_type"`
ReviewRecorded bool `gorm:"column:review_recorded;type:tinyint(1);default:0;comment:是否复盘" json:"review_recorded" db:"review_recorded"`
PerfectDay bool `gorm:"column:perfect_day;type:tinyint(1);default:0;comment:是否完美一天(100%完成待办)" json:"perfect_day" db:"perfect_day"`
DailyExp int `gorm:"column:daily_exp;type:int;default:0;comment:今日获得经验" json:"daily_exp" db:"daily_exp"`
ExpBreakdown string `gorm:"column:exp_breakdown;type:varchar(200);default:'';comment:经验构成JSON" json:"exp_breakdown" db:"exp_breakdown"`
}
+16
View File
@@ -0,0 +1,16 @@
// 经验变化日志表:sm_exp_change_log
package models
import "gorm.io/gorm"
type ExpChangeLog struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;not null;index;comment:用户ID" json:"user_id" db:"user_id"`
ChangeType string `gorm:"column:change_type;type:varchar(20);comment:变化类型 add/level_up/achievement" json:"change_type" db:"change_type"`
ExpDelta int `gorm:"column:exp_delta;type:int;comment:经验变化量" json:"exp_delta" db:"exp_delta"`
Source string `gorm:"column:source;type:varchar(20);comment:来源 task/bill/mood/streak/achievement" json:"source" db:"source"`
SourceID string `gorm:"column:source_id;type:varchar(50);comment:关联记录ID" json:"source_id" db:"source_id"`
BeforeExp int `gorm:"column:before_exp;type:int;comment:变化前经验" json:"before_exp" db:"before_exp"`
AfterExp int `gorm:"column:after_exp;type:int;comment:变化后经验" json:"after_exp" db:"after_exp"`
RecordDate string `gorm:"column:record_date;type:varchar(10);comment:记录日期" json:"record_date" db:"record_date"`
}
+19
View File
@@ -0,0 +1,19 @@
// 心情表:sm_mood
package models
import "gorm.io/gorm"
type Mood struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index;comment:用户ID" json:"user_id" db:"user_id"`
Date string `gorm:"column:date;type:varchar(10);uniqueIndex:idx_user_date;comment:日期 yyyy-MM-dd" json:"date" db:"date"`
Emoji string `gorm:"column:emoji;type:varchar(10);default:'';comment:心情表情" json:"emoji" db:"emoji"`
Content string `gorm:"column:content;type:varchar(500);default:'';comment:心情内容" json:"content" db:"content"`
// AI生成内容(使用 gorm:"-" 避免写入,只用于查询)
AIGen MoodAIGeneration `gorm:"-" json:"ai_gen,omitempty"`
}
func (Mood) TableName() string {
return "sm_mood"
}
+23
View File
@@ -0,0 +1,23 @@
// 心情AI生成记录表:sm_mood_ai_generations
package models
import "gorm.io/gorm"
// MoodAIGeneration 心情AI生成记录
type MoodAIGeneration struct {
gorm.Model
MoodID uint `gorm:"column:mood_id;type:bigint unsigned;index;comment:关联的心情ID" json:"mood_id"`
UserID uint `gorm:"column:user_id;type:bigint unsigned;index;comment:用户ID" json:"user_id"`
Emoji string `gorm:"column:emoji;type:varchar(50);comment:心情表情" json:"emoji"`
Content string `gorm:"column:content;type:varchar(500);comment:心情内容" json:"content"`
Date string `gorm:"column:date;type:varchar(10);comment:日期" json:"date"`
AIText string `gorm:"column:ai_text;type:text;comment:AI生成的文本" json:"ai_text"`
AIImageURL string `gorm:"column:ai_image_url;type:varchar(500);comment:AI生成的图片URL" json:"ai_image_url"`
GenerateCount int `gorm:"column:generate_count;type:int;default:1;comment:生成次数" json:"generate_count"`
Status int `gorm:"column:status;type:tinyint;default:0;comment:状态 0生成中 1成功 2失败" json:"status"`
ErrorMsg string `gorm:"column:error_msg;type:varchar(500);comment:错误信息" json:"error_msg"`
}
func (MoodAIGeneration) TableName() string {
return "sm_mood_ai_generations"
}
+19
View File
@@ -0,0 +1,19 @@
// 复盘表:sm_review
package models
import "gorm.io/gorm"
// Review 复盘记录(KPT 法)
type Review struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index;comment:用户ID" json:"user_id" db:"user_id"`
Date string `gorm:"column:date;type:varchar(10);uniqueIndex:idx_user_date;comment:日期 yyyy-MM-dd" json:"date" db:"date"`
// KPT 法
Keep string `gorm:"column:keep;type:text;comment:保持" json:"keep" db:"keep"`
Problem string `gorm:"column:problem;type:text;comment:问题" json:"problem" db:"problem"`
Try string `gorm:"column:try;type:text;comment:尝试" json:"try" db:"try"`
}
func (Review) TableName() string {
return "sm_review"
}
+22
View File
@@ -0,0 +1,22 @@
// 待办表:sm_todo
package models
import "gorm.io/gorm"
type Todo struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index;comment:用户ID" json:"user_id" db:"user_id"`
Title string `gorm:"column:title;type:varchar(50);default:'';comment:任务标题" json:"title" db:"title"`
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:任务备注" json:"remark" db:"remark"`
Category string `gorm:"column:category;type:varchar(20);default:'';comment:分类 work/life/study" json:"category" db:"category"`
Priority int `gorm:"column:priority;type:tinyint(1);default:2;comment:优先级 1高 2中 3低" json:"priority" db:"priority"`
RepeatType string `gorm:"column:repeat_type;type:varchar(20);default:'none';comment:重复类型 none/day/week/month" json:"repeat_type" db:"repeat_type"`
Done int `gorm:"column:done;type:tinyint(1);default:0;comment:是否完成 0未完成 1已完成" json:"done" db:"done"`
Date string `gorm:"column:date;type:varchar(10);index;comment:任务日期 yyyy-MM-dd" json:"date" db:"date"`
StartTime string `gorm:"column:start_time;type:varchar(10);comment:任务开始时间" json:"start_time" db:"start_time"`
EndTime string `gorm:"column:end_time;type:varchar(10);comment:任务结束时间" json:"end_time" db:"end_time"`
IsOverdue int `gorm:"column:is_overdue;type:tinyint(1);default:0;comment:是否逾期 0否 1是" json:"is_overdue" db:"is_overdue"`
AutoPostpone int `gorm:"column:auto_postpone;type:tinyint(1);default:0;comment:自动顺延开关 0关 1开" json:"auto_postpone" db:"auto_postpone"`
Subtasks string `gorm:"column:subtasks;type:text;comment:子任务 JSON" json:"subtasks" db:"subtasks"`
Sort int `gorm:"column:sort;type:int;default:0;comment:排序" json:"sort" db:"sort"`
}
+16
View File
@@ -0,0 +1,16 @@
// 用户表:sm_user
package models
import "gorm.io/gorm"
type User struct {
gorm.Model
Openid string `gorm:"column:openid;type:varchar(100);default:'';index;comment:微信openid" json:"openid" db:"openid"`
Unionid string `gorm:"column:unionid;type:varchar(100);default:'';index;comment:微信unionid(跨平台统一标识)" json:"unionid" db:"unionid"`
Nickname string `gorm:"column:nickname;type:varchar(30);default:'';comment:用户昵称" json:"nickname" db:"nickname"`
Avatar string `gorm:"column:avatar;type:varchar(255);default:'';comment:用户头像" json:"avatar" db:"avatar"`
Signature string `gorm:"column:signature;type:varchar(255);default:'';comment:个性签名" json:"signature" db:"signature"`
Email string `gorm:"column:email;type:varchar(100);default:'';index;comment:用户邮箱" json:"email" db:"email"`
Password string `gorm:"column:password;type:varchar(255);default:'';comment:邮箱登录密码" json:"-" db:"password"`
UserCode string `gorm:"column:user_code;type:varchar(20);default:'';index;comment:用户码(展示用)" json:"user_code" db:"user_code"`
}
+10
View File
@@ -0,0 +1,10 @@
// 用户配置表:sm_user_config
package models
import "gorm.io/gorm"
type UserConfig struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;default:0;index;comment:用户ID" json:"user_id" db:"user_id"`
Theme string `gorm:"column:theme;type:varchar(20);default:'';comment:主题" json:"theme" db:"theme"`
}
+12
View File
@@ -0,0 +1,12 @@
// 用户成就表:sm_user_achievement
package models
import "gorm.io/gorm"
type UserAchievement struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;not null;index;comment:用户ID" json:"user_id" db:"user_id"`
AchievementID string `gorm:"column:achievement_id;type:varchar(50);not null;comment:成就ID" json:"achievement_id" db:"achievement_id"`
UnlockDate string `gorm:"column:unlock_date;type:varchar(10);default:'';comment:解锁日期" json:"unlock_date" db:"unlock_date"`
ExpRewarded int `gorm:"column:exp_rewarded;type:int;default:0;comment:已发放的经验奖励" json:"exp_rewarded" db:"exp_rewarded"`
}
+21
View File
@@ -0,0 +1,21 @@
// 用户成长表:sm_user_growth
package models
import "gorm.io/gorm"
type UserGrowth struct {
gorm.Model
UserID uint `gorm:"column:user_id;type:bigint unsigned;not null;uniqueIndex;comment:用户ID" json:"user_id" db:"user_id"`
Level int `gorm:"column:level;type:int;default:1;comment:等级" json:"level" db:"level"`
Experience int `gorm:"column:experience;type:int;default:0;comment:当前经验值" json:"experience" db:"experience"`
TotalDays int `gorm:"column:total_days;type:int;default:0;comment:累计记录天数" json:"total_days" db:"total_days"`
StreakDays int `gorm:"column:streak_days;type:int;default:0;comment:连续记录天数" json:"streak_days" db:"streak_days"`
MaxStreakDays int `gorm:"column:max_streak_days;type:int;default:0;comment:最高连续天数" json:"max_streak_days" db:"max_streak_days"`
HappyStreakDays int `gorm:"column:happy_streak_days;type:int;default:0;comment:连续开心天数" json:"happy_streak_days" db:"happy_streak_days"`
LastRecordDate string `gorm:"column:last_record_date;type:varchar(10);default:'';comment:最后记录日期" json:"last_record_date" db:"last_record_date"`
ProtectedDays int `gorm:"column:protected_days;type:int;default:7;comment:新用户保护期剩余天数" json:"protected_days" db:"protected_days"`
TotalTasks int `gorm:"column:total_tasks;type:int;default:0;comment:累计完成任务数" json:"total_tasks" db:"total_tasks"`
TotalBills int `gorm:"column:total_bills;type:int;default:0;comment:累计记账笔数" json:"total_bills" db:"total_bills"`
TotalMoods int `gorm:"column:total_moods;type:int;default:0;comment:累计心情记录数" json:"total_moods" db:"total_moods"`
TotalReview int `gorm:"column:total_review;type:int;default:0;comment:累计复盘数" json:"total_review" db:"total_review"`
}