|
@@ -1,13 +1,16 @@
|
|
package com.yonge.cooleshow.admin.controller.open;
|
|
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.IMNotifyMessageVO;
|
|
import com.yonge.cooleshow.admin.io.request.im.UserFriendInfoVO;
|
|
import com.yonge.cooleshow.admin.io.request.im.UserFriendInfoVO;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.CourseRelationMusicAlbumService;
|
|
import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
|
|
import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
|
|
import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerService;
|
|
import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerService;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 用户通讯录表(ImUserFriend)表控制层
|
|
* 用户通讯录表(ImUserFriend)表控制层
|
|
@@ -24,7 +28,7 @@ import javax.annotation.Resource;
|
|
*/
|
|
*/
|
|
@Api(tags = "用户通讯录表")
|
|
@Api(tags = "用户通讯录表")
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/open/im")
|
|
|
|
|
|
+@RequestMapping("/open")
|
|
public class ImUserFriendController extends BaseController {
|
|
public class ImUserFriendController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -32,9 +36,11 @@ public class ImUserFriendController extends BaseController {
|
|
*/
|
|
*/
|
|
@Resource
|
|
@Resource
|
|
private ImUserFriendService imUserFriendService;
|
|
private ImUserFriendService imUserFriendService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CourseRelationMusicAlbumService courseRelationMusicAlbumService;
|
|
|
|
|
|
@ApiOperation("新用户添加客服")
|
|
@ApiOperation("新用户添加客服")
|
|
- @PostMapping(value = "/customerService")
|
|
|
|
|
|
+ @PostMapping(value = "/im/customerService")
|
|
public HttpResponseResult<Boolean> customerService(@RequestBody UserFriendInfoVO info) {
|
|
public HttpResponseResult<Boolean> customerService(@RequestBody UserFriendInfoVO info) {
|
|
|
|
|
|
if (info.invalidRequestParam()) {
|
|
if (info.invalidRequestParam()) {
|
|
@@ -52,7 +58,7 @@ public class ImUserFriendController extends BaseController {
|
|
* @param info IMNotifyMessageVO
|
|
* @param info IMNotifyMessageVO
|
|
* @return HttpResponseResult<Boolean>
|
|
* @return HttpResponseResult<Boolean>
|
|
*/
|
|
*/
|
|
- @PostMapping(value = "/message")
|
|
|
|
|
|
+ @PostMapping(value = "/im/message")
|
|
public HttpResponseResult<Boolean> sendSysCustomerServiceMessage(@RequestBody IMNotifyMessageVO info) {
|
|
public HttpResponseResult<Boolean> sendSysCustomerServiceMessage(@RequestBody IMNotifyMessageVO info) {
|
|
|
|
|
|
if (info.invalidRequestParam()) {
|
|
if (info.invalidRequestParam()) {
|
|
@@ -65,5 +71,24 @@ public class ImUserFriendController extends BaseController {
|
|
|
|
|
|
return succeed();
|
|
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();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|