|
@@ -1,95 +1,95 @@
|
|
|
-package com.yonge.cooleshow.admin.controller.open;
|
|
|
-
|
|
|
-import com.yonge.cooleshow.admin.io.request.course.CourseRelationVo;
|
|
|
-import com.yonge.cooleshow.admin.io.request.im.IMNotifyMessageVO;
|
|
|
-import com.yonge.cooleshow.admin.io.request.im.UserFriendInfoVO;
|
|
|
-import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.CourseRelationMusicAlbumService;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
|
|
|
-import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerService;
|
|
|
-import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
-import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-import java.util.Objects;
|
|
|
-
|
|
|
-/**
|
|
|
- * 用户通讯录表(ImUserFriend)表控制层
|
|
|
- *
|
|
|
- * @author zx
|
|
|
- * @since 2022-03-22 10:45:59
|
|
|
- */
|
|
|
-@Api(tags = "用户通讯录表")
|
|
|
-@RestController
|
|
|
-@RequestMapping("/open")
|
|
|
-public class ImUserFriendController extends BaseController {
|
|
|
-
|
|
|
- /**
|
|
|
- * 服务对象
|
|
|
- */
|
|
|
- @Resource
|
|
|
- private ImUserFriendService imUserFriendService;
|
|
|
- @Autowired
|
|
|
- private CourseRelationMusicAlbumService courseRelationMusicAlbumService;
|
|
|
-
|
|
|
- @ApiOperation("新用户添加客服")
|
|
|
- @PostMapping(value = "/im/customerService")
|
|
|
- public HttpResponseResult<Boolean> customerService(@RequestBody UserFriendInfoVO info) {
|
|
|
-
|
|
|
- if (info.invalidRequestParam()) {
|
|
|
- return failed("无效的请求参数");
|
|
|
- }
|
|
|
-
|
|
|
- // 新用户自动绑定系统客服
|
|
|
- int ret = imUserFriendService.registerUserBindCustomerService(info.getUserId(),
|
|
|
- info.getFriendIds(), ClientEnum.valueOf(info.getClientType()));
|
|
|
-
|
|
|
- return succeed(ret > 0);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 发送系统客服消息
|
|
|
- * @param info IMNotifyMessageVO
|
|
|
- * @return HttpResponseResult<Boolean>
|
|
|
- */
|
|
|
- @PostMapping(value = "/im/message")
|
|
|
- public HttpResponseResult<Boolean> sendSysCustomerServiceMessage(@RequestBody IMNotifyMessageVO info) {
|
|
|
-
|
|
|
- if (info.invalidRequestParam()) {
|
|
|
- return failed("无效的请求参数");
|
|
|
- }
|
|
|
-
|
|
|
- // 发送客服通知消息
|
|
|
- imUserFriendService.sendCustomerServiceNotifyMessage(info.getSender(),
|
|
|
- CustomerService.NotifyMessage.from(info.jsonString()));
|
|
|
-
|
|
|
- return succeed();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 同步用户购买课程赠送数据
|
|
|
- * @param query CourseRelationVo.CourseRelationQuery
|
|
|
- * @return HttpResponseResult<Boolean>
|
|
|
- */
|
|
|
- @ApiOperation("已购买课程赠送同步")
|
|
|
- @PostMapping(value = "/course/sync")
|
|
|
- public HttpResponseResult<Boolean> syncUserPurchaseRelationMusicAlbum(@RequestBody CourseRelationVo.CourseRelationQuery query) {
|
|
|
-
|
|
|
- if (Objects.isNull(query.getCourseGroupId()) || Objects.isNull(query.getCourseType())) {
|
|
|
- return failed("无效的请求参数");
|
|
|
- }
|
|
|
-
|
|
|
- // 同步数据
|
|
|
- courseRelationMusicAlbumService.asyncUpdateCourseRelationMusicAlbumInfo(query.getCourseGroupId(), query.getCourseType());
|
|
|
-
|
|
|
- return succeed();
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+//package com.yonge.cooleshow.admin.controller.open;
|
|
|
+//
|
|
|
+//import com.yonge.cooleshow.admin.io.request.course.CourseRelationVo;
|
|
|
+//import com.yonge.cooleshow.admin.io.request.im.IMNotifyMessageVO;
|
|
|
+//import com.yonge.cooleshow.admin.io.request.im.UserFriendInfoVO;
|
|
|
+//import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
+//import com.yonge.cooleshow.biz.dal.service.CourseRelationMusicAlbumService;
|
|
|
+//import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
|
|
|
+//import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerService;
|
|
|
+//import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
+//import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
+//import io.swagger.annotations.Api;
|
|
|
+//import io.swagger.annotations.ApiOperation;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+//import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+//import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+//import org.springframework.web.bind.annotation.RestController;
|
|
|
+//
|
|
|
+//import javax.annotation.Resource;
|
|
|
+//import java.util.Objects;
|
|
|
+//
|
|
|
+///**
|
|
|
+// * 用户通讯录表(ImUserFriend)表控制层
|
|
|
+// *
|
|
|
+// * @author zx
|
|
|
+// * @since 2022-03-22 10:45:59
|
|
|
+// */
|
|
|
+//@Api(tags = "用户通讯录表")
|
|
|
+//@RestController
|
|
|
+//@RequestMapping("/open")
|
|
|
+//public class ImUserFriendController extends BaseController {
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 服务对象
|
|
|
+// */
|
|
|
+// @Resource
|
|
|
+// private ImUserFriendService imUserFriendService;
|
|
|
+// @Autowired
|
|
|
+// private CourseRelationMusicAlbumService courseRelationMusicAlbumService;
|
|
|
+//
|
|
|
+// @ApiOperation("新用户添加客服")
|
|
|
+// @PostMapping(value = "/im/customerService")
|
|
|
+// public HttpResponseResult<Boolean> customerService(@RequestBody UserFriendInfoVO info) {
|
|
|
+//
|
|
|
+// if (info.invalidRequestParam()) {
|
|
|
+// return failed("无效的请求参数");
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 新用户自动绑定系统客服
|
|
|
+// int ret = imUserFriendService.registerUserBindCustomerService(info.getUserId(),
|
|
|
+// info.getFriendIds(), ClientEnum.valueOf(info.getClientType()));
|
|
|
+//
|
|
|
+// return succeed(ret > 0);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 发送系统客服消息
|
|
|
+// * @param info IMNotifyMessageVO
|
|
|
+// * @return HttpResponseResult<Boolean>
|
|
|
+// */
|
|
|
+// @PostMapping(value = "/im/message")
|
|
|
+// public HttpResponseResult<Boolean> sendSysCustomerServiceMessage(@RequestBody IMNotifyMessageVO info) {
|
|
|
+//
|
|
|
+// if (info.invalidRequestParam()) {
|
|
|
+// return failed("无效的请求参数");
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 发送客服通知消息
|
|
|
+// imUserFriendService.sendCustomerServiceNotifyMessage(info.getSender(),
|
|
|
+// CustomerService.NotifyMessage.from(info.jsonString()));
|
|
|
+//
|
|
|
+// return succeed();
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 同步用户购买课程赠送数据
|
|
|
+// * @param query CourseRelationVo.CourseRelationQuery
|
|
|
+// * @return HttpResponseResult<Boolean>
|
|
|
+// */
|
|
|
+// @ApiOperation("已购买课程赠送同步")
|
|
|
+// @PostMapping(value = "/course/sync")
|
|
|
+// public HttpResponseResult<Boolean> syncUserPurchaseRelationMusicAlbum(@RequestBody CourseRelationVo.CourseRelationQuery query) {
|
|
|
+//
|
|
|
+// if (Objects.isNull(query.getCourseGroupId()) || Objects.isNull(query.getCourseType())) {
|
|
|
+// return failed("无效的请求参数");
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 同步数据
|
|
|
+// courseRelationMusicAlbumService.asyncUpdateCourseRelationMusicAlbumInfo(query.getCourseGroupId(), query.getCourseType());
|
|
|
+//
|
|
|
+// return succeed();
|
|
|
+// }
|
|
|
+//}
|
|
|
+//
|