feat: 更新 microMark schema 和 mark 路由,添加 skill
This commit is contained in:
2
.npmrc
2
.npmrc
@@ -1,2 +0,0 @@
|
|||||||
@abearxiong:registry=https://npm.pkg.github.com
|
|
||||||
ignore-workspace-root-check=true
|
|
||||||
29
.opencode/skills/pnpm-deploy/SKILL.md
Normal file
29
.opencode/skills/pnpm-deploy/SKILL.md
Normal 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
|
||||||
|
```
|
||||||
@@ -330,8 +330,11 @@ export const microAppsUpload = pgTable("micro_apps_upload", {
|
|||||||
export const microMark = pgTable("micro_mark", {
|
export const microMark = pgTable("micro_mark", {
|
||||||
id: uuid().primaryKey().defaultRandom(),
|
id: uuid().primaryKey().defaultRandom(),
|
||||||
title: text().default(''),
|
title: text().default(''),
|
||||||
description: text().default(''),
|
|
||||||
tags: jsonb().default([]),
|
tags: jsonb().default([]),
|
||||||
|
link: text().default(''),
|
||||||
|
summary: text().default(''),
|
||||||
|
description: text().default(''),
|
||||||
|
|
||||||
data: jsonb().default({}),
|
data: jsonb().default({}),
|
||||||
uname: varchar({ length: 255 }).default(''),
|
uname: varchar({ length: 255 }).default(''),
|
||||||
uid: uuid(),
|
uid: uuid(),
|
||||||
@@ -339,8 +342,7 @@ export const microMark = pgTable("micro_mark", {
|
|||||||
updatedAt: timestamp({ withTimezone: true, mode: 'string' }).notNull().defaultNow(),
|
updatedAt: timestamp({ withTimezone: true, mode: 'string' }).notNull().defaultNow(),
|
||||||
cover: text().default(''),
|
cover: text().default(''),
|
||||||
thumbnail: text().default(''),
|
thumbnail: text().default(''),
|
||||||
link: text().default(''),
|
|
||||||
summary: text().default(''),
|
|
||||||
markType: text().default('md'),
|
markType: text().default('md'),
|
||||||
config: jsonb().default({}),
|
config: jsonb().default({}),
|
||||||
puid: uuid(),
|
puid: uuid(),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ app
|
|||||||
.route({
|
.route({
|
||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'list',
|
key: 'list',
|
||||||
description: 'mark list.',
|
description: '获取mark列表',
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
metadata: {
|
metadata: {
|
||||||
args: {
|
args: {
|
||||||
@@ -33,6 +33,7 @@ app
|
|||||||
.route({
|
.route({
|
||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'getVersion',
|
key: 'getVersion',
|
||||||
|
description: '获取mark版本信息',
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
metadata: {
|
metadata: {
|
||||||
args: {
|
args: {
|
||||||
@@ -69,6 +70,7 @@ app
|
|||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'get',
|
key: 'get',
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
|
description: '获取mark详情',
|
||||||
metadata: {
|
metadata: {
|
||||||
args: {
|
args: {
|
||||||
|
|
||||||
@@ -100,10 +102,18 @@ app
|
|||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'update',
|
key: 'update',
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
|
description: '更新mark内容',
|
||||||
isDebug: true,
|
isDebug: true,
|
||||||
metadata: {
|
metadata: {
|
||||||
args: {
|
args: {
|
||||||
id: z.string().describe('mark id'),
|
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;
|
ctx.body = markModel;
|
||||||
})
|
})
|
||||||
.addTo(app);
|
.addTo(app);
|
||||||
|
|
||||||
|
|
||||||
app
|
app
|
||||||
.route({
|
.route({
|
||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'updateNode',
|
key: 'updateNode',
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
|
description: '更新mark节点,支持更新和删除操作',
|
||||||
metadata: {
|
metadata: {
|
||||||
args: {
|
args: {
|
||||||
id: z.string().describe('mark id'),
|
id: z.string().describe('mark id'),
|
||||||
@@ -207,6 +220,7 @@ app
|
|||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'updateNodes',
|
key: 'updateNodes',
|
||||||
middleware: ['auth'],
|
middleware: ['auth'],
|
||||||
|
description: '批量更新mark节点,支持更新和删除操作',
|
||||||
metadata: {
|
metadata: {
|
||||||
args: {
|
args: {
|
||||||
id: z.string().describe('mark id'),
|
id: z.string().describe('mark id'),
|
||||||
@@ -292,11 +306,50 @@ app
|
|||||||
})
|
})
|
||||||
.addTo(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
|
app
|
||||||
.route({
|
.route({
|
||||||
path: 'mark',
|
path: 'mark',
|
||||||
key: 'getMenu',
|
key: 'getMenu',
|
||||||
description: '获取菜单',
|
description: '获取mark菜单',
|
||||||
middleware: ['auth']
|
middleware: ['auth']
|
||||||
})
|
})
|
||||||
.define(async (ctx) => {
|
.define(async (ctx) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user