|
| 1 | +import { inject, singleton } from 'tsyringe'; |
| 2 | +import { Combine } from '../../utils/combine.js'; |
| 3 | +import { generic } from '../../decorators/eacnet.js'; |
| 4 | +import { Serializable, v } from '../../utils/kxml-value.js'; |
| 5 | +import { EacGeneric } from '../eac-generic.js'; |
| 6 | +import * as data from '../../datas/ddr.js'; |
| 7 | +import { User } from './user.js'; |
| 8 | +import { UserService } from '../../services/ddr/user.js'; |
| 9 | +import { Context } from '../../types.js'; |
| 10 | + |
| 11 | +@singleton() |
| 12 | +export default class extends Combine(User, EacGeneric) { |
| 13 | + constructor( |
| 14 | + @inject(UserService) private readonly userService: UserService, |
| 15 | + ) { |
| 16 | + super(); |
| 17 | + |
| 18 | + this.userService; |
| 19 | + } |
| 20 | + |
| 21 | + @generic() |
| 22 | + async getItemList(): Promise<Serializable> { |
| 23 | + return { |
| 24 | + status: v.s32(0), |
| 25 | + error_code: v.s32(0), |
| 26 | + response: { |
| 27 | + item_num: v.s32(1), |
| 28 | + item: { |
| 29 | + item_id: v.str('DDR_TICKET'), |
| 30 | + not_free_count: v.s32(114514), |
| 31 | + free_count: v.s32(0), |
| 32 | + buyable_point: v.s32(9999999), |
| 33 | + }, |
| 34 | + }, |
| 35 | + }; |
| 36 | + } |
| 37 | + |
| 38 | + @generic() |
| 39 | + async tabooword_2_check(): Promise<Serializable> { |
| 40 | + return { |
| 41 | + status: v.s32(0), |
| 42 | + error_code: v.s32(0), |
| 43 | + xrpc_status_code: v.s32(0), |
| 44 | + xrpc_fault_code: v.s32(0), |
| 45 | + response: { |
| 46 | + tabooword_2: { |
| 47 | + $status: 0, |
| 48 | + is_taboo: v.bool(false), |
| 49 | + }, |
| 50 | + }, |
| 51 | + }; |
| 52 | + } |
| 53 | + |
| 54 | + @generic() |
| 55 | + async log_2_save(): Promise<Serializable> { |
| 56 | + return { |
| 57 | + status: v.s32(0), |
| 58 | + error_code: v.s32(0), |
| 59 | + xrpc_status_code: v.s32(0), |
| 60 | + xrpc_fault_code: v.s32(0), |
| 61 | + response: { |
| 62 | + log_2: { |
| 63 | + $status: 0, |
| 64 | + }, |
| 65 | + }, |
| 66 | + }; |
| 67 | + } |
| 68 | + |
| 69 | + @generic() |
| 70 | + async getprev(): Promise<Serializable> { |
| 71 | + return { |
| 72 | + status: v.s32(0), |
| 73 | + error_code: v.s32(0), |
| 74 | + xrpc_status_code: v.s32(0), |
| 75 | + xrpc_fault_code: v.s32(0), |
| 76 | + response: { |
| 77 | + fileinfo_2: { |
| 78 | + $status: 0, |
| 79 | + soundinfo: data.previewSoundInfos, |
| 80 | + }, |
| 81 | + }, |
| 82 | + }; |
| 83 | + } |
| 84 | + |
| 85 | + @generic() |
| 86 | + async getmain(ctx: Context): Promise<Serializable> { |
| 87 | + const mcode = ctx.body.data.mcode as number; |
| 88 | + const result = data.mainSoundInfoMap.get(mcode); |
| 89 | + |
| 90 | + return { |
| 91 | + status: v.s32(0), |
| 92 | + error_code: v.s32(0), |
| 93 | + xrpc_status_code: v.s32(0), |
| 94 | + xrpc_fault_code: v.s32(0), |
| 95 | + response: { |
| 96 | + fileinfo_2: { |
| 97 | + $status: 0, |
| 98 | + soundinfo: result, |
| 99 | + }, |
| 100 | + }, |
| 101 | + }; |
| 102 | + } |
| 103 | + |
| 104 | + @generic() |
| 105 | + async getmusic(): Promise<Serializable> { |
| 106 | + return { |
| 107 | + status: v.s32(0), |
| 108 | + error_code: v.s32(0), |
| 109 | + xrpc_status_code: v.s32(0), |
| 110 | + xrpc_fault_code: v.s32(0), |
| 111 | + response: { |
| 112 | + data_2: { |
| 113 | + $status: 0, |
| 114 | + mdb: { |
| 115 | + music: data.musics, |
| 116 | + }, |
| 117 | + }, |
| 118 | + }, |
| 119 | + }; |
| 120 | + } |
| 121 | + |
| 122 | + @generic() |
| 123 | + async getGoodsList(): Promise<Serializable> { |
| 124 | + return { |
| 125 | + status: v.s32(0), |
| 126 | + error_code: v.s32(0), |
| 127 | + response: { |
| 128 | + goods_num: v.s32(3), |
| 129 | + goods: [{ |
| 130 | + goods_id: v.str('G0000001'), |
| 131 | + item_id: v.str('DDR_TICKET'), |
| 132 | + price: v.s32(1), |
| 133 | + }, { |
| 134 | + goods_id: v.str('G0000002'), |
| 135 | + item_id: v.str('DDR_TICKET'), |
| 136 | + price: v.s32(1), |
| 137 | + }, { |
| 138 | + goods_id: v.str('G0000003'), |
| 139 | + item_id: v.str('DDR_TICKET'), |
| 140 | + price: v.s32(1), |
| 141 | + }], |
| 142 | + }, |
| 143 | + }; |
| 144 | + } |
| 145 | +} |
0 commit comments