eight
2024-08-13 b10adc8a3fd000901836e2219fa83462694e9866
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
enum ReplyType {
  News = 'news',
  Image = 'image',
  Voice = 'voice',
  Video = 'video',
  Music = 'music',
  Text = 'text'
}
 
interface _Reply {
  accountId: number
  type: ReplyType
  name?: string | null
  content?: string | null
  mediaId?: string | null
  url?: string | null
  title?: string | null
  description?: string | null
  thumbMediaId?: string | null
  thumbMediaUrl?: string | null
  musicUrl?: string | null
  hqMusicUrl?: string | null
  introduction?: string | null
  articles?: any[]
}
 
type Reply = _Reply //Partial<_Reply>
 
enum NewsType {
  Published = '1',
  Draft = '2'
}
 
/** 利用旧的reply[accountId, type]初始化新的Reply */
const createEmptyReply = (old: Reply | Ref<Reply>): Reply => {
  return {
    accountId: unref(old).accountId,
    type: unref(old).type,
    name: null,
    content: null,
    mediaId: null,
    url: null,
    title: null,
    description: null,
    thumbMediaId: null,
    thumbMediaUrl: null,
    musicUrl: null,
    hqMusicUrl: null,
    introduction: null,
    articles: []
  }
}
 
export { Reply, NewsType, ReplyType, createEmptyReply }