小程序-教学视频
This commit is contained in:
parent
b8dd18642e
commit
07e15beb6d
@ -13,6 +13,7 @@ import com.stdiet.custom.domain.SysOrder;
|
|||||||
import com.stdiet.custom.domain.SysVideoClassify;
|
import com.stdiet.custom.domain.SysVideoClassify;
|
||||||
import com.stdiet.custom.dto.response.NutritionalVideoResponse;
|
import com.stdiet.custom.dto.response.NutritionalVideoResponse;
|
||||||
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||||
|
import com.stdiet.custom.dto.response.VideoClassifyTwoResponse;
|
||||||
import com.stdiet.custom.service.ISysNutritionalVideoService;
|
import com.stdiet.custom.service.ISysNutritionalVideoService;
|
||||||
import com.stdiet.custom.service.ISysOrderService;
|
import com.stdiet.custom.service.ISysOrderService;
|
||||||
import com.stdiet.custom.service.ISysVideoClassifyService;
|
import com.stdiet.custom.service.ISysVideoClassifyService;
|
||||||
@ -71,6 +72,7 @@ public class VideoWebInterfaceController extends BaseController {
|
|||||||
//客户类型 0未付费客户-playLevel根据上传的标记 1已付费客户-playLevel全为0
|
//客户类型 0未付费客户-playLevel根据上传的标记 1已付费客户-playLevel全为0
|
||||||
sysVideoClassify.setUserType(payed);
|
sysVideoClassify.setUserType(payed);
|
||||||
List<VideoClassifyResponse> list = sysVideoClassifyService.getAllClassifyAndVideo(sysVideoClassify);
|
List<VideoClassifyResponse> list = sysVideoClassifyService.getAllClassifyAndVideo(sysVideoClassify);
|
||||||
|
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,10 +15,7 @@ import com.stdiet.common.utils.file.MimeTypeUtils;
|
|||||||
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
import com.stdiet.common.utils.oss.AliyunOSSUtils;
|
||||||
import com.stdiet.common.utils.sign.AesUtils;
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
import com.stdiet.custom.domain.*;
|
import com.stdiet.custom.domain.*;
|
||||||
import com.stdiet.custom.dto.response.CustomerCaseResponse;
|
import com.stdiet.custom.dto.response.*;
|
||||||
import com.stdiet.custom.dto.response.MessageNoticeResponse;
|
|
||||||
import com.stdiet.custom.dto.response.NutritionQuestionResponse;
|
|
||||||
import com.stdiet.custom.dto.response.NutritionalVideoResponse;
|
|
||||||
import com.stdiet.custom.page.WxLogInfo;
|
import com.stdiet.custom.page.WxLogInfo;
|
||||||
import com.stdiet.custom.service.*;
|
import com.stdiet.custom.service.*;
|
||||||
import com.stdiet.system.service.ISysDictTypeService;
|
import com.stdiet.system.service.ISysDictTypeService;
|
||||||
@ -43,6 +40,8 @@ public class WechatAppletController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ISysRecipesService iSysRecipesService;
|
ISysRecipesService iSysRecipesService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
ISysNutritionalVideoService iSysNutritionalVideoService;
|
||||||
|
@Autowired
|
||||||
private ISysCustomerCaseService sysCustomerCaseService;
|
private ISysCustomerCaseService sysCustomerCaseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysWxUserLogService sysWxUserLogService;
|
private ISysWxUserLogService sysWxUserLogService;
|
||||||
@ -79,9 +78,9 @@ public class WechatAppletController extends BaseController {
|
|||||||
* 查询微信小程序中展示的客户案例
|
* 查询微信小程序中展示的客户案例
|
||||||
*/
|
*/
|
||||||
@GetMapping("/caseList")
|
@GetMapping("/caseList")
|
||||||
public TableDataInfo caseList(SysCustomerCase sysCustomerCase, @RequestParam(value = "pageSize",required = false,defaultValue = "10")int pageSize,
|
public TableDataInfo caseList(SysCustomerCase sysCustomerCase, @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
|
||||||
@RequestParam(value="randomFlag",required = false,defaultValue = "false") boolean randomFlag) {
|
@RequestParam(value = "randomFlag", required = false, defaultValue = "false") boolean randomFlag) {
|
||||||
if(randomFlag){
|
if (randomFlag) {
|
||||||
List<CustomerCaseResponse> reponseList = sysCustomerCaseService.getWxCustomerCaseByRandom(pageSize);
|
List<CustomerCaseResponse> reponseList = sysCustomerCaseService.getWxCustomerCaseByRandom(pageSize);
|
||||||
//处理ID加密
|
//处理ID加密
|
||||||
dealIdEnc(reponseList);
|
dealIdEnc(reponseList);
|
||||||
@ -91,7 +90,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
rspData.setRows(reponseList);
|
rspData.setRows(reponseList);
|
||||||
rspData.setTotal(pageSize);
|
rspData.setTotal(pageSize);
|
||||||
return rspData;
|
return rspData;
|
||||||
}else{
|
} else {
|
||||||
startPage();
|
startPage();
|
||||||
sysCustomerCase.setKeywordArray(StringUtils.isNotEmpty(sysCustomerCase.getKeyword()) ? sysCustomerCase.getKeyword().split(",") : null);
|
sysCustomerCase.setKeywordArray(StringUtils.isNotEmpty(sysCustomerCase.getKeyword()) ? sysCustomerCase.getKeyword().split(",") : null);
|
||||||
List<CustomerCaseResponse> list = sysCustomerCaseService.getWxCustomerCaseList(sysCustomerCase);
|
List<CustomerCaseResponse> list = sysCustomerCaseService.getWxCustomerCaseList(sysCustomerCase);
|
||||||
@ -307,7 +306,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void dealIdEnc(List<CustomerCaseResponse> list) {
|
private void dealIdEnc(List<CustomerCaseResponse> list) {
|
||||||
if(list != null){
|
if (list != null) {
|
||||||
for (CustomerCaseResponse cus : list) {
|
for (CustomerCaseResponse cus : list) {
|
||||||
cus.setId(AesUtils.encrypt(cus.getId() + "", null));
|
cus.setId(AesUtils.encrypt(cus.getId() + "", null));
|
||||||
}
|
}
|
||||||
@ -349,22 +348,23 @@ public class WechatAppletController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* 获取小程序展示的营养小知识列表
|
* 获取小程序展示的营养小知识列表
|
||||||
|
*
|
||||||
* @param sysNutritionQuestion 查询参数对象
|
* @param sysNutritionQuestion 查询参数对象
|
||||||
* @param pageNum 分页当前页码
|
* @param pageNum 分页当前页码
|
||||||
* @param pageSize 分页每页数量
|
* @param pageSize 分页每页数量
|
||||||
* @param randomFlag 随机标识 true 随机获取指定pageSize数量的营养小知识,不支持分页、模糊查询 false 则正常查询
|
* @param randomFlag 随机标识 true 随机获取指定pageSize数量的营养小知识,不支持分页、模糊查询 false 则正常查询
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/getNutritionQuestionList")
|
@GetMapping(value = "/getNutritionQuestionList")
|
||||||
public AjaxResult getNutritionQuestionList(SysNutritionQuestion sysNutritionQuestion, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
|
public AjaxResult getNutritionQuestionList(SysNutritionQuestion sysNutritionQuestion, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
|
||||||
@RequestParam(value="randomFlag",required = false,defaultValue = "false") boolean randomFlag) {
|
@RequestParam(value = "randomFlag", required = false, defaultValue = "false") boolean randomFlag) {
|
||||||
sysNutritionQuestion.setShowFlag(1);
|
sysNutritionQuestion.setShowFlag(1);
|
||||||
if(randomFlag){
|
if (randomFlag) {
|
||||||
//随机获取指定条数
|
//随机获取指定条数
|
||||||
sysNutritionQuestion.setKey(null);
|
sysNutritionQuestion.setKey(null);
|
||||||
List<NutritionQuestionResponse> list = sysNutritionQuestionService.getNutritionQuestionByRandom(sysNutritionQuestion, pageSize);
|
List<NutritionQuestionResponse> list = sysNutritionQuestionService.getNutritionQuestionByRandom(sysNutritionQuestion, pageSize);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}else{
|
} else {
|
||||||
Map<String, Object> result = sysNutritionQuestionService.getNutritionQuestionListByKey(sysNutritionQuestion, pageNum, pageSize);
|
Map<String, Object> result = sysNutritionQuestionService.getNutritionQuestionListByKey(sysNutritionQuestion, pageNum, pageSize);
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
sysNutritionalVideo.setUserType(1);
|
sysNutritionalVideo.setUserType(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(sysNutritionalVideo.getCateId() != null && sysNutritionalVideo.getCateId().longValue() == 0){
|
if (sysNutritionalVideo.getCateId() != null && sysNutritionalVideo.getCateId().longValue() == 0) {
|
||||||
sysNutritionalVideo.setCateId(null);
|
sysNutritionalVideo.setCateId(null);
|
||||||
}
|
}
|
||||||
startPage();
|
startPage();
|
||||||
@ -435,7 +435,6 @@ public class WechatAppletController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping(value = "/getVideoDetailById")
|
@GetMapping(value = "/getVideoDetailById")
|
||||||
public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) {
|
public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) {
|
||||||
AjaxResult result = AjaxResult.success();
|
|
||||||
NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse();
|
NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse();
|
||||||
try {
|
try {
|
||||||
SysNutritionalVideo sysNutritionalVideo = sysNutritionalVideoService.selectSysNutritionalVideByVideoId(videoId);
|
SysNutritionalVideo sysNutritionalVideo = sysNutritionalVideoService.selectSysNutritionalVideByVideoId(videoId);
|
||||||
@ -458,8 +457,7 @@ public class WechatAppletController extends BaseController {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
result.put("videoDetail", nutritionalVideoResponse);
|
return AjaxResult.success(nutritionalVideoResponse);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -742,33 +740,34 @@ public class WechatAppletController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取视频分类
|
* 获取视频分类
|
||||||
|
*
|
||||||
* @param openid
|
* @param openid
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getVideoClassify")
|
@GetMapping("/getVideoClassify")
|
||||||
public AjaxResult getVideoClassify(@RequestParam("openid")String openid) {
|
public AjaxResult getVideoClassify(@RequestParam("openid") String openid) {
|
||||||
SysVideoClassify param = new SysVideoClassify();
|
SysVideoClassify param = new SysVideoClassify();
|
||||||
param.setParentId(0L);
|
param.setParentId(0L);
|
||||||
List<SysVideoClassify> list = sysVideoClassifyService.getAllClassify(param);
|
List<SysVideoClassify> list = sysVideoClassifyService.getAllClassify(param);
|
||||||
List<List<Map<String,Object>>> result = new ArrayList<>();
|
List<List<Map<String, Object>>> result = new ArrayList<>();
|
||||||
int groupCount = 3;
|
int groupCount = 3;
|
||||||
SysVideoClassify all = new SysVideoClassify();
|
SysVideoClassify all = new SysVideoClassify();
|
||||||
all.setId(0L);
|
all.setId(0L);
|
||||||
all.setCateName("全部内容");
|
all.setCateName("全部内容");
|
||||||
list.add(0, all);
|
list.add(0, all);
|
||||||
if(list != null && list.size() > 0){
|
if (list != null && list.size() > 0) {
|
||||||
//分成三组
|
//分成三组
|
||||||
int groupNum = list.size()/groupCount + (list.size() % groupCount > 0 ? 1 : 0);
|
int groupNum = list.size() / groupCount + (list.size() % groupCount > 0 ? 1 : 0);
|
||||||
for (int i = 0; i < groupNum; i++) {
|
for (int i = 0; i < groupNum; i++) {
|
||||||
List<Map<String,Object>> groupList = new ArrayList<>();
|
List<Map<String, Object>> groupList = new ArrayList<>();
|
||||||
for (int j = i * groupCount; j < (i+1)*groupCount; j++) {
|
for (int j = i * groupCount; j < (i + 1) * groupCount; j++) {
|
||||||
if(j < list.size()){
|
if (j < list.size()) {
|
||||||
Map<String,Object> videoClassifyMap = new HashMap<>();
|
Map<String, Object> videoClassifyMap = new HashMap<>();
|
||||||
SysVideoClassify sysVideoClassify = list.get(j);
|
SysVideoClassify sysVideoClassify = list.get(j);
|
||||||
videoClassifyMap.put("cateName", sysVideoClassify.getCateName());
|
videoClassifyMap.put("cateName", sysVideoClassify.getCateName());
|
||||||
videoClassifyMap.put("cateId", sysVideoClassify.getId());
|
videoClassifyMap.put("cateId", sysVideoClassify.getId());
|
||||||
groupList.add(videoClassifyMap);
|
groupList.add(videoClassifyMap);
|
||||||
}else{
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -777,6 +776,70 @@ public class WechatAppletController extends BaseController {
|
|||||||
}
|
}
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/studyVideoClassify")
|
||||||
|
public AjaxResult fetchStudyVideoClassify(@RequestParam String openid) {
|
||||||
|
int payed = 0;
|
||||||
|
SysWxUserInfo userInfo = sysWxUserInfoService.selectSysWxUserInfoById(openid);
|
||||||
|
if (StringUtils.isNotNull(userInfo)) {
|
||||||
|
List<SysOrder> orders = sysOrderService.getAllOrderByCusId(userInfo.getCusId());
|
||||||
|
if (StringUtils.isNotEmpty(orders)) {
|
||||||
|
payed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SysVideoClassify sysVideoClassify = new SysVideoClassify();
|
||||||
|
//父级分类ID 0表示主分类
|
||||||
|
sysVideoClassify.setParentId(4l);
|
||||||
|
//客户类型 0未付费客户-playLevel根据上传的标记 1已付费客户-playLevel全为0
|
||||||
|
sysVideoClassify.setUserType(payed);
|
||||||
|
List<VideoClassifyResponse> list = sysVideoClassifyService.getAllClassifyAndVideo(sysVideoClassify);
|
||||||
|
|
||||||
|
String imgUrl = "https://stdiet.oss-cn-shenzhen.aliyuncs.com/videoCover/2021-07-12/";
|
||||||
|
if (StringUtils.isNotNull(list)) {
|
||||||
|
for (VideoClassifyResponse res : list) {
|
||||||
|
List<VideoClassifyResponse> classifies = res.getChildrenClassify();
|
||||||
|
if (StringUtils.isEmpty(classifies)) {
|
||||||
|
res.setImgUrl(AliyunOSSUtils.generatePresignedUrl(imgUrl + res.getId() + ".png"));
|
||||||
|
} else {
|
||||||
|
for (VideoClassifyResponse twoRes : classifies) {
|
||||||
|
twoRes.setImgUrl(AliyunOSSUtils.generatePresignedUrl(imgUrl + twoRes.getId() + ".png"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/studyVideoComments")
|
||||||
|
public AjaxResult fetchStudyVideoComments(@RequestParam String openid, @RequestParam String topicId) {
|
||||||
|
SysVideoComment videoComment = new SysVideoComment();
|
||||||
|
videoComment.setTopicId(topicId);
|
||||||
|
List<SysVideoComment> comments = iSysNutritionalVideoService.selectVideoCommentByTopicId(videoComment, openid);
|
||||||
|
return AjaxResult.success(comments);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/video/post/comment")
|
||||||
|
public AjaxResult videoPostComment(@RequestBody SysVideoComment videoComment, @RequestParam String openid) {
|
||||||
|
SysVideoComment comment = iSysNutritionalVideoService.insertVideoComment(videoComment);
|
||||||
|
if (StringUtils.isNull(comment)) {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success(comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/video/post/reply")
|
||||||
|
public AjaxResult videoPostReply(@RequestBody SysVideoComment videoComment, @RequestParam String openid) {
|
||||||
|
SysVideoComment reply = iSysNutritionalVideoService.insertVideoCommentReply(videoComment);
|
||||||
|
|
||||||
|
if (StringUtils.isNull(reply)) {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success(reply);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@ package com.stdiet.common.core.domain.entity;
|
|||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.stdiet.common.annotation.Excel;
|
import com.stdiet.common.annotation.Excel;
|
||||||
@ -16,6 +19,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author stdiet
|
* @author stdiet
|
||||||
*/
|
*/
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class SysDictData extends BaseEntity
|
public class SysDictData extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
package com.stdiet.custom.dto.response;
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class VideoClassifyResponse implements Serializable {
|
public class VideoClassifyResponse {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
//目录分类ID
|
//目录分类ID
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -19,8 +16,10 @@ public class VideoClassifyResponse implements Serializable {
|
|||||||
//用户类型 0 普通用户 1付费客户
|
//用户类型 0 普通用户 1付费客户
|
||||||
private Integer userType;
|
private Integer userType;
|
||||||
|
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
//子分类
|
//子分类
|
||||||
private List<VideoClassifyTwoResponse> childrenClassify;
|
private List<VideoClassifyResponse> childrenClassify;
|
||||||
|
|
||||||
//子视频
|
//子视频
|
||||||
private List<VideoResponse> childrenVideo;
|
private List<VideoResponse> childrenVideo;
|
||||||
|
@ -299,9 +299,11 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
|||||||
}
|
}
|
||||||
if (comment.getFromRole().equals("phone")) {
|
if (comment.getFromRole().equals("phone")) {
|
||||||
comment.setFromUid(StringUtils.hiddenPhoneNumber(comment.getFromUid()));
|
comment.setFromUid(StringUtils.hiddenPhoneNumber(comment.getFromUid()));
|
||||||
|
comment.setFromName(StringUtils.hiddenPhoneNumber(comment.getFromName()));
|
||||||
}
|
}
|
||||||
if (comment.getToRole().equals("phone")) {
|
if (comment.getToRole().equals("phone")) {
|
||||||
comment.setToUid(StringUtils.hiddenPhoneNumber(comment.getToUid()));
|
comment.setToUid(StringUtils.hiddenPhoneNumber(comment.getToUid()));
|
||||||
|
comment.setToName(StringUtils.hiddenPhoneNumber(comment.getToName()));
|
||||||
}
|
}
|
||||||
List<SysVideoComment> replys = comment.getReplys();
|
List<SysVideoComment> replys = comment.getReplys();
|
||||||
for (SysVideoComment reply : replys) {
|
for (SysVideoComment reply : replys) {
|
||||||
@ -312,9 +314,11 @@ public class SysNutritionalVideoServiceImpl implements ISysNutritionalVideoServi
|
|||||||
}
|
}
|
||||||
if (reply.getFromRole().equals("phone")) {
|
if (reply.getFromRole().equals("phone")) {
|
||||||
reply.setFromUid(StringUtils.hiddenPhoneNumber(reply.getFromUid()));
|
reply.setFromUid(StringUtils.hiddenPhoneNumber(reply.getFromUid()));
|
||||||
|
reply.setFromName(StringUtils.hiddenPhoneNumber(reply.getFromName()));
|
||||||
}
|
}
|
||||||
if (reply.getToRole().equals("phone")) {
|
if (reply.getToRole().equals("phone")) {
|
||||||
reply.setToUid(StringUtils.hiddenPhoneNumber(reply.getToUid()));
|
reply.setToUid(StringUtils.hiddenPhoneNumber(reply.getToUid()));
|
||||||
|
reply.setToName(StringUtils.hiddenPhoneNumber(reply.getToName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
<result column="to_role" property="toRole"/>
|
<result column="to_role" property="toRole"/>
|
||||||
<!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>-->
|
<!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>-->
|
||||||
<result column="create_time" property="createTime"/>
|
<result column="create_time" property="createTime"/>
|
||||||
<!-- <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>-->
|
<association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>
|
||||||
<!-- <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>-->
|
<association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>
|
||||||
<!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>-->
|
<association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>
|
||||||
|
<association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>
|
||||||
<association property="replys" column="id"
|
<association property="replys" column="id"
|
||||||
select="selectVideoCommentReplyByCommentId"/>
|
select="selectVideoCommentReplyByCommentId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
@ -33,30 +34,33 @@
|
|||||||
<result column="reply_id" property="replyId"/>
|
<result column="reply_id" property="replyId"/>
|
||||||
<!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>-->
|
<!-- <result column="img" property="img" typeHandler="com.stdiet.custom.typehandler.ArrayJsonHandler"/>-->
|
||||||
<result column="create_time" property="createTime"/>
|
<result column="create_time" property="createTime"/>
|
||||||
<!-- <association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>-->
|
<association property="fromName" column="{uid=from_uid,role=from_role}" select="selectUserInfo"/>
|
||||||
<!-- <association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>-->
|
<association property="fromAvatar" column="{uid=from_uid,role=from_role}" select="selectUserAvatar"/>
|
||||||
<!-- <association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>-->
|
<association property="toName" column="{uid=to_uid,role=to_role}" select="selectUserInfo"/>
|
||||||
<!-- <association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>-->
|
<association property="toAvatar" column="{uid=to_uid,role=to_role}" select="selectUserAvatar"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectVideoCommentByTopicId" resultMap="SysVideoCommentResult">
|
<select id="selectVideoCommentByTopicId" resultMap="SysVideoCommentResult">
|
||||||
select * from sys_nutritional_video_comment where topic_id = #{topicId} and del_flag = 0
|
select * from sys_nutritional_video_comment where topic_id = #{topicId} and del_flag = 0
|
||||||
order by create_time asc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectVideoCommentReplyByCommentId" resultMap="SysVideoCommentReplyResult">
|
<select id="selectVideoCommentReplyByCommentId" resultMap="SysVideoCommentReplyResult">
|
||||||
select * from sys_nutritional_video_reply where comment_id = #{id} and del_flag = 0
|
select * from sys_nutritional_video_reply where comment_id = #{id} and del_flag = 0
|
||||||
order by create_time asc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询人名-->
|
<!-- 查询人名-->
|
||||||
<select id="selectUserInfo" parameterType="java.util.Map" resultType="String">
|
<select id="selectUserInfo" parameterType="java.util.Map" resultType="String">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="_parameter.get('role') == 'customer'">
|
<when test="_parameter.get('role') == 'customer'">
|
||||||
select name from sys_customer where id = #{uid}
|
select nick_name from sys_wx_user_info where openid = #{uid}
|
||||||
|
</when>
|
||||||
|
<when test="_parameter.get('uid') == null">
|
||||||
|
select "" as nick_name
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
select nick_name from sys_user where user_id = #{uid}
|
select #{uid} as nick_name
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
@ -65,11 +69,10 @@
|
|||||||
<select id="selectUserAvatar" parameterType="java.util.Map" resultType="String">
|
<select id="selectUserAvatar" parameterType="java.util.Map" resultType="String">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="_parameter.get('role') == 'customer'">
|
<when test="_parameter.get('role') == 'customer'">
|
||||||
select avatar_url from sys_wx_user_info where cus_id = #{uid}
|
select avatar_url from sys_wx_user_info where openid = #{uid}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
select IF(avatar != '', CONCAT("https://api.stdiet.top/prod-api", avatar), '') as avatar from sys_user
|
select "" as avatar_url
|
||||||
where user_id = #{uid}
|
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user