1111
This commit is contained in:
parent
5e50b35ef4
commit
8509343e3c
@ -266,7 +266,7 @@ public class CaseExchangeController {
|
||||
UserVoteExchangeModel userVoteExchange = userVoteExchangeDao.selectOne(queryWrapper);
|
||||
if (userVoteExchange != null) {
|
||||
// 已投过票
|
||||
g.getCaseExchangeVote().setIsEnabled(0);
|
||||
g.getCaseExchangeVote().setIsHaveVoted(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,12 +671,12 @@ public class CaseExchangeController {
|
||||
String userId = (String) httpServletRequest.getAttribute("userId");
|
||||
|
||||
if (userId == null) {
|
||||
return Response.error("操作失败1");
|
||||
return Response.error("操作失败");
|
||||
}
|
||||
|
||||
boolean res = caseExchangeService.AddCaseExchangeVote(exchangeId,userId,r.getOptionId());
|
||||
if (!res){
|
||||
return Response.error("操作失败2");
|
||||
return Response.error("操作失败");
|
||||
}
|
||||
|
||||
return Response.success();
|
||||
|
||||
@ -5,18 +5,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.example.caseData.common.Response;
|
||||
import com.example.caseData.dao.*;
|
||||
import com.example.caseData.dto.T;
|
||||
import com.example.caseData.dto.userCaseRead.UserCaseReadDto;
|
||||
import com.example.caseData.dto.userCollectClinicalVideo.UserCollectClinicalVideoDto;
|
||||
import com.example.caseData.dto.userCollectExchange.UserCollectExchangeDto;
|
||||
import com.example.caseData.exception.BusinessException;
|
||||
import com.example.caseData.model.*;
|
||||
import com.example.caseData.request.caseExchangeRequest.addCaseExchangeComment;
|
||||
import com.example.caseData.request.caseExchangeRequest.getCaseExchangeCommentPage;
|
||||
import com.example.caseData.request.userCaseReadRequest.getUserCaseReadSearchPage;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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 org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -190,4 +191,33 @@ public class UserCaseReadController extends BaseController {
|
||||
|
||||
return Response.success(resultMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 浏览记录-新增
|
||||
*/
|
||||
@PostMapping("/user/case/read")
|
||||
public Response<T> AddUserCaseRead(
|
||||
@Validated()
|
||||
@RequestBody addCaseExchangeComment request
|
||||
) {
|
||||
|
||||
String userId = (String) httpServletRequest.getAttribute("userId");
|
||||
|
||||
if (userId == null) {
|
||||
return Response.error("操作失败");
|
||||
}
|
||||
|
||||
// try {
|
||||
// boolean res = caseExchangeService.AddCaseExchangeComment(exchangeId,userId,request);
|
||||
// if (!res){
|
||||
// return Response.error("操作失败");
|
||||
// }
|
||||
// } catch (BusinessException e) {
|
||||
// return Response.error(e.getMessage());
|
||||
// }
|
||||
|
||||
return Response.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -64,6 +64,18 @@ public class CaseClinicalArticleDto {
|
||||
@JsonProperty("cert_image")
|
||||
private String certImage;
|
||||
|
||||
/**
|
||||
* 是否外部链接(0:否 1:是)
|
||||
*/
|
||||
@JsonProperty("is_link")
|
||||
private Integer isLink;
|
||||
|
||||
/**
|
||||
* 外部链接地址
|
||||
*/
|
||||
@JsonProperty("is_link_url")
|
||||
private String isLinkUrl;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
|
||||
@ -64,6 +64,18 @@ public class CaseClinicalVideoDto {
|
||||
@JsonProperty("cert_image")
|
||||
private String certImage;
|
||||
|
||||
/**
|
||||
* 是否外部链接(0:否 1:是)
|
||||
*/
|
||||
@JsonProperty("is_link")
|
||||
private Integer isLink;
|
||||
|
||||
/**
|
||||
* 外部链接地址
|
||||
*/
|
||||
@JsonProperty("is_link_url")
|
||||
private String isLinkUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@ -46,6 +46,12 @@ public class CaseExchangeVoteDto {
|
||||
@JsonProperty("is_enabled")
|
||||
private Integer isEnabled;
|
||||
|
||||
/**
|
||||
* 是否已投票(0: 否 1:是)
|
||||
*/
|
||||
@JsonProperty("is_have_voted")
|
||||
private Integer isHaveVoted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@ -55,6 +55,18 @@ public class CaseClinicalArticleModel {
|
||||
@TableField("cert_image")
|
||||
private String certImage;
|
||||
|
||||
/**
|
||||
* 是否外部链接(0:否 1:是)
|
||||
*/
|
||||
@TableField("is_link")
|
||||
private Integer isLink;
|
||||
|
||||
/**
|
||||
* 外部链接地址
|
||||
*/
|
||||
@TableField("is_link_url")
|
||||
private String isLinkUrl;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
|
||||
@ -64,6 +64,18 @@ public class CaseClinicalVideoModel {
|
||||
@TableField("cert_image")
|
||||
private String certImage;
|
||||
|
||||
/**
|
||||
* 是否外部链接(0:否 1:是)
|
||||
*/
|
||||
@TableField("is_link")
|
||||
private Integer isLink;
|
||||
|
||||
/**
|
||||
* 外部链接地址
|
||||
*/
|
||||
@TableField("is_link_url")
|
||||
private String isLinkUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@ -13,4 +13,10 @@ public class LoginRequest {
|
||||
|
||||
@NotEmpty(message = "错误请求2", groups = {Login.class})
|
||||
private String wx_code;
|
||||
|
||||
/**
|
||||
* 来源(1:小程序 2:h5)
|
||||
*/
|
||||
@NotEmpty(message = "错误请求", groups = {Login.class})
|
||||
private Integer source;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.example.caseData.request.userCaseReadRequest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class addUserCaseRead {
|
||||
// 类型(1:文章 2:视频 3:病例交流)
|
||||
@NotNull(message = "错误")
|
||||
@JsonProperty("type")
|
||||
private Integer type;
|
||||
|
||||
@NotNull(message = "错误")
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user