roleOperate.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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. }
  212. export async function getCombatRankingListApi(data: GetCombatRankingProps) {
  213. return request(wapi + `/role/combatRanking`, {
  214. method: 'POST',
  215. data
  216. });
  217. }
  218. let apiManage = api + '/manage'
  219. export interface GameServerListProps {
  220. pageNum: number,
  221. pageSize: number,
  222. startTime?: string,
  223. endTime?: string,
  224. gameId?: number,
  225. nickName?: string,
  226. serverId?: number,
  227. serverName?: string
  228. }
  229. /**
  230. * 游戏区服列表查询
  231. * @param data
  232. * @returns
  233. */
  234. export async function getGameServerListApi(data: GameServerListProps) {
  235. return request(apiManage + '/gameServer/list', {
  236. method: 'POST',
  237. data
  238. });
  239. }
  240. interface AeGameServerProps {
  241. gameId: number, // 游戏id
  242. serverName: string,// 区服名称
  243. serverId: string, // 区服id, 必传
  244. startTime: string, // 开服时间
  245. id?: number
  246. nickName?: string // 区服冠名
  247. }
  248. /**
  249. * 新增修改区服
  250. * @param data
  251. * @returns
  252. */
  253. export async function aeGameServerApi(data: AeGameServerProps) {
  254. return request(apiManage + '/gameServer/add/or/update', {
  255. method: 'POST',
  256. data
  257. });
  258. }
  259. /**
  260. * 删除游戏区服
  261. * @param params
  262. * @returns
  263. */
  264. export async function delGameServerApi(params: { id: number }) {
  265. return request(apiManage + '/gameServer/delete', {
  266. method: 'DELETE',
  267. params
  268. });
  269. }
  270. /**
  271. * 新增合服
  272. * @param params
  273. * @returns
  274. */
  275. export async function mergeAddOrUpdateApi(data: any) {
  276. return request(apiManage + '/gameServer/merge/add/or/update', {
  277. method: 'POST',
  278. data
  279. });
  280. }
  281. export async function uploadExcelServerApi({ formData, ...params }: any) {
  282. return request(apiManage + '/gameServer/add/excel', {
  283. method: 'POST',
  284. params,
  285. data: formData
  286. });
  287. }
  288. /**
  289. * 获取合服超父游戏列表
  290. * @param params
  291. * @returns
  292. */
  293. export async function gameSupperListApi() {
  294. return request(apiManage + '/gameServer/game/supper/list', {
  295. method: 'GET',
  296. });
  297. }
  298. /**
  299. * 获取合服超父游戏列表
  300. * @param params
  301. * @returns
  302. */
  303. export async function unMergeServerListApi(params: any) {
  304. return request(apiManage + '/gameServer/unMerge/server/list', {
  305. method: 'GET',
  306. params
  307. });
  308. }
  309. export interface PackProps {
  310. gameId: number,
  311. giftName: string, // 礼包名字
  312. id?: number
  313. }
  314. /**
  315. * 新增修改礼包
  316. * @param params
  317. * @returns
  318. */
  319. export async function addOrUpDatePackApi(params: PackProps) {
  320. return request(apiManage + '/game/gift/add/or/update', {
  321. method: 'POST',
  322. data: params
  323. })
  324. }
  325. /**
  326. * 删除礼包
  327. * @param ids
  328. * @returns
  329. */
  330. export async function delPackApi(ids: string) {
  331. return request(apiManage + `/game/gift/delete/${ids}`, {
  332. method: 'DELETE'
  333. })
  334. }
  335. export interface GetPackProps {
  336. pageNum: number,
  337. pageSize: number,
  338. giftName?: string,
  339. gameId?: number
  340. }
  341. /**
  342. * 获取礼包列表
  343. * @param data
  344. * @returns
  345. */
  346. export async function getPackListApi(data: GetPackProps) {
  347. return request(apiManage + `/game/gift/listOfPage`, {
  348. method: 'POST',
  349. data
  350. })
  351. }
  352. export interface CreateRoleConfigProps {
  353. pageNum: number,
  354. pageSize: number,
  355. gameId?: number
  356. }
  357. /**
  358. * 有效创角配置列表查询
  359. * @param data
  360. * @returns
  361. */
  362. export async function getCreateRoleConfigListApi(data: CreateRoleConfigProps) {
  363. return request(apiManage + '/gameUser/config/list', {
  364. method: 'POST',
  365. data
  366. });
  367. }
  368. interface AeGameServerProps {
  369. gameId: number, // 游戏id
  370. roleLevel: number, // 游戏角色等级
  371. id?: number
  372. }
  373. /**
  374. * 新增或修改有效创角配置
  375. * @param data
  376. * @returns
  377. */
  378. export async function aeGameUserConfigApi(data: AeGameServerProps) {
  379. return request(apiManage + '/gameUser/config/add/or/update', {
  380. method: 'POST',
  381. data
  382. });
  383. }
  384. /**
  385. * 有效创角配置服删除
  386. * @param params
  387. * @returns
  388. */
  389. export async function delGameUserConfigApi(params: { id: number }) {
  390. return request(apiManage + '/gameUser/config/delete', {
  391. method: 'DELETE',
  392. params
  393. });
  394. }
  395. export interface GameVipProps {
  396. pageNum: number,
  397. pageSize: number,
  398. parentGameId?: number
  399. superGameId?: number
  400. vipLevel?: number
  401. }
  402. /**
  403. * vip挡位列表
  404. * @param data
  405. * @returns
  406. */
  407. export async function getGameVipApi(data: GameVipProps) {
  408. return request(apiManage + '/game/vip/list', {
  409. method: 'POST',
  410. data
  411. });
  412. }
  413. /**
  414. * 删除vip挡位
  415. * @param ids
  416. * @returns
  417. */
  418. export async function delGameVipApi(ids: string) {
  419. return request(apiManage + `/game/vip/delete/${ids}`, {
  420. method: 'DELETE'
  421. });
  422. }
  423. export interface modalGameVipApi {
  424. parentGameId: number
  425. superGameId: number
  426. vipLevel: number
  427. rechargeMoneyMin: number
  428. rechargeMoneyMax: number
  429. id?: number
  430. }
  431. /**
  432. * 新增修改vip挡位
  433. * @param data
  434. * @returns
  435. */
  436. export async function modalGameVipApi(data: modalGameVipApi) {
  437. return request(apiManage + '/game/vip/add/or/update', {
  438. method: 'POST',
  439. data
  440. });
  441. }