|
@@ -25,6 +25,7 @@ import com.cyksj.model.views.DisableAccountView;
|
|
|
import com.cyksj.model.views.GroupsRelationIndependentView;
|
|
import com.cyksj.model.views.GroupsRelationIndependentView;
|
|
|
import com.cyksj.model.views.GroupsRelationRechargeView;
|
|
import com.cyksj.model.views.GroupsRelationRechargeView;
|
|
|
import com.cyksj.model.views.OrderDonRenewView;
|
|
import com.cyksj.model.views.OrderDonRenewView;
|
|
|
|
|
+import com.cyksj.service.chatgpt.GptUserRechargeRecordService;
|
|
|
import com.cyksj.service.relation.GroupRelationClearService;
|
|
import com.cyksj.service.relation.GroupRelationClearService;
|
|
|
import com.cyksj.service.scheduler.SchedulerService;
|
|
import com.cyksj.service.scheduler.SchedulerService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
@@ -72,6 +73,8 @@ public class CmsGroupRelationController {
|
|
|
|
|
|
|
|
private final GptRechargeCardKeyMapper gptRechargeCardKeyMapper;
|
|
private final GptRechargeCardKeyMapper gptRechargeCardKeyMapper;
|
|
|
|
|
|
|
|
|
|
+ private final GptUserRechargeRecordService gptUserRechargeRecordService;
|
|
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
public Result<List<GroupsRelationBackView>> get(){
|
|
public Result<List<GroupsRelationBackView>> get(){
|
|
|
List<GroupsRelationBackView> search = beanSearcher.searchAll(GroupsRelationBackView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
List<GroupsRelationBackView> search = beanSearcher.searchAll(GroupsRelationBackView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
@@ -189,6 +192,8 @@ public class CmsGroupRelationController {
|
|
|
if (update == 0) {
|
|
if (update == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("更新用户代充剩余次数失败,请重试");
|
|
throw BusinessRuntimeException.getInstance("更新用户代充剩余次数失败,请重试");
|
|
|
}
|
|
}
|
|
|
|
|
+ //记录gpt代充记录
|
|
|
|
|
+ gptUserRechargeRecordService.recordGptUserRechargeNum(relation.getUserId(), relation.getId(), relation.getAccount(), 1, cmsUser != null ? cmsUser.getNickname() : null);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -216,6 +221,7 @@ public class CmsGroupRelationController {
|
|
|
*/
|
|
*/
|
|
|
@PutMapping("/recharge/update/remain/num")
|
|
@PutMapping("/recharge/update/remain/num")
|
|
|
public Result<String> updateRechargeRemainNum(@RequestBody RechargeRemainNumReq req) {
|
|
public Result<String> updateRechargeRemainNum(@RequestBody RechargeRemainNumReq req) {
|
|
|
|
|
+ long adminId = StpUtil.getLoginIdAsLong();
|
|
|
Long relationId = req.getRelationId();
|
|
Long relationId = req.getRelationId();
|
|
|
Integer num = req.getNum();
|
|
Integer num = req.getNum();
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(relationId);
|
|
GroupsRelation relation = groupsRelationMapper.selectById(relationId);
|
|
@@ -235,6 +241,9 @@ public class CmsGroupRelationController {
|
|
|
if (update == 0) {
|
|
if (update == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("修改用户代充次数错误,请重试");
|
|
throw BusinessRuntimeException.getInstance("修改用户代充次数错误,请重试");
|
|
|
}
|
|
}
|
|
|
|
|
+ //记录gpt代充记录
|
|
|
|
|
+ CmsUser cmsUser = cmsUserMapper.selectById(adminId);
|
|
|
|
|
+ gptUserRechargeRecordService.recordGptUserRechargeNum(relation.getUserId(), relation.getId(), relation.getAccount(), num, cmsUser != null ? cmsUser.getNickname() : null);
|
|
|
}
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|