This commit is contained in:
huangdeliang
2021-05-27 16:35:09 +08:00
parent 57dd7c3043
commit e5def38565
8 changed files with 397 additions and 53 deletions

View File

@ -0,0 +1,54 @@
package com.stdiet.web.controller.custom;
import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.core.page.TableDataInfo;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.custom.domain.SysServicesTopic;
import com.stdiet.custom.service.ISysServicesTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/services/topic")
public class SysServiceTopicController extends BaseController {
@Autowired
private ISysServicesTopicService servicesTopicService;
@GetMapping("/list")
public TableDataInfo list(SysServicesTopic topic) {
startPage();
return getDataTable(servicesTopicService.selectSysServicesTopicByUserIdAndRole(topic));
}
// @PutMapping("/update/status")
// public AjaxResult status(@RequestBody SysServicesQuestion sysServicesQuestion) {
// return toAjax(sysServicesQuestionService.updateSysServicesQuestionStatus(sysServicesQuestion));
// }
@PostMapping("/reply")
public AjaxResult reply(@RequestBody SysServicesTopic topic) {
return AjaxResult.success(servicesTopicService.inserSysServicesTopicReply(topic));
}
@PostMapping("/comment")
public AjaxResult comment(@RequestBody SysServicesTopic topic) {
return AjaxResult.success(servicesTopicService.inserSysServicesTopicComment(topic));
}
@GetMapping("/detail")
public AjaxResult detail(@RequestParam String topicId, @RequestParam String id) {
List<SysServicesTopic> questions = servicesTopicService.selectSysServicesTopicSessionByTopicId(topicId);
if (StringUtils.isNotNull(questions)) {
// 更新问题对应角色的状态
SysServicesTopic status = new SysServicesTopic();
status.setRead(1);
status.setId(id);
servicesTopicService.updateSysServicesTopicStatus(status);
}
return AjaxResult.success(questions);
}
}

View File

@ -70,6 +70,8 @@ public class WechatAppletController extends BaseController {
private IWechatAppletService iWechatAppletService;
@Autowired
private ISysServicesQuestionService iSysServicesQuestionService;
@Autowired
private ISysServicesTopicService iSysServicesTopicService;
/**
* 查询微信小程序中展示的客户案例
@ -605,6 +607,24 @@ public class WechatAppletController extends BaseController {
return getDataTable(iSysServicesQuestionService.selectSysServicesQuestionByUserIdAndRole(servicesQuestion));
}
/**
* 客户添加问题
*
* @param topic
* @param customerId
* @return
*/
@PostMapping("/services/topic/post")
public AjaxResult postServiceTopic(@RequestBody SysServicesTopic topic, @RequestParam String customerId) {
Long cusId = StringUtils.isNotEmpty(customerId) ? Long.parseLong(AesUtils.decrypt(customerId)) : 0L;
if (cusId == 0L) {
return toAjax(0);
}
topic.setUid(cusId);
return AjaxResult.success(iSysServicesTopicService.insertSysServicesTopic(topic));
}
/**
* 客户添加问题
*