2
0
Просмотр исходного кода

📝 docs(wechat-auth): enhance documentation for wechat authorization

---

- add markdown frontmatter with description
- improve schema validation messages with detailed error prompts
- add character limit descriptions for all wechat related fields
- update title format for better clarity
yourname 6 месяцев назад
Родитель
Сommit
6ead9f7040
1 измененных файлов с 11 добавлено и 11 удалено
  1. 11 11
      .roo/commands/wechat-auth-微信服务号网页授权登录开发.md

+ 11 - 11
.roo/commands/wechat-auth-微信服务号网页授权登录开发.md

@@ -1,6 +1,6 @@
-# 微信服务号网页授权登录开发指令
-
-## 描述
+---
+description: "微信服务号网页授权登录开发指令"
+---
 
 本指令指导如何实现微信服务号网页授权登录功能,包括后端API开发、前端组件集成和移动端适配。
 
@@ -49,35 +49,35 @@ wechatCountry!: string | null;
 
 ```typescript
 // src/server/modules/users/user.schema.ts
-wechatOpenid: z.string().max(255).nullable().openapi({
+wechatOpenid: z.string().max(255, '微信openid最多255个字符').nullable().openapi({
   example: 'o6_bmjrPTlm6_2sgVt7hMZOPfL2M',
   description: '微信开放平台openid'
 }),
-wechatUnionid: z.string().max(255).nullable().openapi({
+wechatUnionid: z.string().max(255, '微信unionid最多255个字符').nullable().openapi({
   example: 'o6_bmasdasdsad6_2sgVt7hMZOPfL2M',
   description: '微信开放平台unionid'
 }),
-wechatNickname: z.string().max(255).nullable().openapi({
+wechatNickname: z.string().max(255, '微信昵称最多255个字符').nullable().openapi({
   example: '微信用户',
   description: '微信昵称'
 }),
-wechatAvatar: z.string().max(500).nullable().openapi({
+wechatAvatar: z.string().max(500, '微信头像URL最多500个字符').nullable().openapi({
   example: 'http://thirdwx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/46',
   description: '微信头像URL'
 }),
-wechatSex: z.number().int().min(0).max(2).nullable().openapi({
+wechatSex: z.number().int('微信性别必须是整数').min(0, '微信性别最小值为0').max(2, '微信性别最大值为2').nullable().openapi({
   example: 1,
   description: '微信性别(1:男,2:女,0:未知)'
 }),
-wechatProvince: z.string().max(100).nullable().openapi({
+wechatProvince: z.string().max(100, '微信省份最多100个字符').nullable().openapi({
   example: '广东省',
   description: '微信省份'
 }),
-wechatCity: z.string().max(100).nullable().openapi({
+wechatCity: z.string().max(100, '微信城市最多100个字符').nullable().openapi({
   example: '深圳市',
   description: '微信城市'
 }),
-wechatCountry: z.string().max(100).nullable().openapi({
+wechatCountry: z.string().max(100, '微信国家最多100个字符').nullable().openapi({
   example: '中国',
   description: '微信国家'
 })