CosPlayPlayerController.java
9.99 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
package com.pipi.qa.controller.common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject;
import com.pipi.qa.bean.Player;
import com.pipi.qa.bean.Room;
import com.pipi.qa.bean.User;
import com.pipi.qa.service.CosPlayPlayerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* Created by dennis.dong on 2021/5/18
*/
@CrossOrigin(origins = "*", maxAge = 3600)
@Controller
@RequestMapping(value = "/play")
@Api(value = "", tags = "")
public class CosPlayPlayerController {
@Autowired
private CosPlayPlayerService cosPlayPlayerService;
private String token = null;
private String userId = null;
public Logger logger = LoggerFactory.getLogger(CosPlayPlayerController.class);
/**
* 申请陪玩师
* @param PlayerApply
* @return
*/
@ApiOperation(value = "申请陪玩师", notes = "输入手机号")
@RequestMapping(value = "/PlayerApply", method = RequestMethod.POST)
@ResponseBody
public JSONObject PlayerApply(@RequestBody Player player) {
String mobile = player.getMobile();
String env = player.getEnv();
JSONObject loginRes = cosPlayPlayerService.login(mobile, env);
token = loginRes.getJSONObject("data").getString("token");
userId = loginRes.getJSONObject("data").getString("id");
cosPlayPlayerService.SubmitAuthentication(token, userId, env);
JSONObject jsonObj = cosPlayPlayerService.saveUserInfo(token, userId, env);
logger.info("env:"+env+"mobile:"+mobile);
return jsonObj;
}
/**
* 陪玩师申请入驻
* @param PlayerApply
* @return
*/
@ApiOperation(value = "陪玩师申请入驻", notes = "输入手机号")
@RequestMapping(value = "/saveInfoTech", method = RequestMethod.POST)
@ResponseBody
public JSONObject saveInfoTech(@RequestBody Player player) {
String mobile = player.getMobile();
String env = player.getEnv();
String techLevelId = player.getTechLevelId();
String id =player.getId();
String categoryId = player.getCategoryId();
//登录获取token、userId
JSONObject loginRes = cosPlayPlayerService.login(mobile, env);
token = loginRes.getJSONObject("data").getString("token");
userId = loginRes.getJSONObject("data").getString("id");
JSONObject jsonObj = cosPlayPlayerService.saveInfoTech(token, userId, categoryId, techLevelId, env);
logger.info("env:"+env+"mobile:"+mobile);
return jsonObj;
}
/**
* 申请陪玩师及入驻
* @param PlayerApply
* @return
*/
@ApiOperation(value = "申请陪玩师及入驻", notes = "输入手机号")
@RequestMapping(value = "/playerApplyAndSaveInfoTech", method = RequestMethod.POST)
@ResponseBody
public JSONObject playerApplyAndSaveInfoTech(@RequestBody Player player) {
String mobile = player.getMobile();
String env = player.getEnv();
String techLevelId = player.getTechLevelId();
String id =player.getId();
String categoryId = player.getCategoryId();
//登录获取token、userId
JSONObject loginRes = cosPlayPlayerService.login(mobile, env);
token = loginRes.getJSONObject("data").getString("token");
userId = loginRes.getJSONObject("data").getString("id");
//申请陪玩师
cosPlayPlayerService.SubmitAuthentication(token, userId, env);
//提交陪玩师资料
cosPlayPlayerService.saveUserInfo(token, userId, env);
//申请陪玩师技能
JSONObject jsonObj = cosPlayPlayerService.saveInfoTech(token, userId, categoryId, techLevelId, env);
logger.info("env:"+env+"mobile:"+mobile);
return jsonObj;
}
/**
*充钻石
* @param User
* @return
*/
@ApiOperation(value = "充钻石", notes = "输入手机号,充值金额")
@RequestMapping(value = "/virtualMoneyModify", method = RequestMethod.POST)
@ResponseBody
public JSONObject virtualMoneyModify(@RequestBody User user) {
String mobile = user.getMobile();
long money = user.getMoney();
String env = user.getEnv();
JSONObject jsonObj = cosPlayPlayerService.virtualMoneyModify(mobile, money, env);
return jsonObj;
}
/**
*充皮皮币
* @param User
* @return
*/
@ApiOperation(value = "充皮皮币", notes = "输入手机号,充值金额")
@RequestMapping(value = "/moneyDetailsSave", method = RequestMethod.POST)
@ResponseBody
public JSONObject moneyDetailsSave(@RequestBody User user) {
String mobile = user.getMobile();
long money = user.getMoney();
String env = user.getEnv();
JSONObject jsonObj = cosPlayPlayerService.moneyDetailsSave(mobile, money, env);
return jsonObj;
}
/**
*送礼物
* @param PlayerApply
* @return
*/
@ApiOperation(value = "送礼物", notes = "输入手机号,房间ID、用户")
@RequestMapping(value = "/roomGiftSend", method = RequestMethod.POST)
@ResponseBody
public JSONObject roomGiftSend(@RequestBody Room room) {
String mobile = room.getMobile();
String env = room.getEnv();
String userIds = room.getUserIds();
String productId = room.getProductId();
String roomNo = room.getRoomNo();
String amount = room.getAmount();
JSONObject jsonObj = cosPlayPlayerService.send(mobile, roomNo, productId, amount ,userIds, env);
return jsonObj;
}
/**
*查询礼物列表
* @param PlayerApply
* @return
*/
@ApiOperation(value = "查询礼物列表", notes = "选择环境")
@RequestMapping(value = "/giftList", method = RequestMethod.POST)
@ResponseBody
public JSONObject giftList(@RequestBody Room room) {
String env = room.getEnv();
JSONObject jsonObj = cosPlayPlayerService.giftList(env);
return jsonObj;
}
/**
*幸运夺宝箱列表
* @param PlayerApply
* @return
*/
@ApiOperation(value = "幸运夺宝箱列表", notes = "选择环境")
@RequestMapping(value = "/activityList", method = RequestMethod.POST)
@ResponseBody
public JSONObject activityList(@RequestBody Room room) {
String env = room.getEnv();
JSONObject jsonObj = cosPlayPlayerService.activityList(env);
return jsonObj;
}
/**
*开宝箱
* @param PlayerApply
* @return
*/
@ApiOperation(value = "开宝箱", notes = "输入手机号,房间ID、用户")
@RequestMapping(value = "/lotteryActivity", method = RequestMethod.POST)
@ResponseBody
public JSONObject lotteryActivity(@RequestBody Room room) {
String mobile = room.getMobile();
String env = room.getEnv();
String roomNo = room.getRoomNo();
String times = room.getTimes();
String activityId = room.getActivityId();
JSONObject jsonObj = cosPlayPlayerService.lotteryActivity(mobile, roomNo, activityId, times, env);
return jsonObj;
}
/**
*创建公会
* @param PlayerApply
* @return
*/
@ApiOperation(value = "创建公会", notes = "是否开启自定义分成,1开启,0不开启,guildBiz语音1,游戏2,全部0")
@RequestMapping(value = "/guildCreate", method = RequestMethod.POST)
@ResponseBody
public JSONObject guildCreate(@RequestBody User user) {
String mobile = user.getMobile();
String env = user.getEnv();
long guildBiz = user.getGuildBiz();
long openStatus = user.getOpenStatus();
JSONObject jsonObj = cosPlayPlayerService.guildCreate(mobile, openStatus, guildBiz, env);
return jsonObj;
}
/**
*申请加入公会
* @param guildCenter
* @return
*/
@ApiOperation(value = "申请加入公会", notes = "支持按公会ID申请加入,需要审核")
@RequestMapping(value = "/guildCenter", method = RequestMethod.POST)
@ResponseBody
public JSONObject guildCenter(@RequestBody Room room) {
String mobile = room.getMobile();
String env = room.getEnv();
String guildCode = room.getGuildCode();
JSONObject jsonObj = cosPlayPlayerService.guildCenter(mobile, guildCode, env);
return jsonObj;
}
/**
*审核加入公会
* @param applyList
* @return
*/
@ApiOperation(value = "审核加入公会", notes = "审核人员")
@RequestMapping(value = "/applyList", method = RequestMethod.POST)
@ResponseBody
public JSONObject applyList(@RequestBody Room room) {
String mobile = room.getMobile();
String env = room.getEnv();
String guildCode = room.getGuildCode();
JSONObject jsonObj = cosPlayPlayerService.applyList(mobile, env);
return jsonObj;
}
/**
*加入公会及审核
* @param applyList
* @return
*/
@ApiOperation(value = "申请加入公会及审核", notes = "审核人员")
@RequestMapping(value = "/auditGuild", method = RequestMethod.POST)
@ResponseBody
public JSONObject auditGuild(@RequestBody Room room) {
String mobile = room.getMobile();
String env = room.getEnv();
String guildCode = room.getGuildCode();
JSONObject jsonObj = cosPlayPlayerService.auditGuild(mobile, guildCode, env);
return jsonObj;
}
/**
*创建厅
* @param roomSave
* @return
*/
@ApiOperation(value = "创建厅", notes = "")
@RequestMapping(value = "/roomSave", method = RequestMethod.POST)
@ResponseBody
public JSONObject roomSave(@RequestBody Room room) {
String mobile = room.getMobile();
String env = room.getEnv();
long roomCategoryId = room.getRoomCategoryId();
long roomType = room.getRoomType();
String roomName = room.getRoomName();
JSONObject jsonObj = cosPlayPlayerService.roomSave(mobile, roomName, roomType, roomCategoryId, env);
return jsonObj;
}
}