player.ts 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. import { request } from 'umi';
  2. import { api } from '../api';
  3. import { Paging, SortProps } from './rankingList';
  4. let wapi = api + '/gameData'
  5. export interface PlayerListProps extends Paging, SortProps {
  6. userId?: string, // 玩家ID
  7. userName?: string, // 玩家账号
  8. nickname?: string, // 玩家昵称
  9. mobile?: string, // 绑定手机
  10. regIp?: string, // 注册IP
  11. isAuth?: any, // 是否实名认证
  12. isBindMobile?: any, // 手机绑定状态
  13. cpId?: any, // CP
  14. gameId?: number, // 游戏
  15. gameCategoryId?: any, // 游戏应用类型对应的id
  16. beginDate?: string, // 注册开始时间
  17. endDate?: string,
  18. rechargeBeginDate?: string, // 最近充值开始时间
  19. rechargeEndDate?: string
  20. isRecharge?: boolean, // 是否充值
  21. status?: number // 玩家状态, 0 : 正常, 1 : 封禁
  22. channelId?: number, // 注册渠道对应的id
  23. accountId?: string, // 归因推广账号
  24. pitcherId?: number, // 归因投放人员
  25. createRole?: boolean, // 是否创角
  26. regPayIntervalTimeMin?: number // 充值距注册时间区间(分钟)
  27. regPayIntervalTimeMax?: number
  28. roleCountMin?: number, // 角色数量最大值
  29. roleCountMax?: number
  30. }
  31. /**
  32. * 投手总数居
  33. * @param data
  34. * @returns
  35. */
  36. export async function getPlayerListApi(data: PlayerListProps) {
  37. return request(wapi + `/player/list`, {
  38. method: 'POST',
  39. data
  40. });
  41. }
  42. /**玩家详情
  43. * @param id 玩家ID
  44. * */
  45. export async function getUserInfotApi(id: number) {
  46. return request(api + `/manage/user/info?id=${id}`, {
  47. method: 'get',
  48. });
  49. }
  50. /**
  51. * 封禁结晶
  52. * @param data
  53. * @returns
  54. */
  55. export async function interdictionGamerApi(data: { userId: number, status: number }) {
  56. return request(api + `/manage/ban/user/add/or/update`, {
  57. method: 'POST',
  58. data
  59. });
  60. }
  61. /**
  62. * 小游戏玩家导量到H5游戏
  63. * @param params
  64. * @returns
  65. */
  66. export async function exportUserH5Api(params: {mobile: number, userId: string}) {
  67. return request(api + `/manage/user/applet/to/h5`, {
  68. method: 'PATCH',
  69. params
  70. });
  71. }
  72. /**
  73. * 地址列表
  74. * @param id 玩家ID
  75. * @returns
  76. * */
  77. export async function getUserAddressListApi(id: number) {
  78. return request(api + `/manage/user/address/list?userId=${id}`, {
  79. method: 'get',
  80. });
  81. }
  82. /**
  83. * 玩家游戏角色列表
  84. * @param id 玩家ID
  85. * @returns
  86. * */
  87. export async function getUserGameRoleListApi(id: number) {
  88. return request(api + `/manage/user/game/role/list?userId=${id}`, {
  89. method: 'GET',
  90. });
  91. }
  92. /**
  93. * 玩家登录记录列表
  94. * @param userId 玩家ID
  95. * @returns
  96. * */
  97. export async function getUserLoginListApi(params: { userId: number, pageNum: number, pageSize: number }) {
  98. return request(api + `/manage/user/login/list`, {
  99. method: 'POST',
  100. data: params,
  101. });
  102. }
  103. /**
  104. * 玩家下单记录列表
  105. * @param userId 玩家ID
  106. * @returns
  107. * */
  108. export async function getUserOrderListApi(params: { userId: number, pageNum: number, pageSize: number }) {
  109. return request(api + `/manage/user/order/list`, {
  110. method: 'POST',
  111. data: params,
  112. });
  113. }
  114. /**
  115. * 玩家信息编辑
  116. * @param aliPay 绑定支付宝账号
  117. * @param idCard 证件号码
  118. * @param mobile 绑定手机号码
  119. * @param password 密码
  120. * @param realName 真实姓名
  121. * @param userId 玩家id
  122. * @param username 玩家账号
  123. * */
  124. export type UserUpdateParams = {
  125. aliPay?: string,
  126. idCard?: string,
  127. mobile?: string,
  128. password?: string,
  129. realName?: string,
  130. userId?: string,
  131. username?: string
  132. }
  133. export async function getUserUpdateApi(params: UserUpdateParams) {
  134. return request(api + `/manage/user/update`, {
  135. method: 'POST',
  136. data: params,
  137. });
  138. }
  139. /**获取微信信息*/
  140. export async function getUserWeChatApi(userId: any) {
  141. return request(api + `/manage/user/weChat/info?userId=${userId}`, {
  142. method: 'GET',
  143. });
  144. }
  145. /*****************玩家角色******************/
  146. /** 获取玩家游戏角色列表 */
  147. export interface PlayerRoleListProps extends Paging, SortProps {
  148. accountId?: string, // 归因推广账号
  149. beginDate?:string,//开始时间
  150. endDate?:string,//结束时间
  151. channelId?:number,//注册渠道对应的id
  152. cpId?:number,//cp名称对应的id
  153. gameCategoryId?:number,//游戏应用类型对应的id
  154. gameId?:number,//游戏名称对应的id
  155. isRecharge?:boolean,//是否充值, true : 是, false : 否, 全部 : null或者不传
  156. nickname?:string,//玩家昵称
  157. os?:string,//操作系统对应的id, 全部 : null或者不传
  158. rechargeBeginDate?:string,//最近充值开始时间(注册开始时间请使用beginDate参数)
  159. rechargeEndDate?:string,//最近充值结束时间(注册结束时间请使用endDate参数)
  160. regIp?:string,//注册IP
  161. roleName?:string,//游戏角色
  162. serverName?:string,//游戏区服
  163. pitcherId?: number, // 归因投放人员
  164. userId?:string,//玩家id
  165. userName?:string,//玩家账号
  166. vipLevel?:number,//角色vip, 全部 : null或者不传
  167. roleLevelMin?: number, // 最大角色等级
  168. roleLevelMax?: number,
  169. regPayIntervalTimeMin?: number, // 充值到注册的间隔时间(分)
  170. regPayIntervalTimeMax?: number
  171. }
  172. /** 玩家角色列表 */
  173. export async function getUserRoleListApi(params: PlayerRoleListProps) {
  174. return request(wapi + '/player/role/list', {
  175. method: 'POST',
  176. data: params,
  177. });
  178. }
  179. /**
  180. * 玩家角色列表总计
  181. * @param params
  182. * @returns
  183. */
  184. export async function getUserRoleTotalApi(params: PlayerRoleListProps) {
  185. return request(wapi + '/player/role/total', {
  186. method: 'POST',
  187. data: params,
  188. });
  189. }
  190. export async function downloadRoleListApi(params: PlayerRoleListProps) {
  191. return request(api + '/manage/user/role/list/excel', {
  192. method: 'POST',
  193. data: params,
  194. responseType: 'blob',
  195. });
  196. }
  197. export interface LoginLogProps extends Paging {
  198. beginDate?: string
  199. endDate?: string
  200. // 客户端类型:1-安卓APP;2-iosAPP;3-H5网页;4-小程序
  201. deviceType?: number,
  202. gameClassify?: number
  203. gameId?: number
  204. ip?: string,
  205. os?: string,
  206. parentGameId?: number
  207. roleId?: number
  208. roleName?: string,
  209. serverId?: number,
  210. // 类型:0-注册;1-登陆;2-退出
  211. type?: number
  212. userId?: number
  213. username?: string
  214. }
  215. /**
  216. * 玩家登录日志列表
  217. * @param params
  218. * @returns
  219. */
  220. export async function getLoginLogListApi(params: LoginLogProps) {
  221. return request(wapi + '/player/login/list', {
  222. method: 'POST',
  223. data: params,
  224. });
  225. }
  226. export interface IpUserProps extends Paging {
  227. ip?: string
  228. }
  229. /**
  230. * 登陆IP玩家列表
  231. * @param params
  232. * @returns
  233. */
  234. export async function getIpUserListApi(params: IpUserProps) {
  235. return request(wapi + '/player/banned/list', {
  236. method: 'POST',
  237. data: params,
  238. });
  239. }
  240. let apiManage = api + '/manage'
  241. /** 获取封禁玩家列表 */
  242. export interface gamePlayerBanListProps {
  243. pageNum: number,
  244. pageSize: number,
  245. userId?: any, // 玩家ID
  246. userName?: string, // 玩家账号
  247. userNickName?: string, // 玩家昵称
  248. regBeginTime?: string,
  249. regEndTime?: string, // 注册时间
  250. beginDate?: string,
  251. endDate?: string, // 封禁时间
  252. }
  253. /** 封禁IP列表查询 */
  254. export async function getBanUserListApi(params: gamePlayerBanListProps) {
  255. return request(apiManage + '/ban/user/list', {
  256. method: 'POST',
  257. data: params,
  258. });
  259. }
  260. /**
  261. * 解封 封禁
  262. * @param params
  263. * @returns
  264. */
  265. export async function updateBanUserApi(params: { userId: string, status: number }) {
  266. return request(apiManage + '/ban/user/add/or/update', {
  267. method: 'POST',
  268. data: params,
  269. });
  270. }
  271. /** 获取玩家游戏角色列表 */
  272. export interface IpManageListProps {
  273. pageNum: number,
  274. pageSize: number,
  275. ip?: string, // 玩家ip
  276. beginDate?: string,
  277. endDate?: string, // 封禁时间
  278. status?: any, // 当前封禁状态
  279. }
  280. /** 封禁IP列表查询 */
  281. export async function getIpManageListApi(params: IpManageListProps) {
  282. return request(apiManage + '/ban/ip/list', {
  283. method: 'POST',
  284. data: params,
  285. });
  286. }
  287. /**
  288. * 添加封禁IP
  289. * @param params
  290. * @returns
  291. */
  292. export async function addBanIpApi(params: { ipList: string[] }) {
  293. return request(apiManage + '/ban/ip/add', {
  294. method: 'POST',
  295. data: params,
  296. });
  297. }
  298. /**
  299. * 解封 封禁
  300. * @param params
  301. * @returns
  302. */
  303. export async function updateBanIpApi(params: { ip: string, status: number }) {
  304. return request(apiManage + '/ban/ip/update', {
  305. method: 'POST',
  306. data: params,
  307. });
  308. }
  309. /****************聊天记录******************/
  310. /**
  311. * 获取游戏列表
  312. * @returns
  313. */
  314. export async function getChatGameListApi() {
  315. return request(api + `/manage/game/chat/game/list`, {
  316. method: 'GET',
  317. });
  318. }
  319. /**
  320. * 获取聊天记录
  321. * @param data
  322. * @returns
  323. */
  324. export async function getChatListApi(data: { pageNum: number, pageSize: number, supperGameId: number, roleId?: string, roleName?: string, chatStart?: string, chatEnd?: string }) {
  325. return request(api + `/manage/game/chat/list`, {
  326. method: 'POST',
  327. data
  328. });
  329. }