Compare commits
10 Commits
71f1c01674
...
7a742d7338
Author | SHA1 | Date |
---|---|---|
|
7a742d7338 | |
|
382f32de5f | |
|
02c090a971 | |
|
2b791a875a | |
|
cb5af5202f | |
|
7b0c1f6fbf | |
|
d8c964f98b | |
|
b2a3596f20 | |
|
f77029ead8 | |
|
e34ce61003 |
|
@ -5,17 +5,16 @@ import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.communityCenter.domain.dto.CommentDelRes;
|
import com.mcwl.communityCenter.domain.dto.CommentDelRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.CommentDetailRes;
|
import com.mcwl.communityCenter.domain.dto.CommentDetailRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.CommentRes;
|
import com.mcwl.communityCenter.domain.dto.CommentRes;
|
||||||
import com.mcwl.communityCenter.domain.vo.CommentVo;
|
|
||||||
import com.mcwl.communityCenter.domain.PublishComment;
|
|
||||||
import com.mcwl.communityCenter.service.PublishCommentService;
|
import com.mcwl.communityCenter.service.PublishCommentService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社群评论
|
* 社群评论
|
||||||
|
|
|
@ -62,6 +62,24 @@ public class PublishController {
|
||||||
return publishService.publish(publishRes);
|
return publishService.publish(publishRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发布图片列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取发布图片列表")
|
||||||
|
@PostMapping("publishImage")
|
||||||
|
public TableDataInfo publishImage(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
|
return publishService.publishImage(publishPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发布文件列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取发布文件列表")
|
||||||
|
@PostMapping("publishFile")
|
||||||
|
public TableDataInfo publishFile(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
|
return publishService.publishFile(publishPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -44,15 +44,25 @@ public class QuestionController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取问题列表
|
* 获取提问列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("list")
|
@PostMapping("list")
|
||||||
@ApiOperation(value = "获取问题列表")
|
@ApiOperation(value = "获取提问列表")
|
||||||
public TableDataInfo list(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
public TableDataInfo list(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
||||||
|
|
||||||
return questionService.list(questionPageRes);
|
return questionService.list(questionPageRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提问图片列表
|
||||||
|
*/
|
||||||
|
@PostMapping("listImage")
|
||||||
|
@ApiOperation(value = "获取提问图片列表")
|
||||||
|
public TableDataInfo listImage(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
||||||
|
|
||||||
|
return questionService.listImage(questionPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取问题详情
|
* 获取问题详情
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,6 +14,8 @@ import com.mcwl.memberCenter.service.MemberLevelService;
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
import com.mcwl.memberCenter.service.MemberService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -26,6 +28,7 @@ import java.util.Optional;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("member")
|
@RequestMapping("member")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class MemberController {
|
public class MemberController {
|
||||||
|
|
||||||
private final MemberService memberService;
|
private final MemberService memberService;
|
||||||
|
@ -76,6 +79,7 @@ public class MemberController {
|
||||||
* @return 积分余额和历史记录
|
* @return 积分余额和历史记录
|
||||||
*/
|
*/
|
||||||
@GetMapping("getPoints")
|
@GetMapping("getPoints")
|
||||||
|
@ApiOperation(value = "获取积分余额和历史记录")
|
||||||
public AjaxResult getPoints() {
|
public AjaxResult getPoints() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
|
@ -103,6 +107,7 @@ public class MemberController {
|
||||||
* 会员积分充值
|
* 会员积分充值
|
||||||
*/
|
*/
|
||||||
@PostMapping("rechargePoints")
|
@PostMapping("rechargePoints")
|
||||||
|
@ApiOperation(value = "会员积分充值")
|
||||||
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
||||||
Long userId = rechargePointsDto.getUserId();
|
Long userId = rechargePointsDto.getUserId();
|
||||||
Double amount = rechargePointsDto.getAmount();
|
Double amount = rechargePointsDto.getAmount();
|
||||||
|
@ -129,6 +134,7 @@ public class MemberController {
|
||||||
* 消费积分
|
* 消费积分
|
||||||
*/
|
*/
|
||||||
@GetMapping("consumePoints/{consumePoints}")
|
@GetMapping("consumePoints/{consumePoints}")
|
||||||
|
@ApiOperation(value = "消费积分")
|
||||||
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
||||||
|
|
||||||
if (consumePoints == null || consumePoints <= 0) {
|
if (consumePoints == null || consumePoints <= 0) {
|
||||||
|
@ -145,6 +151,7 @@ public class MemberController {
|
||||||
* 根据会员等级和活动计算支付金额
|
* 根据会员等级和活动计算支付金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calculatePayment")
|
@GetMapping("calculatePayment")
|
||||||
|
@ApiOperation(value = "根据会员等级和活动计算支付金额")
|
||||||
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
||||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||||
Double unitPrice = memberLevel.getUnitPrice();
|
Double unitPrice = memberLevel.getUnitPrice();
|
||||||
|
@ -156,6 +163,7 @@ public class MemberController {
|
||||||
* 是否是会员
|
* 是否是会员
|
||||||
*/
|
*/
|
||||||
@GetMapping("isMember")
|
@GetMapping("isMember")
|
||||||
|
@ApiOperation(value = "是否是会员")
|
||||||
public AjaxResult isMember() {
|
public AjaxResult isMember() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.mcwl.memberCenter.domain.MemberLevel;
|
||||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
import com.mcwl.memberCenter.service.MemberBenefitService;
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||||
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -17,6 +19,7 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("memberLevel")
|
@RequestMapping("memberLevel")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class MemberLevelController {
|
public class MemberLevelController {
|
||||||
|
|
||||||
private final MemberLevelService memberLevelService;
|
private final MemberLevelService memberLevelService;
|
||||||
|
@ -29,6 +32,7 @@ public class MemberLevelController {
|
||||||
* @return 会员等级列表
|
* @return 会员等级列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
|
@ApiOperation(value = "获取会员等级列表")
|
||||||
public AjaxResult list() {
|
public AjaxResult list() {
|
||||||
|
|
||||||
List<MemberLevel> memberLevelList = memberLevelService.list();
|
List<MemberLevel> memberLevelList = memberLevelService.list();
|
||||||
|
@ -41,6 +45,7 @@ public class MemberLevelController {
|
||||||
* 获取会员等级及权益列表
|
* 获取会员等级及权益列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("getMemberBenefitList")
|
@GetMapping("getMemberBenefitList")
|
||||||
|
@ApiOperation(value = "获取会员等级及权益列表")
|
||||||
public AjaxResult getMemberBenefitList() {
|
public AjaxResult getMemberBenefitList() {
|
||||||
|
|
||||||
List<MemberBenefitVO> memberBenefitVOList = new ArrayList<>();
|
List<MemberBenefitVO> memberBenefitVOList = new ArrayList<>();
|
||||||
|
|
|
@ -14,6 +14,8 @@ import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
import com.mcwl.memberCenter.service.MemberService;
|
||||||
import com.mcwl.memberCenter.service.PromotionService;
|
import com.mcwl.memberCenter.service.PromotionService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -29,6 +31,7 @@ import java.util.Optional;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("promotion")
|
@RequestMapping("promotion")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class PromotionController {
|
public class PromotionController {
|
||||||
|
|
||||||
private final PromotionService promotionService;
|
private final PromotionService promotionService;
|
||||||
|
@ -42,6 +45,7 @@ public class PromotionController {
|
||||||
* 创建活动
|
* 创建活动
|
||||||
*/
|
*/
|
||||||
@PostMapping("createPromotion")
|
@PostMapping("createPromotion")
|
||||||
|
@ApiOperation(value = "创建活动")
|
||||||
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||||
|
|
||||||
Date startTime = promotionDto.getStartTime();
|
Date startTime = promotionDto.getStartTime();
|
||||||
|
@ -63,6 +67,7 @@ public class PromotionController {
|
||||||
* 活动列表
|
* 活动列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("promotionList")
|
@GetMapping("promotionList")
|
||||||
|
@ApiOperation(value = "活动列表")
|
||||||
public AjaxResult promotionList() {
|
public AjaxResult promotionList() {
|
||||||
List<Promotion> promotionList = promotionService.lambdaQuery()
|
List<Promotion> promotionList = promotionService.lambdaQuery()
|
||||||
.gt(Promotion::getEndTime, new Date())
|
.gt(Promotion::getEndTime, new Date())
|
||||||
|
@ -74,6 +79,7 @@ public class PromotionController {
|
||||||
* 获取当前用户参与的活动
|
* 获取当前用户参与的活动
|
||||||
*/
|
*/
|
||||||
@GetMapping("myPromotionList")
|
@GetMapping("myPromotionList")
|
||||||
|
@ApiOperation(value = "获取当前用户参与的活动")
|
||||||
public AjaxResult myPromotionList() {
|
public AjaxResult myPromotionList() {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
@ -87,6 +93,7 @@ public class PromotionController {
|
||||||
* 参与活动
|
* 参与活动
|
||||||
*/
|
*/
|
||||||
@PostMapping("joinPromotion")
|
@PostMapping("joinPromotion")
|
||||||
|
@ApiOperation(value = "参与活动")
|
||||||
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
||||||
// 用户id
|
// 用户id
|
||||||
Long userId = joinPromotionDto.getUserId();
|
Long userId = joinPromotionDto.getUserId();
|
||||||
|
|
|
@ -7,6 +7,8 @@ import com.mcwl.myInvitation.domain.Invitation;
|
||||||
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
||||||
import com.mcwl.myInvitation.service.InvitationService;
|
import com.mcwl.myInvitation.service.InvitationService;
|
||||||
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -26,6 +28,7 @@ import static com.mcwl.common.core.domain.AjaxResult.success;
|
||||||
@RestController()
|
@RestController()
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/invitation")
|
@RequestMapping("/invitation")
|
||||||
|
@Api(tags = "邀请管理")
|
||||||
public class InvitationController {
|
public class InvitationController {
|
||||||
|
|
||||||
private final InvitationService invitationService;
|
private final InvitationService invitationService;
|
||||||
|
@ -37,6 +40,7 @@ public class InvitationController {
|
||||||
* @return 邀请码
|
* @return 邀请码
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getInvitationCode")
|
@GetMapping("/getInvitationCode")
|
||||||
|
@ApiOperation(value = "获取邀请码")
|
||||||
public AjaxResult getInvitationCode() {
|
public AjaxResult getInvitationCode() {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
@ -55,6 +59,7 @@ public class InvitationController {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@GetMapping("/list/{userId}")
|
@GetMapping("/list/{userId}")
|
||||||
|
@ApiOperation(value = "获取邀请列表")
|
||||||
public AjaxResult list(@PathVariable Long userId) {
|
public AjaxResult list(@PathVariable Long userId) {
|
||||||
List<Invitation> list = invitationService.lambdaQuery()
|
List<Invitation> list = invitationService.lambdaQuery()
|
||||||
.eq(Invitation::getUserId, userId)
|
.eq(Invitation::getUserId, userId)
|
||||||
|
@ -67,6 +72,7 @@ public class InvitationController {
|
||||||
* 邀请人收益展示
|
* 邀请人收益展示
|
||||||
*/
|
*/
|
||||||
@GetMapping("earningsDisplay")
|
@GetMapping("earningsDisplay")
|
||||||
|
@ApiOperation(value = "邀请人收益展示")
|
||||||
public AjaxResult earningsDisplay() {
|
public AjaxResult earningsDisplay() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,12 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*模型
|
*模型
|
||||||
|
@ -152,6 +155,42 @@ public class MallProductController extends BaseController {
|
||||||
return modelService.selectModelById(id);
|
return modelService.selectModelById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置模型置顶状态
|
||||||
|
* @param id
|
||||||
|
* @param isTop
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "设置模型置顶状态")
|
||||||
|
@PutMapping("/{id}/top")
|
||||||
|
public ResponseEntity<ModelProduct> setModelTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
try {
|
||||||
|
modelService.setModelTop(id, isTop);
|
||||||
|
return ResponseEntity.ok().build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取置顶的模型列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取置顶的模型列表")
|
||||||
|
@GetMapping
|
||||||
|
public ResponseEntity<List<ModelProduct>> fetchModelsSortedByTopStatus() {
|
||||||
|
List<ModelProduct> models = modelService.fetchModelsSortedByTopStatus();
|
||||||
|
return ResponseEntity.ok(models);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的发布-模型
|
* 我的发布-模型
|
||||||
*/
|
*/
|
||||||
|
@ -219,4 +258,6 @@ public class MallProductController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.mcwl.common.core.page.PageDomain;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.resource.domain.ModelImage;
|
import com.mcwl.resource.domain.ModelImage;
|
||||||
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||||
import com.mcwl.resource.domain.dto.ModelImageRes;
|
import com.mcwl.resource.domain.dto.ModelImageRes;
|
||||||
import com.mcwl.resource.domain.vo.ModelImageVo;
|
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||||
|
@ -17,9 +18,11 @@ import com.mcwl.system.service.ISysUserService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,5 +105,33 @@ public class ModelImageController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置图片置顶
|
||||||
|
* @param id
|
||||||
|
* @param isTop
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "设置图片置顶状态")
|
||||||
|
@PutMapping("/{id}/top")
|
||||||
|
public ResponseEntity<ModelImage> setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
try {
|
||||||
|
modelImageLikeService.setModelImageTop(id, isTop);
|
||||||
|
return ResponseEntity.ok().build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取置顶的图片列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取置顶的图片列表")
|
||||||
|
@GetMapping
|
||||||
|
public ResponseEntity<List<ModelImage>> fetchModelImagesSortedByTopStatus() {
|
||||||
|
List<ModelImage> models = modelImageLikeService.fetchModelImageSortedByTopStatus();
|
||||||
|
return ResponseEntity.ok(models);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
|
import com.mcwl.resource.domain.WorkFlow;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||||
import com.mcwl.resource.domain.vo.PageVo;
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
||||||
|
@ -9,9 +11,12 @@ import com.mcwl.web.controller.common.OssUtil;
|
||||||
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.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流
|
* 工作流
|
||||||
|
@ -31,6 +36,38 @@ public class WorkFlowController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private WorkFlowServiceImpl workFlowService;
|
private WorkFlowServiceImpl workFlowService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置工作流的置顶状态
|
||||||
|
* @param id
|
||||||
|
* @param isTop
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "设置工作流的置顶状态")
|
||||||
|
@PutMapping("/{id}/top")
|
||||||
|
public ResponseEntity<WorkFlow> setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
try {
|
||||||
|
workFlowService.setworkFlowTop(id, isTop);
|
||||||
|
return ResponseEntity.ok().build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有工作流,按照置顶状态排序
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取置顶的模型列表")
|
||||||
|
@GetMapping
|
||||||
|
public ResponseEntity<List<WorkFlow>> fetchWorkFlowSortedByTopStatus() {
|
||||||
|
List<WorkFlow> models = workFlowService.fetchWorkFlowSortedByTopStatus();
|
||||||
|
return ResponseEntity.ok(models);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 图片
|
* 图片
|
||||||
* @param file
|
* @param file
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
///*
|
|
||||||
// * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
|
||||||
// *
|
|
||||||
// * https://www.mall4j.com/
|
|
||||||
// *
|
|
||||||
// * 未经允许,不可做商业用途!
|
|
||||||
// *
|
|
||||||
// * 版权所有,侵权必究!
|
|
||||||
// */
|
|
||||||
//package com.mcwl.common.i18n;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.springframework.context.i18n.LocaleContextHolder;
|
|
||||||
//import org.springframework.core.annotation.Order;
|
|
||||||
//import org.springframework.stereotype.Component;
|
|
||||||
//
|
|
||||||
//import javax.servlet.*;
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
|
||||||
//import java.io.IOException;
|
|
||||||
//import java.util.Locale;
|
|
||||||
//import java.util.Objects;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * RequestContextFilter 会传入默认的Locale,优先级(-105) 要比RequestContextFilter优先级高
|
|
||||||
// * @author LGH
|
|
||||||
// */
|
|
||||||
//@Slf4j
|
|
||||||
//@Component
|
|
||||||
//@Order(-104)
|
|
||||||
//public class YamiLocaleChangeFilter implements Filter {
|
|
||||||
//
|
|
||||||
// public static String ZH_CN = "zh_CN";
|
|
||||||
// public static String ZH_CN_L = "zh_cn";
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
|
||||||
// HttpServletRequest request = (HttpServletRequest) servletRequest;
|
|
||||||
// HttpServletResponse response = (HttpServletResponse) servletResponse;
|
|
||||||
//
|
|
||||||
// String newLocale = request.getHeader("locale");
|
|
||||||
// if(Objects.equals(newLocale,ZH_CN)||Objects.equals(newLocale,ZH_CN_L)){
|
|
||||||
// newLocale = "zh";
|
|
||||||
// }
|
|
||||||
// if (newLocale != null) {
|
|
||||||
// String lowerLocale = newLocale.toLowerCase();
|
|
||||||
// LocaleContextHolder.setLocale(new Locale(lowerLocale));
|
|
||||||
// }
|
|
||||||
// filterChain.doFilter(request, response);
|
|
||||||
// }
|
|
||||||
//}
|
|
|
@ -1,58 +0,0 @@
|
||||||
///*
|
|
||||||
// * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
|
||||||
// *
|
|
||||||
// * https://www.mall4j.com/
|
|
||||||
// *
|
|
||||||
// * 未经允许,不可做商业用途!
|
|
||||||
// *
|
|
||||||
// * 版权所有,侵权必究!
|
|
||||||
// */
|
|
||||||
//package com.mcwl.common.i18n;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.springframework.stereotype.Component;
|
|
||||||
//import org.springframework.web.servlet.LocaleResolver;
|
|
||||||
//import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
|
||||||
//import org.springframework.web.servlet.support.RequestContextUtils;
|
|
||||||
//
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @author LGH
|
|
||||||
// */
|
|
||||||
//@Component("localeChangeInterceptor")
|
|
||||||
//@Slf4j
|
|
||||||
//public class YamiLocaleChangeInterceptor extends LocaleChangeInterceptor {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
|
||||||
//
|
|
||||||
// String newLocale = request.getHeader(getParamName());
|
|
||||||
// if (newLocale != null) {
|
|
||||||
// LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
|
|
||||||
// if (localeResolver == null) {
|
|
||||||
// throw new IllegalStateException(
|
|
||||||
// "No LocaleResolver found: not in a DispatcherServlet request?");
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// localeResolver.setLocale(request, response, parseLocaleValue(newLocale));
|
|
||||||
// }
|
|
||||||
// catch (IllegalArgumentException ex) {
|
|
||||||
// if (isIgnoreInvalidLocale()) {
|
|
||||||
// if (logger.isDebugEnabled()) {
|
|
||||||
// logger.debug("Ignoring invalid locale value [" + newLocale + "]: " + ex.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// throw ex;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // Proceed in any case.
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.mcwl.common.core.domain.BaseEntity;
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@ -39,6 +40,16 @@ public class Publish extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布图片
|
||||||
|
*/
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布文件
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布人
|
* 发布人
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,6 +32,17 @@ public class PublishRes {
|
||||||
@NotBlank(message = "内容不能为空")
|
@NotBlank(message = "内容不能为空")
|
||||||
@ApiModelProperty(value = "内容", required = true)
|
@ApiModelProperty(value = "内容", required = true)
|
||||||
private String content;
|
private String content;
|
||||||
|
/**
|
||||||
|
* 发布图片
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发布图片")
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布文件
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发布文件")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布时间 - 定时发布
|
* 发布时间 - 定时发布
|
||||||
|
|
|
@ -8,7 +8,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布、提问信息
|
* 发布信息
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(description = "发布信息")
|
@ApiModel(description = "发布信息")
|
||||||
|
@ -56,6 +56,18 @@ public class PublishVo {
|
||||||
@ApiModelProperty(value = "内容")
|
@ApiModelProperty(value = "内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布图片
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发布图片")
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布文件
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发布文件")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布时间 - 定时发布
|
* 发布时间 - 定时发布
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.mcwl.communityCenter.domain.vo;
|
package com.mcwl.communityCenter.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
@ -8,64 +10,77 @@ import javax.validation.constraints.NotNull;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel(description = "问题信息")
|
||||||
public class QuestionVo {
|
public class QuestionVo {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社区id
|
* 社区id
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "社区id")
|
||||||
private Long communityId;
|
private Long communityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问用户id
|
* 提问用户id
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提问用户id")
|
||||||
private Long questionUserId;
|
private Long questionUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问用户名
|
* 提问用户名
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提问用户名")
|
||||||
private String questionUserName;
|
private String questionUserName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问用户头像
|
* 提问用户头像
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提问用户头像")
|
||||||
private String questionUserAvatar;
|
private String questionUserAvatar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问内容
|
* 提问内容
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提问内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问图片
|
* 提问图片
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提问图片")
|
||||||
private String questionUrl;
|
private String questionUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问时间
|
* 提问时间
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提问时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 答复用户id
|
* 答复用户id
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "答复用户id")
|
||||||
private Long replyUserId;
|
private Long replyUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回复内容
|
* 回复内容
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "回复内容")
|
||||||
private String reply;
|
private String reply;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回复时间
|
* 回复时间
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "回复时间")
|
||||||
private Date replyTime;
|
private Date replyTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否匿名
|
* 是否匿名
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "是否匿名")
|
||||||
private Integer isAnonymous;
|
private Integer isAnonymous;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.security.core.parameters.P;
|
import org.springframework.security.core.parameters.P;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface PublishMapper extends BaseMapper<Publish> {
|
public interface PublishMapper extends BaseMapper<Publish> {
|
||||||
|
|
||||||
|
@ -22,4 +24,19 @@ public interface PublishMapper extends BaseMapper<Publish> {
|
||||||
Long tenantId,
|
Long tenantId,
|
||||||
@Param("communityId")
|
@Param("communityId")
|
||||||
Long communityId);
|
Long communityId);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Page<Publish> selectByTenantIdAndCommunityIdAndNotNullImagePage(Page<Publish> page,
|
||||||
|
@Param("tenantId")
|
||||||
|
Long tenantId,
|
||||||
|
@Param("communityId")
|
||||||
|
Long communityId);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Page<Publish> selectByTenantIdAndCommunityIdAndNotNullFilePage(Page<Publish> page,
|
||||||
|
@Param("tenantId")
|
||||||
|
Long tenantId,
|
||||||
|
@Param("communityId")
|
||||||
|
Long communityId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,4 +30,15 @@ public interface QuestionMapper extends BaseMapper<Question> {
|
||||||
Long tenantId,
|
Long tenantId,
|
||||||
@Param("communityId")
|
@Param("communityId")
|
||||||
Long communityId);
|
Long communityId);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Page<Question> listImage(Page<Question> page,
|
||||||
|
@NotNull(message = "租户不能为空")
|
||||||
|
@Param("tenantId")
|
||||||
|
Long tenantId,
|
||||||
|
@NotNull(message = "社区不能为空")
|
||||||
|
@Param("communityId")
|
||||||
|
Long communityId,
|
||||||
|
@Param("status")
|
||||||
|
Integer status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.mcwl.communityCenter.domain.dto.PublishPageRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.PublishRes;
|
import com.mcwl.communityCenter.domain.dto.PublishRes;
|
||||||
import com.mcwl.communityCenter.domain.vo.PublishVo;
|
import com.mcwl.communityCenter.domain.vo.PublishVo;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -25,4 +26,8 @@ public interface PublishService extends IService<Publish> {
|
||||||
AjaxResult publish(PublishRes publishRes);
|
AjaxResult publish(PublishRes publishRes);
|
||||||
|
|
||||||
TableDataInfo getPublishList(PublishPageRes publishPageRes);
|
TableDataInfo getPublishList(PublishPageRes publishPageRes);
|
||||||
|
|
||||||
|
TableDataInfo publishImage(@Valid PublishPageRes publishPageRes);
|
||||||
|
|
||||||
|
TableDataInfo publishFile(@Valid PublishPageRes publishPageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.mcwl.communityCenter.domain.dto.QuestionReplyRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.QuestionRes;
|
import com.mcwl.communityCenter.domain.dto.QuestionRes;
|
||||||
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
public interface QuestionService extends IService<Question> {
|
public interface QuestionService extends IService<Question> {
|
||||||
|
@ -30,4 +31,6 @@ public interface QuestionService extends IService<Question> {
|
||||||
* @param questionReplyRes 回复信息
|
* @param questionReplyRes 回复信息
|
||||||
*/
|
*/
|
||||||
AjaxResult reply(QuestionReplyRes questionReplyRes);
|
AjaxResult reply(QuestionReplyRes questionReplyRes);
|
||||||
|
|
||||||
|
TableDataInfo listImage(@Valid QuestionPageRes questionPageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,15 +98,7 @@ public class PublishServiceImpl extends ServiceImpl<PublishMapper, Publish> impl
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo getPublishList(PublishPageRes publishPageRes) {
|
public TableDataInfo getPublishList(PublishPageRes publishPageRes) {
|
||||||
|
|
||||||
Page<Publish> page = new Page<>(publishPageRes.getPageNum(), publishPageRes.getPageSize());
|
Page<Publish> page = this.initPage(publishPageRes);
|
||||||
|
|
||||||
if (StringUtils.isBlank(publishPageRes.getOrderByColumn())) {
|
|
||||||
publishPageRes.setOrderByColumn("create_time");
|
|
||||||
}
|
|
||||||
boolean isAsc = Objects.equals(publishPageRes.getIsAsc(), "asc");
|
|
||||||
OrderItem orderItem = new OrderItem(publishPageRes.getOrderByColumn(), isAsc);
|
|
||||||
|
|
||||||
page.addOrder(orderItem);
|
|
||||||
|
|
||||||
// 根据租户id和社区id查询分页数据
|
// 根据租户id和社区id查询分页数据
|
||||||
baseMapper.selectByTenantIdAndCommunityIdPage(page, publishPageRes.getTenantId(), publishPageRes.getCommunityId());
|
baseMapper.selectByTenantIdAndCommunityIdPage(page, publishPageRes.getTenantId(), publishPageRes.getCommunityId());
|
||||||
|
@ -133,4 +125,77 @@ public class PublishServiceImpl extends ServiceImpl<PublishMapper, Publish> impl
|
||||||
tableDataInfo.setMsg("查询成功");
|
tableDataInfo.setMsg("查询成功");
|
||||||
return tableDataInfo;
|
return tableDataInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo publishImage(PublishPageRes publishPageRes) {
|
||||||
|
|
||||||
|
Page<Publish> page = this.initPage(publishPageRes);
|
||||||
|
|
||||||
|
// 根据租户id和社区id和fileUrl不为空查询分页数据
|
||||||
|
baseMapper.selectByTenantIdAndCommunityIdAndNotNullFilePage(page, publishPageRes.getTenantId(), publishPageRes.getCommunityId());
|
||||||
|
|
||||||
|
List<Publish> publishList = page.getRecords();
|
||||||
|
List<PublishVo> publishVoList = new ArrayList<>();
|
||||||
|
for (Publish publish : publishList) {
|
||||||
|
PublishVo publishVo = new PublishVo();
|
||||||
|
BeanUtil.copyProperties(publish, publishVo);
|
||||||
|
Long userId = publish.getUserId();
|
||||||
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||||
|
publishVo.setUserName(sysUser.getUserName());
|
||||||
|
publishVo.setAvatar(sysUser.getAvatar());
|
||||||
|
publishVoList.add(publishVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 封装返回
|
||||||
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
tableDataInfo.setRows(publishVoList);
|
||||||
|
tableDataInfo.setTotal(page.getTotal());
|
||||||
|
tableDataInfo.setCode(HttpStatus.SUCCESS);
|
||||||
|
tableDataInfo.setMsg("查询成功");
|
||||||
|
return tableDataInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo publishFile(PublishPageRes publishPageRes) {
|
||||||
|
Page<Publish> page = this.initPage(publishPageRes);
|
||||||
|
|
||||||
|
// 根据租户id和社区id和imageUrl不为空查询分页数据
|
||||||
|
baseMapper.selectByTenantIdAndCommunityIdAndNotNullFilePage(page, publishPageRes.getTenantId(), publishPageRes.getCommunityId());
|
||||||
|
|
||||||
|
List<Publish> publishList = page.getRecords();
|
||||||
|
List<PublishVo> publishVoList = new ArrayList<>();
|
||||||
|
for (Publish publish : publishList) {
|
||||||
|
PublishVo publishVo = new PublishVo();
|
||||||
|
BeanUtil.copyProperties(publish, publishVo);
|
||||||
|
Long userId = publish.getUserId();
|
||||||
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||||
|
publishVo.setUserName(sysUser.getUserName());
|
||||||
|
publishVo.setAvatar(sysUser.getAvatar());
|
||||||
|
publishVoList.add(publishVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 封装返回
|
||||||
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
tableDataInfo.setRows(publishVoList);
|
||||||
|
tableDataInfo.setTotal(page.getTotal());
|
||||||
|
tableDataInfo.setCode(HttpStatus.SUCCESS);
|
||||||
|
tableDataInfo.setMsg("查询成功");
|
||||||
|
return tableDataInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Page<Publish> initPage(PublishPageRes publishPageRes) {
|
||||||
|
Page<Publish> page = new Page<>(publishPageRes.getPageNum(), publishPageRes.getPageSize());
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(publishPageRes.getOrderByColumn())) {
|
||||||
|
publishPageRes.setOrderByColumn("create_time");
|
||||||
|
}
|
||||||
|
boolean isAsc = Objects.equals(publishPageRes.getIsAsc(), "asc");
|
||||||
|
OrderItem orderItem = new OrderItem(publishPageRes.getOrderByColumn(), isAsc);
|
||||||
|
|
||||||
|
page.addOrder(orderItem);
|
||||||
|
|
||||||
|
return page;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,14 +103,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo list(QuestionPageRes questionPageRes) {
|
public TableDataInfo list(QuestionPageRes questionPageRes) {
|
||||||
|
|
||||||
Page<Question> page = new Page<>(questionPageRes.getPageNum(), questionPageRes.getPageSize());
|
Page<Question> page = initPage(questionPageRes);
|
||||||
OrderItem orderItem = new OrderItem();
|
|
||||||
if (StringUtils.isBlank(questionPageRes.getOrderByColumn())) {
|
|
||||||
questionPageRes.setOrderByColumn("create_time");
|
|
||||||
}
|
|
||||||
orderItem.setColumn(questionPageRes.getOrderByColumn());
|
|
||||||
orderItem.setAsc(Objects.equals(questionPageRes.getIsAsc(), "asc"));
|
|
||||||
page.addOrder(orderItem);
|
|
||||||
|
|
||||||
baseMapper.list(page, questionPageRes.getTenantId(), questionPageRes.getCommunityId(), questionPageRes.getStatus());
|
baseMapper.list(page, questionPageRes.getTenantId(), questionPageRes.getCommunityId(), questionPageRes.getStatus());
|
||||||
|
|
||||||
|
@ -191,5 +184,49 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo listImage(QuestionPageRes questionPageRes) {
|
||||||
|
|
||||||
|
Page<Question> page = initPage(questionPageRes);
|
||||||
|
|
||||||
|
baseMapper.listImage(page, questionPageRes.getTenantId(), questionPageRes.getCommunityId(), questionPageRes.getStatus());
|
||||||
|
|
||||||
|
// 获取分页数据
|
||||||
|
List<Question> questionList = page.getRecords();
|
||||||
|
// Question数据转为QuestionVo
|
||||||
|
List<QuestionVo> questionVoList = new ArrayList<>();
|
||||||
|
for (Question question : questionList) {
|
||||||
|
QuestionVo questionVo = new QuestionVo();
|
||||||
|
BeanUtil.copyProperties(question, questionVo);
|
||||||
|
Long questionUserId = question.getQuestionUserId();
|
||||||
|
SysUser sysUser = sysUserService.selectUserById(questionUserId);
|
||||||
|
questionVo.setQuestionUserName(sysUser.getUserName());
|
||||||
|
questionVo.setQuestionUserAvatar(sysUser.getAvatar());
|
||||||
|
questionVoList.add(questionVo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 封装分页信息
|
||||||
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
|
rspData.setCode(HttpStatus.SUCCESS);
|
||||||
|
rspData.setMsg("查询成功");
|
||||||
|
rspData.setRows(questionVoList);
|
||||||
|
rspData.setTotal(page.getTotal());
|
||||||
|
|
||||||
|
return rspData;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Page<Question> initPage(QuestionPageRes questionPageRes) {
|
||||||
|
Page<Question> page = new Page<>(questionPageRes.getPageNum(), questionPageRes.getPageSize());
|
||||||
|
OrderItem orderItem = new OrderItem();
|
||||||
|
if (StringUtils.isBlank(questionPageRes.getOrderByColumn())) {
|
||||||
|
questionPageRes.setOrderByColumn("create_time");
|
||||||
|
}
|
||||||
|
orderItem.setColumn(questionPageRes.getOrderByColumn());
|
||||||
|
orderItem.setAsc(Objects.equals(questionPageRes.getIsAsc(), "asc"));
|
||||||
|
page.addOrder(orderItem);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,84 @@
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper">
|
<mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper">
|
||||||
<select id="selectByTenantIdAndCommunityIdPage" resultType="com.mcwl.communityCenter.domain.Publish">
|
<select id="selectByTenantIdAndCommunityIdPage" resultType="com.mcwl.communityCenter.domain.Publish">
|
||||||
select id, tenant_id, community_id, user_id, content, publish_time, like_num, comment_num, status, create_by, create_time
|
select id,
|
||||||
|
tenant_id,
|
||||||
|
community_id,
|
||||||
|
user_id,
|
||||||
|
content,
|
||||||
|
image_url,
|
||||||
|
file_url,
|
||||||
|
publish_time,
|
||||||
|
like_num,
|
||||||
|
comment_num,
|
||||||
|
status,
|
||||||
|
create_by,
|
||||||
|
create_time
|
||||||
from cc_publish
|
from cc_publish
|
||||||
where tenant_id = #{tenantId}
|
where tenant_id = #{tenantId}
|
||||||
and community_id = #{communityId}
|
and community_id = #{communityId}
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByIdAndTenantIdAndCommunityId" resultType="com.mcwl.communityCenter.domain.Publish">
|
<select id="selectByIdAndTenantIdAndCommunityId" resultType="com.mcwl.communityCenter.domain.Publish">
|
||||||
select id, tenant_id, community_id, user_id, content, publish_time, like_num, comment_num, status, create_by, create_time
|
select id,
|
||||||
|
tenant_id,
|
||||||
|
community_id,
|
||||||
|
user_id,
|
||||||
|
content,
|
||||||
|
image_url,
|
||||||
|
file_url,
|
||||||
|
publish_time,
|
||||||
|
like_num,
|
||||||
|
comment_num,
|
||||||
|
status,
|
||||||
|
create_by,
|
||||||
|
create_time
|
||||||
from cc_publish
|
from cc_publish
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
and tenant_id = #{tenantId}
|
and tenant_id = #{tenantId}
|
||||||
and community_id = #{communityId}
|
and community_id = #{communityId}
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByTenantIdAndCommunityIdAndNotNullImagePage"
|
||||||
|
resultType="com.mcwl.communityCenter.domain.Publish">
|
||||||
|
select id,
|
||||||
|
tenant_id,
|
||||||
|
community_id,
|
||||||
|
user_id,
|
||||||
|
content,
|
||||||
|
image_url,
|
||||||
|
file_url,
|
||||||
|
publish_time,
|
||||||
|
like_num,
|
||||||
|
comment_num,
|
||||||
|
status,
|
||||||
|
create_by,
|
||||||
|
create_time
|
||||||
|
from cc_publish
|
||||||
|
where tenant_id = #{tenantId}
|
||||||
|
and community_id = #{communityId}
|
||||||
|
and del_flag = '0'
|
||||||
|
and image_url is not null
|
||||||
|
</select>
|
||||||
|
<select id="selectByTenantIdAndCommunityIdAndNotNullFilePage"
|
||||||
|
resultType="com.mcwl.communityCenter.domain.Publish">
|
||||||
|
select id,
|
||||||
|
tenant_id,
|
||||||
|
community_id,
|
||||||
|
user_id,
|
||||||
|
content,
|
||||||
|
image_url,
|
||||||
|
file_url,
|
||||||
|
publish_time,
|
||||||
|
like_num,
|
||||||
|
comment_num,
|
||||||
|
status,
|
||||||
|
create_by,
|
||||||
|
create_time
|
||||||
|
from cc_publish
|
||||||
|
where tenant_id = #{tenantId}
|
||||||
|
and community_id = #{communityId}
|
||||||
|
and del_flag = '0'
|
||||||
|
and file_url is not null
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -23,4 +23,15 @@
|
||||||
and community_id = #{communityId}
|
and community_id = #{communityId}
|
||||||
and del_flag = '0'
|
and del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listImage" resultType="com.mcwl.communityCenter.domain.Question">
|
||||||
|
select id, tenant_id, community_id, question_user_id, content,question_url, reply,reply_time,is_anonymous,status
|
||||||
|
from cc_question
|
||||||
|
where del_flag = '0'
|
||||||
|
and tenant_id = #{tenantId}
|
||||||
|
and community_id = #{communityId}
|
||||||
|
<if test="status != null">
|
||||||
|
and status= #{status}
|
||||||
|
</if>
|
||||||
|
and question_url is not null
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -123,6 +123,14 @@ public class ModelProduct extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "是否推荐模型")
|
@ApiModelProperty(value = "是否推荐模型")
|
||||||
private Integer isRecommend;
|
private Integer isRecommend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否置顶
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否置顶")
|
||||||
|
private Integer isTop;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -147,6 +147,12 @@ public class WorkFlow {
|
||||||
@ApiModelProperty(value = "审核权限")
|
@ApiModelProperty(value = "审核权限")
|
||||||
private Integer jurisdiction;
|
private Integer jurisdiction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否置顶
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否置顶")
|
||||||
|
private Integer isTop;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,7 +5,15 @@ import com.mcwl.resource.domain.ModelImage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ModelImageMapper extends BaseMapper<ModelImage> {
|
public interface ModelImageMapper extends BaseMapper<ModelImage> {
|
||||||
Long sumLikeNumber(@Param("userId") Long userId);
|
Long sumLikeNumber(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
List<ModelImage> fetchModelImageSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
|
void setModelImageTop(@Param("id") Long id, @Param("isTop") int i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.mcwl.resource.domain.ModelProduct;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
|
@ -27,4 +29,11 @@ public interface ModelMapper extends BaseMapper<ModelProduct> {
|
||||||
Long sumLikeNumber(@Param("userId") Long userId);
|
Long sumLikeNumber(@Param("userId") Long userId);
|
||||||
|
|
||||||
Long sumRunNumber(Long userId);
|
Long sumRunNumber(Long userId);
|
||||||
|
|
||||||
|
void updateTopStatus(@Param("id") Long id, @Param("isTop") int i);
|
||||||
|
|
||||||
|
List<ModelProduct> selectAllModelsSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.mcwl.resource.domain.WorkFlow;
|
import com.mcwl.resource.domain.WorkFlow;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流
|
* 工作流
|
||||||
* @author DaiZibo
|
* @author DaiZibo
|
||||||
|
@ -16,4 +18,9 @@ public interface WorkFlowMapper extends BaseMapper<WorkFlow> {
|
||||||
|
|
||||||
void updateWorkFlow(WorkFlow workFlow);
|
void updateWorkFlow(WorkFlow workFlow);
|
||||||
|
|
||||||
|
List<WorkFlow> fetchWorkFlowSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
|
void setworkFlowTop(Long id, int i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.mcwl.resource.domain.ModelImage;
|
import com.mcwl.resource.domain.ModelImage;
|
||||||
import com.mcwl.resource.domain.ModelImageLike;
|
import com.mcwl.resource.domain.ModelImageLike;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public interface ModelImageLikeService extends IService<ModelImageLike> {
|
public interface ModelImageLikeService extends IService<ModelImageLike> {
|
||||||
|
|
||||||
void like(Long imageId);
|
void like(Long imageId);
|
||||||
|
|
||||||
|
void setModelImageTop(Long id, boolean isTop);
|
||||||
|
|
||||||
|
|
||||||
|
List<ModelImage> fetchModelImageSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,8 @@ public interface ModelImageService extends IService<ModelImage> {
|
||||||
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
||||||
|
|
||||||
ModelImageVo getDetail(@NotNull(message = "图片id不能为空") Long imageId);
|
ModelImageVo getDetail(@NotNull(message = "图片id不能为空") Long imageId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,4 +36,10 @@ public interface ModelService extends IService<ModelProduct> {
|
||||||
|
|
||||||
AjaxResult selectModelById(Long id);
|
AjaxResult selectModelById(Long id);
|
||||||
|
|
||||||
|
void setModelTop(Long id, boolean isTop);
|
||||||
|
|
||||||
|
List<ModelProduct> fetchModelsSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||||
import com.mcwl.resource.domain.vo.PageVo;
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流 业务层
|
* 工作流 业务层
|
||||||
* @author DaiZibo
|
* @author DaiZibo
|
||||||
|
@ -29,4 +31,9 @@ public interface WorkFlowService extends IService<WorkFlow> {
|
||||||
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
TableDataInfo listByPage(ModelImagePageRes imagePageRes);
|
||||||
|
|
||||||
|
|
||||||
|
void setworkFlowTop(Long id, boolean isTop);
|
||||||
|
|
||||||
|
List<WorkFlow> fetchWorkFlowSortedByTopStatus();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,19 +46,27 @@ public class ModelCommentServiceImpl extends ServiceImpl<ModelCommentMapper, Mod
|
||||||
@Override
|
@Override
|
||||||
public void comment(ModelComment modelComment) {
|
public void comment(ModelComment modelComment) {
|
||||||
Long parentId = modelComment.getParentId();
|
Long parentId = modelComment.getParentId();
|
||||||
ModelComment mic = modelCommentMapper.selectById(parentId);
|
|
||||||
|
|
||||||
if (Objects.nonNull(parentId) && Objects.isNull(mic)) {
|
if (Objects.nonNull(parentId)) {
|
||||||
|
ModelComment mic = modelCommentMapper.selectById(parentId);
|
||||||
|
if (Objects.isNull(mic)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
modelComment.setUserId(SecurityUtils.getUserId());
|
modelComment.setUserId(SecurityUtils.getUserId());
|
||||||
modelComment.setCreateBy(SecurityUtils.getUsername());
|
modelComment.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
modelComment.setCreateTime(new Date());
|
||||||
modelComment.setUpdateBy(SecurityUtils.getUsername());
|
modelComment.setUpdateBy(SecurityUtils.getUsername());
|
||||||
modelComment.setUpdateTime(new Date());
|
modelComment.setUpdateTime(new Date());
|
||||||
modelCommentMapper.insert(modelComment);
|
modelCommentMapper.insert(modelComment);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取评论
|
||||||
|
*
|
||||||
|
* @param imageId 图片id
|
||||||
|
* @return 评论区
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ModelCommentVo> getComment(Long imageId) {
|
public List<ModelCommentVo> getComment(Long imageId) {
|
||||||
List<ModelCommentVo> modelCommentVoList = new ArrayList<>();
|
List<ModelCommentVo> modelCommentVoList = new ArrayList<>();
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -58,4 +59,14 @@ public class ModelImageLikeServiceImpl extends ServiceImpl<ModelImageLikeMapper,
|
||||||
modelImage.setLikeNum(modelImage.getLikeNum() + 1);
|
modelImage.setLikeNum(modelImage.getLikeNum() + 1);
|
||||||
modelImageMapper.updateById(modelImage);
|
modelImageMapper.updateById(modelImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setModelImageTop(Long id, boolean isTop) {
|
||||||
|
modelImageMapper.setModelImageTop(id,isTop?0:1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelImage> fetchModelImageSortedByTopStatus() {
|
||||||
|
return modelImageMapper.fetchModelImageSortedByTopStatus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,27 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
@Autowired
|
@Autowired
|
||||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置模型置顶状态
|
||||||
|
*
|
||||||
|
* @param id 模型ID
|
||||||
|
* @param isTop 是否置顶
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setModelTop(Long id, boolean isTop) {
|
||||||
|
postMapper.updateTopStatus(id, isTop ? 1 : 0);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取模型列表
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return 模型列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelProduct> fetchModelsSortedByTopStatus() {
|
||||||
|
return postMapper.selectAllModelsSortedByTopStatus();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
|
public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
|
||||||
|
|
||||||
|
@ -176,6 +196,39 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
return AjaxResult.success("添加成功,等待审核");
|
return AjaxResult.success("添加成功,等待审核");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updaModel(RequestModel requestModel) {
|
||||||
|
//修改模版的信息
|
||||||
|
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||||
|
if (ObjectUtils.isNotEmpty(modelProduct)){
|
||||||
|
|
||||||
|
if (StringUtils.isNotNull(modelProduct.getId())){
|
||||||
|
modelProduct.setAuditStatus(3);
|
||||||
|
modelProduct.setUpdateTime(new Date());
|
||||||
|
postMapper.updateById(requestModel.getModelProduct());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改工作流版本的信息
|
||||||
|
if (requestModel.getModelVersionList().size() != 0){
|
||||||
|
|
||||||
|
//批量修改
|
||||||
|
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
||||||
|
modelVersion.setAuditStatus(3);
|
||||||
|
modelVersionMapper.updateById(modelVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
ModelProduct model = ModelProduct.builder().
|
||||||
|
id(requestModel.getModelVersionList().get(0).
|
||||||
|
getModelId()).build();
|
||||||
|
model.setUpdateTime(new Date());
|
||||||
|
postMapper.updateById(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
//审核
|
||||||
|
audit(requestModel);
|
||||||
|
|
||||||
|
}
|
||||||
private void audit(RequestModel requestModel) {
|
private void audit(RequestModel requestModel) {
|
||||||
|
|
||||||
// 执行审核操作
|
// 执行审核操作
|
||||||
|
@ -313,39 +366,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updaModel(RequestModel requestModel) {
|
|
||||||
//修改模版的信息
|
|
||||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
|
||||||
if (ObjectUtils.isNotEmpty(modelProduct)){
|
|
||||||
|
|
||||||
if (StringUtils.isNotNull(modelProduct.getId())){
|
|
||||||
modelProduct.setAuditStatus(3);
|
|
||||||
modelProduct.setUpdateTime(new Date());
|
|
||||||
postMapper.updateById(requestModel.getModelProduct());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//修改工作流版本的信息
|
|
||||||
if (requestModel.getModelVersionList().size() != 0){
|
|
||||||
|
|
||||||
//批量修改
|
|
||||||
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
|
||||||
modelVersion.setAuditStatus(3);
|
|
||||||
modelVersionMapper.updateById(modelVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
ModelProduct model = ModelProduct.builder().
|
|
||||||
id(requestModel.getModelVersionList().get(0).
|
|
||||||
getModelId()).build();
|
|
||||||
model.setUpdateTime(new Date());
|
|
||||||
postMapper.updateById(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
//审核
|
|
||||||
audit(requestModel);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult selectModelById(Long id) {
|
public AjaxResult selectModelById(Long id) {
|
||||||
|
@ -384,4 +404,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,5 +387,15 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setworkFlowTop(Long id, boolean isTop) {
|
||||||
|
flowMapper.setworkFlowTop(id,isTop?0:1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WorkFlow> fetchWorkFlowSortedByTopStatus() {
|
||||||
|
return flowMapper.fetchWorkFlowSortedByTopStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.resource.mapper.ModelImageMapper">
|
<mapper namespace="com.mcwl.resource.mapper.ModelImageMapper">
|
||||||
|
<update id="setModelImageTop">
|
||||||
|
UPDATE model_image SET is_top = #{isTop} WHERE image_id = #{imageId}
|
||||||
|
</update>
|
||||||
|
<update id="fetchModelImageSortedByTopStatus">
|
||||||
|
SELECT is_top FROM model_image ORDER BY is_top DESC;
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="sumLikeNumber" resultType="java.lang.Long">
|
<select id="sumLikeNumber" resultType="java.lang.Long">
|
||||||
SELECT sum(like_num)sum FROM model_image where user_id = #{userId} ORDER BY(user_id);
|
SELECT sum(like_num)sum FROM model_image where user_id = #{userId} ORDER BY(user_id);
|
||||||
|
|
|
@ -69,6 +69,9 @@
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateTopStatus">
|
||||||
|
update model set is_top = #{isTop} where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<select id="sumNumber" resultType="java.lang.Long">
|
<select id="sumNumber" resultType="java.lang.Long">
|
||||||
|
@ -81,5 +84,8 @@
|
||||||
<select id="sumRunNumber" resultType="java.lang.Long">
|
<select id="sumRunNumber" resultType="java.lang.Long">
|
||||||
SELECT sum(reals)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
SELECT sum(reals)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectAllModelsSortedByTopStatus" resultType="com.mcwl.resource.domain.ModelProduct">
|
||||||
|
SELECT is_top FROM model ORDER BY is_top DESC;
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -31,4 +31,11 @@
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="setworkFlowTop">
|
||||||
|
UPDATE work_flow SET is_top = #{isTop} WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="fetchWorkFlowSortedByTopStatus" resultType="com.mcwl.resource.domain.WorkFlow">
|
||||||
|
SELECT is_top FROM work_flow ORDER BY is_top DESC;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue