feat(微信订阅): 接入歌曲排期模板并加固部署流程

订阅消息(小程序侧唯一能主动触达用户的通道):
- 新增 server/utils/wechatSubscribeFields.ts:按微信字段类型裁剪值(thing≤20、
  phrase 必须 5 个汉字、time/date/character_string 各自上限),空白压成一行,
  北京时间 time 由 playTime 的开始时间生成,解析不出退化为当天 00:00。
- wechatSubscribeService 内置 SONG_SELECTED 模板(站长新给的那个模板 ID),
  并转发上述纯函数;notificationService.createSongSelectedNotification 现在会带上
  playDate/playTime/sequence,三个排期接口(schedule / publish / bulk-publish)补传 sequence。
- 新增 test/wechatSubscribeFields.test.mjs(10 例,node --test 全绿)。
- test-subscribe 管理接口支持 vars 覆盖并返回真实发送值,方便站长核对字段名。

部署流程(Gitea Actions 容器里没有 buildx 插件,旧流程在此硬失败):
- 每个 job 各自安装/探测 docker-buildx(v0.19.3,走 gh-proxy 再退直连),
  不把 `buildx version` 当唯一依据;装不上时降级为普通 `docker build` 继续发布,
  不再因为缺插件整条流水线失败。

注意:SONG_SELECTED 的字段名(thing2/date4/time1/character_string3/phrase5)是按常见
命名推断的,需在公众平台后台核对;不一致时用环境变量覆盖,模板 ID 变更后老用户需重新授权。
This commit is contained in:
2026-10-11 00:04:14 +08:00
parent ebf1c3a127
commit 3eff710d5d
31 changed files with 659 additions and 189 deletions
-42
View File
@@ -1,42 +0,0 @@
<template>
<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" style="display:block; width:100%; height:auto; max-width:100%; max-width:320px; margin:0 auto;">
<defs>
<linearGradient id="petalGrad" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#A855F7"/>
<stop offset="50%" stop-color="#EC4899"/>
<stop offset="100%" stop-color="#3B82F6"/>
</linearGradient>
<linearGradient id="micGrad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#1f2937"/>
<stop offset="100%" stop-color="#111827"/>
</linearGradient>
</defs>
<ellipse cx="200" cy="80" rx="50" ry="110" fill="url(#petalGrad)" opacity="0.92" transform="rotate(0 200 190)"/>
<ellipse cx="200" cy="80" rx="50" ry="110" fill="url(#petalGrad)" opacity="0.92" transform="rotate(60 200 190)"/>
<ellipse cx="200" cy="80" rx="50" ry="110" fill="url(#petalGrad)" opacity="0.92" transform="rotate(120 200 190)"/>
<ellipse cx="200" cy="80" rx="50" ry="110" fill="url(#petalGrad)" opacity="0.92" transform="rotate(180 200 190)"/>
<ellipse cx="200" cy="80" rx="50" ry="110" fill="url(#petalGrad)" opacity="0.92" transform="rotate(240 200 190)"/>
<ellipse cx="200" cy="80" rx="50" ry="110" fill="url(#petalGrad)" opacity="0.92" transform="rotate(300 200 190)"/>
<circle cx="310" cy="190" r="4" fill="url(#petalGrad)"/>
<circle cx="255" cy="285.26" r="4" fill="url(#petalGrad)"/>
<circle cx="145" cy="285.26" r="4" fill="url(#petalGrad)"/>
<circle cx="90" cy="190" r="4" fill="url(#petalGrad)"/>
<circle cx="145" cy="94.74" r="4" fill="url(#petalGrad)"/>
<circle cx="255" cy="94.74" r="4" fill="url(#petalGrad)"/>
<circle cx="200" cy="200" r="170" stroke="url(#petalGrad)" stroke-width="1" stroke-dasharray="2 6" fill="none"/>
<circle cx="200" cy="200" r="185" stroke="url(#petalGrad)" stroke-width="1" stroke-dasharray="2 6" fill="none"/>
<circle cx="200" cy="200" r="200" stroke="url(#petalGrad)" stroke-width="1" stroke-dasharray="2 6" fill="none"/>
<circle cx="200" cy="190" r="46" fill="#ffffff" stroke="url(#petalGrad)" stroke-width="3"/>
<circle cx="200" cy="190" r="28" fill="url(#micGrad)"/>
<rect x="195" y="216" width="10" height="80" rx="5" fill="#1f2937"/>
<rect x="170" y="288" width="60" height="10" rx="5" fill="#111827"/>
<line x1="150" y1="304" x2="250" y2="304" stroke="#D1D5DB" stroke-width="2" stroke-linecap="round"/>
</svg>
</template>
<script setup lang="ts">
</script>
-40
View File
@@ -1,40 +0,0 @@
<template>
<nav
class="fixed bottom-0 left-0 right-0 z-40 lg:hidden bg-white border-t border-gray-200 px-4 py-2 pb-[max(8px,env(safe-area-inset-bottom))] backdrop-blur-sm shadow-[0_-2px_16px_rgba(0,0,0,0.04)]"
>
<div class="grid grid-cols-3 gap-2">
<button
type="button"
class="flex flex-col items-center justify-center gap-1 py-1 text-gray-500"
@click="$emit('navigate', 'request-section')"
>
<Music :size="20" />
<span class="text-[11px] font-semibold">点歌</span>
</button>
<button
type="button"
class="flex flex-col items-center justify-center gap-1 py-1 text-gray-500"
@click="$emit('navigate', 'schedule-section')"
>
<CalendarDays :size="20" />
<span class="text-[11px] font-semibold">排期</span>
</button>
<button
type="button"
class="flex flex-col items-center justify-center gap-1 py-1 text-gray-500"
@click="$emit('navigate', 'account')"
>
<User :size="20" />
<span class="text-[11px] font-semibold">我的</span>
</button>
</div>
</nav>
</template>
<script setup>
import { Music, CalendarDays, User } from '@lucide/vue'
defineEmits(['navigate'])
</script>