roleOperate.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. import { request } from 'umi';
  2. import { api } from '../api';
  3. import { Paging, SortProps } from './rankingList';
  4. let wapi = api + '/gameData'
  5. export interface RoleRechargeRankingProps extends Paging, SortProps {
  6. createRoleBeginDate?: string, // 角色创建时间(开始)
  7. createRoleEndDate?: string,
  8. rechargeBeginDate?: string, // 充值开始时间
  9. rechargeEndDate?: string,
  10. customerServerId?: number, // 客服ID
  11. operatorId?: number // 运营ID
  12. gsId?: number // GS_ID
  13. serverIds?: number[] // 区服ID(列表)
  14. gameId?: number, // 子游戏ID
  15. parentGameId?: number, // 父游戏ID
  16. isChange?: number, // 是否转端: 1 -> 转端 ; 0 -> 不转端
  17. isSendMail?: number // 邮件是否发送: 1 -> 发送 ; 0 -> 不发送
  18. phone?: number // 客户手机号
  19. pitcherId?: number // 投手ID
  20. roleName?: string, // 角色名
  21. roleId?: string, // 角色ID
  22. vipLevel?: number // 角色VIP等级
  23. weChat?: string, // 客户微信号
  24. weChatCompany?: string, // 企业微信号
  25. }
  26. /**
  27. * 角色充值排行榜
  28. * @param data
  29. * @returns
  30. */
  31. export async function getRoleRechargeRankingListApi(data: RoleRechargeRankingProps) {
  32. return request(wapi + `/role/rechargeRanking`, {
  33. method: 'POST',
  34. data
  35. });
  36. }
  37. /**
  38. * 礼包记录新增或者更新
  39. * @param data
  40. * @returns
  41. */
  42. export async function addOrUpdateGiftApi(data: { giftId: number, ids?: number[], roleInfoList: any[], sendTime: string }) {
  43. return request(api + `/manage/role/gift/record/add/or/update`, {
  44. method: 'POST',
  45. data
  46. });
  47. }
  48. /**
  49. * 删除礼包记录
  50. * @param ids
  51. * @returns
  52. */
  53. export async function delSendGiftLogApi(ids: string) {
  54. return request(api + `/manage/role/gift/record/delete/${ids}`, {
  55. method: 'DELETE'
  56. });
  57. }
  58. export interface getSendGiftLogProps extends Paging {
  59. startDateTime?: string,
  60. endDateTime?: string,
  61. giftName?: string,
  62. gameId?: number,
  63. roleId?: number,
  64. serverId?: number
  65. userId?: number
  66. }
  67. /**
  68. * 发送礼包记录接口
  69. * @param data
  70. * @returns
  71. */
  72. export async function getSendGiftLogListApi(data: getSendGiftLogProps) {
  73. return request(api + `/manage/role/gift/record/list`, {
  74. method: 'POST',
  75. data
  76. });
  77. }
  78. export interface getSendEmailLogProps extends Paging {
  79. startDateTime?: string,
  80. endDateTime?: string,
  81. gameId?: number,
  82. roleId?: number,
  83. serverId?: number
  84. userId?: number
  85. }
  86. /**
  87. * 发送邮件记录接口
  88. * @param data
  89. * @returns
  90. */
  91. export async function getSendEmailListApi(data: getSendEmailLogProps) {
  92. return request(api + `/manage/role/mail/record/list`, {
  93. method: 'POST',
  94. data
  95. });
  96. }
  97. /**
  98. * 删除邮件记录
  99. * @param ids
  100. * @returns
  101. */
  102. export async function delSendEmailLogApi(ids: string) {
  103. return request(api + `/manage/role/mail/record/delete/${ids}`, {
  104. method: 'DELETE'
  105. });
  106. }
  107. /**
  108. * 邮件记录新增或者更新
  109. * @param data
  110. * @returns
  111. */
  112. export async function addOrUpdateEmailApi(data: { ids?: number[], roleInfoList: any[], sendTime: string }) {
  113. return request(api + `/manage/role/mail/record/add/or/update`, {
  114. method: 'POST',
  115. data
  116. });
  117. }
  118. export interface modifyRoleProps {
  119. addCorpUserId?: string // 企微号
  120. isAddCorpWechat?: string
  121. isChangeGameType?: string
  122. isRemoveGame?: string
  123. isWakeUp?: string
  124. putUserId?: number
  125. remark?: string
  126. roleInfoList?: any
  127. userPhone?: string
  128. userWechat?: string
  129. }
  130. /**
  131. * 角色信息管理
  132. * @param data
  133. * @returns
  134. */
  135. export async function modifyRoleDataApi(data: modifyRoleProps) {
  136. return request(api + `/manage/role/operate/modify`, {
  137. method: 'POST',
  138. data
  139. });
  140. }
  141. export interface AssignUserProps {
  142. startTime: string,
  143. customerServiceId?: number,
  144. gsId?: number,
  145. operUserId?: number,
  146. remark?: string,
  147. roleInfoAndAgentParamList: any
  148. }
  149. /**
  150. * 指派
  151. * @param data
  152. * @returns
  153. */
  154. export async function addAssignUserApi(data: AssignUserProps) {
  155. return request(api + `/manage/role/assign/record/config/sysUser`, {
  156. method: 'POST',
  157. data
  158. });
  159. }
  160. /**
  161. * 删除
  162. * @param ids
  163. * @returns
  164. */
  165. export async function delAssignUserApi(ids: string) {
  166. return request(api + `/manage/role/assign/record/delete/${ids}`, {
  167. method: 'DELETE'
  168. });
  169. }
  170. export interface GetAssignUser extends Paging {
  171. customerServiceId?: number,
  172. gameId?: number,
  173. gsId?: number,
  174. operUserId?: number,
  175. regAgentId?: number,
  176. remark?: string,
  177. roleId?: number,
  178. serverId?: number,
  179. userId?: number
  180. }
  181. /**
  182. *
  183. * @param data
  184. * @returns
  185. */
  186. export async function getAssignUserApi(data: GetAssignUser) {
  187. return request(api + `/manage/role/assign/record/list`, {
  188. method: 'POST',
  189. data
  190. });
  191. }
  192. /**
  193. * 修改
  194. * @param data
  195. * @returns
  196. */
  197. export async function editAssignUserApi(data: AssignUserProps) {
  198. return request(api + `/manage/role/assign/record/modify`, {
  199. method: 'POST',
  200. data
  201. });
  202. }
  203. export interface GetCombatRankingProps extends Paging, SortProps {
  204. beginDate?: string, // 开服时间(开始)
  205. endDate?: string,
  206. gameId?: number, // 游戏ID
  207. parentGameId?: number // 主游戏ID
  208. rankingNum?: number // 排名的范围
  209. serverIds?: number[], // 区服
  210. isMergeServer?: boolean
  211. isParticipateMerge?: boolean
  212. }
  213. export async function getCombatRankingListApi(data: GetCombatRankingProps) {
  214. return request(wapi + `/role/combatRanking`, {
  215. method: 'POST',
  216. data
  217. });
  218. }
  219. /**
  220. * 游戏消息发送
  221. * @param data
  222. * @returns
  223. */
  224. export async function sendMsgTaskApi(data: { taskName: string, sendContent: string, roleIds: any[], roleRechargeRankingDTO: any }) {
  225. return request(wapi + `/role/sendMsgTask`, {
  226. method: 'POST',
  227. data
  228. });
  229. }
  230. /**
  231. * 任务列表
  232. * @param data
  233. * @returns
  234. */
  235. export async function getSendMsgTaskListApi(data: { gameId: number, pageNum: number, pageSize: number }) {
  236. return request(wapi + '/role/sendMsgTask/list', {
  237. method: 'POST',
  238. data
  239. });
  240. }
  241. /**
  242. * 发送记录
  243. * @param data
  244. * @returns
  245. */
  246. export async function getSendLogListApi(data: { taskId: number, pageNum: number, pageSize: number }) {
  247. return request(wapi + '/role/sendMsgTask/resultList', {
  248. method: 'POST',
  249. data
  250. });
  251. }
  252. let apiManage = api + '/manage'
  253. export interface GameServerListProps {
  254. pageNum: number,
  255. pageSize: number,
  256. startTime?: string,
  257. endTime?: string,
  258. gameId?: number,
  259. nickName?: string,
  260. serverId?: number,
  261. serverName?: string
  262. }
  263. /**
  264. * 游戏区服列表查询
  265. * @param data
  266. * @returns
  267. */
  268. export async function getGameServerListApi(data: GameServerListProps) {
  269. return request(apiManage + '/gameServer/list', {
  270. method: 'POST',
  271. data
  272. });
  273. }
  274. interface AeGameServerProps {
  275. gameId: number, // 游戏id
  276. serverName: string,// 区服名称
  277. serverId: string, // 区服id, 必传
  278. startTime: string, // 开服时间
  279. id?: number
  280. nickName?: string // 区服冠名
  281. }
  282. /**
  283. * 新增修改区服
  284. * @param data
  285. * @returns
  286. */
  287. export async function aeGameServerApi(data: AeGameServerProps) {
  288. return request(apiManage + '/gameServer/add/or/update', {
  289. method: 'POST',
  290. data
  291. });
  292. }
  293. /**
  294. * 删除游戏区服
  295. * @param params
  296. * @returns
  297. */
  298. export async function delGameServerApi(params: { id: number }) {
  299. return request(apiManage + '/gameServer/delete', {
  300. method: 'DELETE',
  301. params
  302. });
  303. }
  304. /**
  305. * 新增合服
  306. * @param params
  307. * @returns
  308. */
  309. export async function mergeAddOrUpdateApi(data: any) {
  310. return request(apiManage + '/gameServer/merge/add/or/update', {
  311. method: 'POST',
  312. data
  313. });
  314. }
  315. export async function uploadExcelServerApi({ formData, ...params }: any) {
  316. return request(apiManage + '/gameServer/add/excel', {
  317. method: 'POST',
  318. params,
  319. data: formData
  320. });
  321. }
  322. /**
  323. * 区服指派
  324. * @param data
  325. * @returns
  326. */
  327. export async function gameServerAssignApi(data: { assignType: string, assignUserIdList: number[], idList: number[] }) {
  328. return request(apiManage + '/gameServer/assign', {
  329. method: 'POST',
  330. data
  331. });
  332. }
  333. /**
  334. * 获取合服超父游戏列表
  335. * @param params
  336. * @returns
  337. */
  338. export async function gameSupperListApi() {
  339. return request(apiManage + '/gameServer/game/supper/list', {
  340. method: 'GET',
  341. });
  342. }
  343. /**
  344. * 获取合服超父游戏列表
  345. * @param params
  346. * @returns
  347. */
  348. export async function unMergeServerListApi(params: any) {
  349. return request(apiManage + '/gameServer/unMerge/server/list', {
  350. method: 'GET',
  351. params
  352. });
  353. }
  354. export interface PackProps {
  355. gameId: number,
  356. giftName: string, // 礼包名字
  357. id?: number
  358. }
  359. /**
  360. * 新增修改礼包
  361. * @param params
  362. * @returns
  363. */
  364. export async function addOrUpDatePackApi(params: PackProps) {
  365. return request(apiManage + '/game/gift/add/or/update', {
  366. method: 'POST',
  367. data: params
  368. })
  369. }
  370. /**
  371. * 删除礼包
  372. * @param ids
  373. * @returns
  374. */
  375. export async function delPackApi(ids: string) {
  376. return request(apiManage + `/game/gift/delete/${ids}`, {
  377. method: 'DELETE'
  378. })
  379. }
  380. export interface GetPackProps {
  381. pageNum: number,
  382. pageSize: number,
  383. giftName?: string,
  384. gameId?: number
  385. }
  386. /**
  387. * 获取礼包列表
  388. * @param data
  389. * @returns
  390. */
  391. export async function getPackListApi(data: GetPackProps) {
  392. return request(apiManage + `/game/gift/listOfPage`, {
  393. method: 'POST',
  394. data
  395. })
  396. }
  397. export interface CreateRoleConfigProps {
  398. pageNum: number,
  399. pageSize: number,
  400. gameId?: number
  401. }
  402. /**
  403. * 有效创角配置列表查询
  404. * @param data
  405. * @returns
  406. */
  407. export async function getCreateRoleConfigListApi(data: CreateRoleConfigProps) {
  408. // return request(apiManage + '/gameUser/config/list', {
  409. // method: 'POST',
  410. // data
  411. // });
  412. return request(wapi + '/gameUserConfig/list', {
  413. method: 'POST',
  414. data
  415. });
  416. }
  417. interface AeGameServerProps {
  418. gameId: number, // 游戏id
  419. roleLevel: number, // 游戏角色等级
  420. id?: number
  421. }
  422. /**
  423. * 新增或修改有效创角配置
  424. * @param data
  425. * @returns
  426. */
  427. export async function aeGameUserConfigApi(data: AeGameServerProps) {
  428. // return request(apiManage + '/gameUser/config/add/or/update', {
  429. // method: 'POST',
  430. // data
  431. // });
  432. if (data?.id) { // 修改
  433. return request(wapi + '/gameUserConfig/update', {
  434. method: 'POST',
  435. data
  436. });
  437. }
  438. return request(wapi + '/gameUserConfig/create', {
  439. method: 'POST',
  440. data
  441. });
  442. }
  443. /**
  444. * 有效创角配置服删除
  445. * @param params
  446. * @returns
  447. */
  448. export async function delGameUserConfigApi(params: { id: number }) {
  449. // return request(apiManage + '/gameUser/config/delete', {
  450. // method: 'DELETE',
  451. // params
  452. // });
  453. return request(wapi + '/gameUserConfig/delete', {
  454. method: 'POST',
  455. params
  456. });
  457. }
  458. export interface GameVipProps {
  459. pageNum: number,
  460. pageSize: number,
  461. parentGameId?: number
  462. superGameId?: number
  463. vipLevel?: number
  464. }
  465. /**
  466. * vip档位列表
  467. * @param data
  468. * @returns
  469. */
  470. export async function getGameVipApi(data: GameVipProps) {
  471. return request(apiManage + '/game/vip/list', {
  472. method: 'POST',
  473. data
  474. });
  475. }
  476. /**
  477. * 删除vip档位
  478. * @param ids
  479. * @returns
  480. */
  481. export async function delGameVipApi(ids: string) {
  482. return request(apiManage + `/game/vip/delete/${ids}`, {
  483. method: 'DELETE'
  484. });
  485. }
  486. export interface modalGameVipApi {
  487. parentGameId: number
  488. superGameId: number
  489. vipLevel: number
  490. rechargeMoneyMin: number
  491. rechargeMoneyMax: number
  492. id?: number
  493. }
  494. /**
  495. * 新增修改vip档位
  496. * @param data
  497. * @returns
  498. */
  499. export async function modalGameVipApi(data: modalGameVipApi) {
  500. return request(apiManage + '/game/vip/add/or/update', {
  501. method: 'POST',
  502. data
  503. });
  504. }
  505. export interface ModalGameVipSProps {
  506. list: {
  507. rechargeMoneyMax: number
  508. rechargeMoneyMin: number,
  509. vipLevel: number
  510. },
  511. parentGameId: number[]
  512. superGameId: number
  513. }
  514. /**
  515. * 批量新增vip挡位
  516. * @param data
  517. * @returns
  518. */
  519. export async function modalGameVipsApi(data: ModalGameVipSProps) {
  520. return request(apiManage + '/game/vip/add/batch', {
  521. method: 'POST',
  522. data
  523. });
  524. }
  525. export interface StrategyListProps extends Paging {
  526. superGameId?: number,
  527. type?: number
  528. }
  529. /**
  530. * 游戏策略配置列表
  531. * @param data
  532. * @returns
  533. */
  534. export async function getStrategyListApi(data: StrategyListProps) {
  535. return request(apiManage + '/game/policy/config/listOfPage', {
  536. method: 'POST',
  537. data
  538. });
  539. }
  540. /**
  541. * 删除策略配置
  542. * @param id
  543. * @returns
  544. */
  545. export async function delStrategyApi(id: number) {
  546. return request(apiManage + `/game/policy/config/deleteById/${id}`, {
  547. method: 'DELETE'
  548. });
  549. }
  550. export interface StrategyProps {
  551. superGameId: number
  552. amount: number
  553. configExplain?: string,
  554. time: number,
  555. type: number,
  556. id?: number
  557. }
  558. /**
  559. * 新增修改策略
  560. * @param data
  561. * @returns
  562. */
  563. export async function modalStrategyApi(data: StrategyProps) {
  564. return request(apiManage + '/game/policy/config/add/or/update', {
  565. method: 'POST',
  566. data
  567. });
  568. }