guoziyun před 9 měsíci
rodič
revize
4091ca206c

+ 1 - 1
oms/dist/src/controllers/messageTemplateController.js

@@ -14,7 +14,7 @@ class MessageTemplateController {
      */
     async createTemplate(req, res) {
         try {
-            const { templateName, messageTitle, messageContent, templateType, image, bigger, action, param, extend } = req.body;
+            const { templateName, messageTitle, messageContent, templateType } = req.body;
             // 验证必需字段
             if (!templateName || !messageTitle || !messageContent || typeof templateType === "undefined") {
                 res.status(400).json({ message: "templateName, messageTitle, messageContent 和 templateType 都是必需的。" });

+ 22 - 17
oms/dist/src/models/messageTemplateModel.js

@@ -40,30 +40,34 @@ const mongoose_1 = __importStar(require("mongoose"));
 var TemplateType;
 (function (TemplateType) {
     TemplateType[TemplateType["OTHER"] = 0] = "OTHER";
-    TemplateType[TemplateType["NEW_PAINTING_REMINDER"] = 1] = "NEW_PAINTING_REMINDER";
-    TemplateType[TemplateType["DAILY_SIGN_IN_REWARD"] = 2] = "DAILY_SIGN_IN_REWARD";
-    TemplateType[TemplateType["COMPLETION_ENCOURAGEMENT"] = 3] = "COMPLETION_ENCOURAGEMENT";
-    TemplateType[TemplateType["LIMITED_TIME_EVENT_REMINDER"] = 4] = "LIMITED_TIME_EVENT_REMINDER";
-    TemplateType[TemplateType["NEW_FEATURE_INTRODUCTION"] = 5] = "NEW_FEATURE_INTRODUCTION";
-    TemplateType[TemplateType["SOCIAL_SHARING_ENCOURAGEMENT"] = 6] = "SOCIAL_SHARING_ENCOURAGEMENT";
-    TemplateType[TemplateType["LONG_TIME_INACTIVE_USER_RECALL"] = 7] = "LONG_TIME_INACTIVE_USER_RECALL";
-    TemplateType[TemplateType["HOT_PAINTING_RECOMMENDATION"] = 8] = "HOT_PAINTING_RECOMMENDATION";
-    TemplateType[TemplateType["CHALLENGE_TASK_REMINDER"] = 9] = "CHALLENGE_TASK_REMINDER";
-    TemplateType[TemplateType["HOLIDAY_CELEBRATION"] = 10] = "HOLIDAY_CELEBRATION";
+    TemplateType[TemplateType["NEW_USER_WELCOM"] = 1] = "NEW_USER_WELCOM";
+    TemplateType[TemplateType["ENCOURAGE_AND_REWARD"] = 2] = "ENCOURAGE_AND_REWARD";
+    TemplateType[TemplateType["DAILY_REWARD_REMINDER"] = 3] = "DAILY_REWARD_REMINDER";
+    TemplateType[TemplateType["PERSONALIZED_RECOMMENDATION"] = 4] = "PERSONALIZED_RECOMMENDATION";
+    TemplateType[TemplateType["NEW_CONTENT_REMINDER"] = 5] = "NEW_CONTENT_REMINDER";
+    TemplateType[TemplateType["HOT_CONTENT_RECOMMENDATION"] = 6] = "HOT_CONTENT_RECOMMENDATION";
+    TemplateType[TemplateType["LIMITED_TIME_EVENT_REMINDER"] = 7] = "LIMITED_TIME_EVENT_REMINDER";
+    TemplateType[TemplateType["HOLIDAY_CELEBRATION"] = 8] = "HOLIDAY_CELEBRATION";
+    TemplateType[TemplateType["COMPLETION_ENCOURAGEMENT"] = 9] = "COMPLETION_ENCOURAGEMENT";
+    TemplateType[TemplateType["SOCIAL_SHARING_ENCOURAGEMENT"] = 10] = "SOCIAL_SHARING_ENCOURAGEMENT";
+    TemplateType[TemplateType["NEW_FEATURE_INTRODUCTION"] = 11] = "NEW_FEATURE_INTRODUCTION";
+    TemplateType[TemplateType["CHALLENGE_TASK_REMINDER"] = 12] = "CHALLENGE_TASK_REMINDER";
 })(TemplateType || (exports.TemplateType = TemplateType = {}));
 // 定义模板类型和中文描述的映射,方便在应用中使用
 exports.TEMPLATE_TYPE_MAP = {
     [TemplateType.OTHER]: "其他",
-    [TemplateType.NEW_PAINTING_REMINDER]: "新画作提醒",
-    [TemplateType.DAILY_SIGN_IN_REWARD]: "每日签到奖励",
-    [TemplateType.COMPLETION_ENCOURAGEMENT]: "完成度鼓励",
+    [TemplateType.NEW_USER_WELCOM]: "欢迎与引导",
+    [TemplateType.ENCOURAGE_AND_REWARD]: "鼓励与奖励",
+    [TemplateType.DAILY_REWARD_REMINDER]: "每日奖励提醒",
+    [TemplateType.PERSONALIZED_RECOMMENDATION]: "个性化推荐",
+    [TemplateType.NEW_CONTENT_REMINDER]: "新画作提醒",
+    [TemplateType.HOT_CONTENT_RECOMMENDATION]: "热门画作推荐",
     [TemplateType.LIMITED_TIME_EVENT_REMINDER]: "限时活动提醒",
-    [TemplateType.NEW_FEATURE_INTRODUCTION]: "新功能介绍",
+    [TemplateType.HOLIDAY_CELEBRATION]: "假日/节日主题",
+    [TemplateType.COMPLETION_ENCOURAGEMENT]: "完成度鼓励",
     [TemplateType.SOCIAL_SHARING_ENCOURAGEMENT]: "社交分享鼓励",
-    [TemplateType.LONG_TIME_INACTIVE_USER_RECALL]: "长期未活跃用户召回",
-    [TemplateType.HOT_PAINTING_RECOMMENDATION]: "热门画作推荐",
+    [TemplateType.NEW_FEATURE_INTRODUCTION]: "新功能介绍",
     [TemplateType.CHALLENGE_TASK_REMINDER]: "挑战任务提醒",
-    [TemplateType.HOLIDAY_CELEBRATION]: "节日/特殊日庆贺",
 };
 // 定义消息模板的 Mongoose Schema,并新增字段
 const MessageTemplateSchema = new mongoose_1.Schema({
@@ -74,6 +78,7 @@ const MessageTemplateSchema = new mongoose_1.Schema({
         enum: Object.values(TemplateType).filter((value) => typeof value === "number"), // 使用枚举值来约束此字段
         default: TemplateType.OTHER,
     },
+    description: { type: String }, // 描述
     messageTitle: { type: Object, of: String, required: true }, // 消息标题,使用嵌套对象支持多语言
     messageContent: { type: Object, of: String, required: true }, // 消息内容,使用嵌套对象支持多语言
     image: { type: String }, // 通知图片URL

+ 1 - 1
oms/public/app/index.html

@@ -9,5 +9,5 @@
   <style>body,html{width:100%;height:100%}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}body{margin:0;color:#000000d9;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#fff;font-feature-settings:"tnum"}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}</style><link rel="stylesheet" href="styles-LXBSU6DF.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-LXBSU6DF.css"></noscript></head>
   <body>
     <app-root></app-root>
-  <script src="polyfills-B6TNHZQ6.js" type="module"></script><script src="main-BC2NY3E3.js" type="module"></script></body>
+  <script src="polyfills-B6TNHZQ6.js" type="module"></script><script src="main-BHQBQNRH.js" type="module"></script></body>
 </html>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
oms/public/app/main-BHQBQNRH.js


+ 1 - 1
oms/src/controllers/messageTemplateController.ts

@@ -12,7 +12,7 @@ class MessageTemplateController {
    */
   public async createTemplate(req: Request, res: Response): Promise<void> {
     try {
-      const { templateName, messageTitle, messageContent, templateType, image, bigger, action, param, extend } = req.body;
+      const { templateName, messageTitle, messageContent, templateType } = req.body;
 
       // 验证必需字段
       if (!templateName || !messageTitle || !messageContent || typeof templateType === "undefined") {

+ 23 - 17
oms/src/models/messageTemplateModel.ts

@@ -10,37 +10,42 @@ interface ILocalizedStrings {
 // 定义模板类型的枚举,确保数据的一致性
 export enum TemplateType {
   OTHER = 0,
-  NEW_PAINTING_REMINDER = 1, // 新画作提醒
-  DAILY_SIGN_IN_REWARD = 2, // 每日签到奖励
-  COMPLETION_ENCOURAGEMENT = 3, // 完成度鼓励
-  LIMITED_TIME_EVENT_REMINDER = 4, // 限时活动提醒
-  NEW_FEATURE_INTRODUCTION = 5, // 新功能介绍
-  SOCIAL_SHARING_ENCOURAGEMENT = 6, // 社交分享鼓励
-  LONG_TIME_INACTIVE_USER_RECALL = 7, // 长期未活跃用户召回
-  HOT_PAINTING_RECOMMENDATION = 8, // 热门画作推荐
-  CHALLENGE_TASK_REMINDER = 9, // 挑战任务提醒
-  HOLIDAY_CELEBRATION = 10, // 节日/特殊日庆贺
+  NEW_USER_WELCOM = 1, // 欢迎与引导
+  ENCOURAGE_AND_REWARD = 2, // 鼓励与奖励
+  DAILY_REWARD_REMINDER = 3, // 每日奖励提醒
+  PERSONALIZED_RECOMMENDATION = 4, // 个性化推荐
+  NEW_CONTENT_REMINDER = 5, // 新画作提醒
+  HOT_CONTENT_RECOMMENDATION = 6, // 热门画作推荐
+  LIMITED_TIME_EVENT_REMINDER = 7, // 限时活动提醒
+  HOLIDAY_CELEBRATION = 8, // 节日/特殊日庆贺
+  COMPLETION_ENCOURAGEMENT = 9, // 完成度鼓励
+  SOCIAL_SHARING_ENCOURAGEMENT = 10, // 社交分享鼓励
+  NEW_FEATURE_INTRODUCTION = 11, // 新功能介绍
+  CHALLENGE_TASK_REMINDER = 12, // 挑战任务提醒
 }
 
 // 定义模板类型和中文描述的映射,方便在应用中使用
 export const TEMPLATE_TYPE_MAP: Record<TemplateType, string> = {
   [TemplateType.OTHER]: "其他",
-  [TemplateType.NEW_PAINTING_REMINDER]: "新画作提醒",
-  [TemplateType.DAILY_SIGN_IN_REWARD]: "每日签到奖励",
-  [TemplateType.COMPLETION_ENCOURAGEMENT]: "完成度鼓励",
+  [TemplateType.NEW_USER_WELCOM]: "欢迎与引导",
+  [TemplateType.ENCOURAGE_AND_REWARD]: "鼓励与奖励",
+  [TemplateType.DAILY_REWARD_REMINDER]: "每日奖励提醒",
+  [TemplateType.PERSONALIZED_RECOMMENDATION]: "个性化推荐",
+  [TemplateType.NEW_CONTENT_REMINDER]: "新画作提醒",
+  [TemplateType.HOT_CONTENT_RECOMMENDATION]: "热门画作推荐",
   [TemplateType.LIMITED_TIME_EVENT_REMINDER]: "限时活动提醒",
-  [TemplateType.NEW_FEATURE_INTRODUCTION]: "新功能介绍",
+  [TemplateType.HOLIDAY_CELEBRATION]: "假日/节日主题",
+  [TemplateType.COMPLETION_ENCOURAGEMENT]: "完成度鼓励",
   [TemplateType.SOCIAL_SHARING_ENCOURAGEMENT]: "社交分享鼓励",
-  [TemplateType.LONG_TIME_INACTIVE_USER_RECALL]: "长期未活跃用户召回",
-  [TemplateType.HOT_PAINTING_RECOMMENDATION]: "热门画作推荐",
+  [TemplateType.NEW_FEATURE_INTRODUCTION]: "新功能介绍",
   [TemplateType.CHALLENGE_TASK_REMINDER]: "挑战任务提醒",
-  [TemplateType.HOLIDAY_CELEBRATION]: "节日/特殊日庆贺",
 };
 
 // 定义消息模板的接口,并新增字段
 export interface IMessageTemplate extends Document {
   templateName: string;
   templateType: TemplateType; // 新增字段:模板类型
+  description: string; // 描述
   messageTitle: ILocalizedStrings;
   messageContent: ILocalizedStrings;
   image?: string; // 通知图片URL
@@ -62,6 +67,7 @@ const MessageTemplateSchema: Schema = new Schema(
       enum: Object.values(TemplateType).filter((value) => typeof value === "number"), // 使用枚举值来约束此字段
       default: TemplateType.OTHER,
     },
+    description: { type: String }, // 描述
     messageTitle: { type: Object, of: String, required: true }, // 消息标题,使用嵌套对象支持多语言
     messageContent: { type: Object, of: String, required: true }, // 消息内容,使用嵌套对象支持多语言
     image: { type: String }, // 通知图片URL

+ 28 - 4
omsapp/src/app/pages/message-template.component.ts

@@ -150,7 +150,17 @@ import {
             @for (template of templatesTable.data; track template.templateName)
             {
             <tr>
-              <td>{{ template.templateName }}</td>
+              <!-- <td>{{ template.templateName }}</td> -->
+              <td class="message-content-cell">
+                <div class="message-title">
+                  <a (click)="showDetailModal(template)">{{
+                    template.templateName
+                  }}</a>
+                </div>
+                <div class="message-content">
+                  {{ template.description }}
+                </div>
+              </td>
               <td>
                 <nz-tag
                   [nzColor]="'blue'"
@@ -186,8 +196,6 @@ import {
               <td style="text-align: center;">
                 <a (click)="showEditModal(template)">编辑</a>
                 <nz-divider nzType="vertical"></nz-divider>
-                <a (click)="showDetailModal(template)">详情</a>
-                <nz-divider nzType="vertical"></nz-divider>
                 <a
                   nz-popconfirm
                   nzPopconfirmTitle="确定要删除此模板吗?"
@@ -248,7 +256,17 @@ import {
           </nz-form-control>
         </nz-form-item>
 
-        <!-- 新增字段 -->
+        <nz-form-item>
+          <nz-form-label>描述</nz-form-label>
+          <nz-form-control>
+            <input
+              nz-input
+              formControlName="description"
+              placeholder="输入描述(可选)"
+            />
+          </nz-form-control>
+        </nz-form-item>
+
         <nz-form-item>
           <nz-form-label>图片URL</nz-form-label>
           <nz-form-control>
@@ -378,6 +396,10 @@ import {
             </nz-tag>
           </nz-descriptions-item>
 
+          <nz-descriptions-item nzTitle="描述">
+            {{ selectedTemplate?.description }}
+          </nz-descriptions-item>
+
           @if (selectedTemplate?.image) {
           <nz-descriptions-item nzTitle="图片">
             <img
@@ -535,6 +557,7 @@ export class MessageTemplateComponent implements OnInit, OnDestroy {
         [Validators.required, Validators.pattern(/^[a-zA-Z0-9_-]+$/)],
       ],
       templateType: [TemplateType.OTHER, Validators.required],
+      description: [null],
       image: [null],
       bigger: [false],
       action: [null],
@@ -777,6 +800,7 @@ export class MessageTemplateComponent implements OnInit, OnDestroy {
     const messageData = {
       templateName: formValue.templateName,
       templateType: formValue.templateType,
+      description: formValue.description,
       image: formValue.image,
       bigger: formValue.bigger,
       action: formValue.action,

+ 23 - 19
omsapp/src/app/services/message.service.ts

@@ -5,35 +5,37 @@ import { Observable } from 'rxjs';
 // 定义模板类型枚举
 export enum TemplateType {
   OTHER = 0,
-  NEW_PAINTING_REMINDER = 1,
-  DAILY_SIGN_IN_REWARD = 2,
-  COMPLETION_ENCOURAGEMENT = 3,
-  LIMITED_TIME_EVENT_REMINDER = 4,
-  NEW_FEATURE_INTRODUCTION = 5,
-  SOCIAL_SHARING_ENCOURAGEMENT = 6,
-  LONG_TIME_INACTIVE_USER_RECALL = 7,
-  HOT_PAINTING_RECOMMENDATION = 8,
-  CHALLENGE_TASK_REMINDER = 9,
-  HOLIDAY_CELEBRATION = 10,
+  NEW_USER_WELCOM = 1, // 欢迎与引导
+  ENCOURAGE_AND_REWARD = 2, // 鼓励与奖励
+  DAILY_REWARD_REMINDER = 3, // 每日奖励提醒
+  PERSONALIZED_RECOMMENDATION = 4, // 个性化推荐
+  NEW_CONTENT_REMINDER = 5, // 新画作提醒
+  HOT_CONTENT_RECOMMENDATION = 6, // 热门画作推荐
+  LIMITED_TIME_EVENT_REMINDER = 7, // 限时活动提醒
+  HOLIDAY_CELEBRATION = 8, // 节日/特殊日庆贺
+  COMPLETION_ENCOURAGEMENT = 9, // 完成度鼓励
+  SOCIAL_SHARING_ENCOURAGEMENT = 10, // 社交分享鼓励
+  NEW_FEATURE_INTRODUCTION = 11, // 新功能介绍
+  CHALLENGE_TASK_REMINDER = 12, // 挑战任务提醒
 }
 
 // 定义模板类型映射
 export const TEMPLATE_TYPE_MAP: Record<TemplateType, string> = {
   [TemplateType.OTHER]: '其他',
-  [TemplateType.NEW_PAINTING_REMINDER]: '新画作提醒',
-  [TemplateType.DAILY_SIGN_IN_REWARD]: '每日签到奖励',
-  [TemplateType.COMPLETION_ENCOURAGEMENT]: '完成度鼓励',
+  [TemplateType.NEW_USER_WELCOM]: '欢迎与引导',
+  [TemplateType.ENCOURAGE_AND_REWARD]: '鼓励与奖励',
+  [TemplateType.DAILY_REWARD_REMINDER]: '每日奖励提醒',
+  [TemplateType.PERSONALIZED_RECOMMENDATION]: '个性化推荐',
+  [TemplateType.NEW_CONTENT_REMINDER]: '新画作提醒',
+  [TemplateType.HOT_CONTENT_RECOMMENDATION]: '热门画作推荐',
   [TemplateType.LIMITED_TIME_EVENT_REMINDER]: '限时活动提醒',
-  [TemplateType.NEW_FEATURE_INTRODUCTION]: '新功能介绍',
+  [TemplateType.HOLIDAY_CELEBRATION]: '假日/节日主题',
+  [TemplateType.COMPLETION_ENCOURAGEMENT]: '完成度鼓励',
   [TemplateType.SOCIAL_SHARING_ENCOURAGEMENT]: '社交分享鼓励',
-  [TemplateType.LONG_TIME_INACTIVE_USER_RECALL]: '长期未活跃用户召回',
-  [TemplateType.HOT_PAINTING_RECOMMENDATION]: '热门画作推荐',
+  [TemplateType.NEW_FEATURE_INTRODUCTION]: '新功能介绍',
   [TemplateType.CHALLENGE_TASK_REMINDER]: '挑战任务提醒',
-  [TemplateType.HOLIDAY_CELEBRATION]: '节日/特殊日庆贺',
 };
 
-// ...其他导入保持不变...
-
 // 新增 ActionType 枚举和映射
 export enum ActionType {
   GO_APP = 'go/app',
@@ -64,6 +66,7 @@ export interface IMessageTemplate {
   _id: string;
   templateName: string;
   templateType: TemplateType;
+  description: string;
   messageTitle: { [key: string]: string };
   messageContent: { [key: string]: string };
   image?: string;
@@ -79,6 +82,7 @@ export interface IMessageTemplate {
 export interface MessageTemplateData {
   templateName: string;
   templateType: TemplateType;
+  descritpion: string;
   messageTitle: { [key: string]: string };
   messageContent: { [key: string]: string };
   image?: string;

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů