feat: 更新 microMark schema 和 mark 路由,添加 skill

This commit is contained in:
xiongxiao
2026-03-19 01:56:47 +08:00
committed by cnb
parent f305a900f4
commit 07efc4e468
4 changed files with 89 additions and 7 deletions

2
.npmrc
View File

@@ -1,2 +0,0 @@
@abearxiong:registry=https://npm.pkg.github.com
ignore-workspace-root-check=true

View File

@@ -0,0 +1,29 @@
---
name: pnpm-deploy
description: 使用pnpm部署应用到测试或生成环境
---
# pnpm-deploy 部署技能
部署应用到测试或生成环境。
## 部署环境
| 环境 | 命令 |
|------|------|
| 测试环境 | `pnpm pub:me` |
| 生成环境 | `pnpm pub:kevisual` |
## 使用方法
在项目目录下执行部署命令:
### 部署到测试环境
```bash
pnpm pub:me
```
### 部署到生成环境
```bash
pnpm pub:kevisual
```

View File

@@ -330,8 +330,11 @@ export const microAppsUpload = pgTable("micro_apps_upload", {
export const microMark = pgTable("micro_mark", {
id: uuid().primaryKey().defaultRandom(),
title: text().default(''),
description: text().default(''),
tags: jsonb().default([]),
link: text().default(''),
summary: text().default(''),
description: text().default(''),
data: jsonb().default({}),
uname: varchar({ length: 255 }).default(''),
uid: uuid(),
@@ -339,8 +342,7 @@ export const microMark = pgTable("micro_mark", {
updatedAt: timestamp({ withTimezone: true, mode: 'string' }).notNull().defaultNow(),
cover: text().default(''),
thumbnail: text().default(''),
link: text().default(''),
summary: text().default(''),
markType: text().default('md'),
config: jsonb().default({}),
puid: uuid(),

View File

@@ -7,7 +7,7 @@ app
.route({
path: 'mark',
key: 'list',
description: 'mark list.',
description: '获取mark列表',
middleware: ['auth'],
metadata: {
args: {
@@ -33,6 +33,7 @@ app
.route({
path: 'mark',
key: 'getVersion',
description: '获取mark版本信息',
middleware: ['auth'],
metadata: {
args: {
@@ -69,6 +70,7 @@ app
path: 'mark',
key: 'get',
middleware: ['auth'],
description: '获取mark详情',
metadata: {
args: {
@@ -100,10 +102,18 @@ app
path: 'mark',
key: 'update',
middleware: ['auth'],
description: '更新mark内容',
isDebug: true,
metadata: {
args: {
id: z.string().describe('mark id'),
data: z.object({
title: z.string().default(''),
tags: z.any().default([]),
link: z.string().default(''),
summary: z.string().default(''),
description: z.string().default(''),
})
}
},
})
@@ -147,11 +157,14 @@ app
ctx.body = markModel;
})
.addTo(app);
app
.route({
path: 'mark',
key: 'updateNode',
middleware: ['auth'],
description: '更新mark节点支持更新和删除操作',
metadata: {
args: {
id: z.string().describe('mark id'),
@@ -207,6 +220,7 @@ app
path: 'mark',
key: 'updateNodes',
middleware: ['auth'],
description: '批量更新mark节点支持更新和删除操作',
metadata: {
args: {
id: z.string().describe('mark id'),
@@ -292,11 +306,50 @@ app
})
.addTo(app);
app
.route({
path: 'mark',
key: 'create',
description: '创建一个新的mark.',
middleware: ['auth'],
metadata: {
args: {
title: z.string().default('').describe('标题'),
tags: z.any().default([]).describe('标签'),
link: z.string().default('').describe('链接'),
summary: z.string().default('').describe('摘要'),
description: z.string().default('').describe('描述'),
markType: z.string().default('md').describe('mark类型'),
config: z.any().default({}).describe('配置'),
data: z.any().default({}).describe('数据')
}
}
})
.define(async (ctx) => {
const tokenUser = ctx.state.tokenUser;
const { title, tags, link, summary, description, markType, config, data } = ctx.query;
const inserted = await db.insert(schema.microMark).values({
title,
tags: tags || [],
link: link || '',
summary: summary || '',
description: description || '',
markType: markType || 'md',
config: config || {},
data: data || {},
uname: tokenUser.username,
uid: tokenUser.id,
puid: tokenUser.uid,
}).returning();
ctx.body = inserted[0];
})
.addTo(app);
app
.route({
path: 'mark',
key: 'getMenu',
description: '获取菜单',
description: '获取mark菜单',
middleware: ['auth']
})
.define(async (ctx) => {