feat: init project
This commit is contained in:
230
config/config.yaml
Normal file
230
config/config.yaml
Normal file
@@ -0,0 +1,230 @@
|
||||
# Database Render Application Configuration
|
||||
|
||||
app:
|
||||
name: "Database Render"
|
||||
port: 9080
|
||||
debug: false
|
||||
|
||||
database:
|
||||
type: "sqlite"
|
||||
path: "data/app.db"
|
||||
|
||||
# Table configurations
|
||||
tables:
|
||||
posts:
|
||||
alias: "文章管理"
|
||||
description: "博客文章管理"
|
||||
page_size: 10
|
||||
fields:
|
||||
id:
|
||||
type: "int"
|
||||
alias: "ID"
|
||||
hidden: true
|
||||
title:
|
||||
type: "string"
|
||||
alias: "标题"
|
||||
searchable: true
|
||||
size: "large"
|
||||
content:
|
||||
type: "text"
|
||||
alias: "内容"
|
||||
hidden: true # Hide from list view, show in detail
|
||||
markdown: true
|
||||
category:
|
||||
type: "string"
|
||||
alias: "分类"
|
||||
searchable: true
|
||||
colors:
|
||||
Technology: "#3b82f6"
|
||||
Programming: "#8b5cf6"
|
||||
"Web Development": "#10b981"
|
||||
DevOps: "#f59e0b"
|
||||
"Data Science": "#ef4444"
|
||||
Lifestyle: "#ec4899"
|
||||
tags:
|
||||
type: "string"
|
||||
alias: "标签"
|
||||
searchable: true
|
||||
status:
|
||||
type: "string"
|
||||
alias: "状态"
|
||||
searchable: true
|
||||
colors:
|
||||
published: "#10b981"
|
||||
draft: "#6b7280"
|
||||
pending: "#f59e0b"
|
||||
view_count:
|
||||
type: "int"
|
||||
alias: "浏览量"
|
||||
created_at:
|
||||
type: "time"
|
||||
alias: "创建时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
updated_at:
|
||||
type: "time"
|
||||
alias: "更新时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
|
||||
users:
|
||||
alias: "用户管理"
|
||||
description: "系统用户管理"
|
||||
page_size: 10
|
||||
fields:
|
||||
id:
|
||||
type: "int"
|
||||
alias: "ID"
|
||||
hidden: true
|
||||
username:
|
||||
type: "string"
|
||||
alias: "用户名"
|
||||
searchable: true
|
||||
email:
|
||||
type: "string"
|
||||
alias: "邮箱"
|
||||
searchable: true
|
||||
full_name:
|
||||
type: "string"
|
||||
alias: "姓名"
|
||||
searchable: true
|
||||
bio:
|
||||
type: "text"
|
||||
alias: "简介"
|
||||
max_length: 200
|
||||
status:
|
||||
type: "string"
|
||||
alias: "状态"
|
||||
searchable: true
|
||||
colors:
|
||||
active: "#10b981"
|
||||
inactive: "#ef4444"
|
||||
pending: "#f59e0b"
|
||||
role:
|
||||
type: "string"
|
||||
alias: "角色"
|
||||
searchable: true
|
||||
colors:
|
||||
admin: "#ef4444"
|
||||
user: "#3b82f6"
|
||||
last_login:
|
||||
type: "time"
|
||||
alias: "最后登录"
|
||||
format: "2006-01-02 15:04:05"
|
||||
created_at:
|
||||
type: "time"
|
||||
alias: "创建时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
updated_at:
|
||||
type: "time"
|
||||
alias: "更新时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
|
||||
categories:
|
||||
alias: "分类管理"
|
||||
description: "文章分类管理"
|
||||
page_size: 10
|
||||
fields:
|
||||
id:
|
||||
type: "int"
|
||||
alias: "ID"
|
||||
hidden: true
|
||||
name:
|
||||
type: "string"
|
||||
alias: "名称"
|
||||
searchable: true
|
||||
slug:
|
||||
type: "string"
|
||||
alias: "别名"
|
||||
searchable: true
|
||||
description:
|
||||
type: "text"
|
||||
alias: "描述"
|
||||
max_length: 200
|
||||
color:
|
||||
type: "string"
|
||||
alias: "颜色"
|
||||
render_type: "color"
|
||||
sort_order:
|
||||
type: "int"
|
||||
alias: "排序"
|
||||
is_active:
|
||||
type: "bool"
|
||||
alias: "激活"
|
||||
render_type: "bool"
|
||||
created_at:
|
||||
type: "time"
|
||||
alias: "创建时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
updated_at:
|
||||
type: "time"
|
||||
alias: "更新时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
|
||||
comments:
|
||||
alias: "评论管理"
|
||||
description: "文章评论管理"
|
||||
page_size: 15
|
||||
fields:
|
||||
id:
|
||||
type: "int"
|
||||
alias: "ID"
|
||||
hidden: true
|
||||
post_id:
|
||||
type: "int"
|
||||
alias: "文章ID"
|
||||
user_id:
|
||||
type: "int"
|
||||
alias: "用户ID"
|
||||
author_name:
|
||||
type: "string"
|
||||
alias: "作者"
|
||||
searchable: true
|
||||
author_email:
|
||||
type: "string"
|
||||
alias: "邮箱"
|
||||
searchable: true
|
||||
content:
|
||||
type: "text"
|
||||
alias: "内容"
|
||||
max_length: 500
|
||||
status:
|
||||
type: "string"
|
||||
alias: "状态"
|
||||
searchable: true
|
||||
colors:
|
||||
approved: "#10b981"
|
||||
pending: "#f59e0b"
|
||||
rejected: "#ef4444"
|
||||
created_at:
|
||||
type: "time"
|
||||
alias: "创建时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
updated_at:
|
||||
type: "time"
|
||||
alias: "更新时间"
|
||||
format: "2006-01-02 15:04:05"
|
||||
|
||||
# Logging configuration
|
||||
logging:
|
||||
level: "info"
|
||||
format: "json"
|
||||
output: "stdout"
|
||||
|
||||
# Server configuration
|
||||
server:
|
||||
read_timeout: 30s
|
||||
write_timeout: 30s
|
||||
idle_timeout: 60s
|
||||
|
||||
# Security configuration
|
||||
security:
|
||||
cors:
|
||||
enabled: true
|
||||
allow_origins: ["*"]
|
||||
allow_methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
|
||||
allow_headers: ["Origin", "Content-Type", "Accept"]
|
||||
|
||||
# Cache configuration
|
||||
cache:
|
||||
enabled: false
|
||||
ttl: 5m
|
||||
max_size: 100
|
||||
Reference in New Issue
Block a user