Merge branch 'preview' of https://gitea.qinmian.online/CY/mcwl-ai into preview
# Conflicts: # mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelServiceImpl.javamaster
commit
7b0c1f6fbf
|
@ -62,6 +62,24 @@ public class PublishController {
|
|||
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")
|
||||
@ApiOperation(value = "获取问题列表")
|
||||
@ApiOperation(value = "获取提问列表")
|
||||
public TableDataInfo list(@RequestBody @Valid QuestionPageRes 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.system.service.ISysUserService;
|
||||
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -26,6 +28,7 @@ import java.util.Optional;
|
|||
@RestController
|
||||
@RequestMapping("member")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "会员中心")
|
||||
public class MemberController {
|
||||
|
||||
private final MemberService memberService;
|
||||
|
@ -76,6 +79,7 @@ public class MemberController {
|
|||
* @return 积分余额和历史记录
|
||||
*/
|
||||
@GetMapping("getPoints")
|
||||
@ApiOperation(value = "获取积分余额和历史记录")
|
||||
public AjaxResult getPoints() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
|
@ -103,6 +107,7 @@ public class MemberController {
|
|||
* 会员积分充值
|
||||
*/
|
||||
@PostMapping("rechargePoints")
|
||||
@ApiOperation(value = "会员积分充值")
|
||||
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
||||
Long userId = rechargePointsDto.getUserId();
|
||||
Double amount = rechargePointsDto.getAmount();
|
||||
|
@ -129,6 +134,7 @@ public class MemberController {
|
|||
* 消费积分
|
||||
*/
|
||||
@GetMapping("consumePoints/{consumePoints}")
|
||||
@ApiOperation(value = "消费积分")
|
||||
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
||||
|
||||
if (consumePoints == null || consumePoints <= 0) {
|
||||
|
@ -145,6 +151,7 @@ public class MemberController {
|
|||
* 根据会员等级和活动计算支付金额
|
||||
*/
|
||||
@GetMapping("calculatePayment")
|
||||
@ApiOperation(value = "根据会员等级和活动计算支付金额")
|
||||
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||
Double unitPrice = memberLevel.getUnitPrice();
|
||||
|
@ -156,6 +163,7 @@ public class MemberController {
|
|||
* 是否是会员
|
||||
*/
|
||||
@GetMapping("isMember")
|
||||
@ApiOperation(value = "是否是会员")
|
||||
public AjaxResult isMember() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
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.MemberLevelService;
|
||||
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -17,6 +19,7 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("memberLevel")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "会员中心")
|
||||
public class MemberLevelController {
|
||||
|
||||
private final MemberLevelService memberLevelService;
|
||||
|
@ -29,6 +32,7 @@ public class MemberLevelController {
|
|||
* @return 会员等级列表
|
||||
*/
|
||||
@GetMapping("list")
|
||||
@ApiOperation(value = "获取会员等级列表")
|
||||
public AjaxResult list() {
|
||||
|
||||
List<MemberLevel> memberLevelList = memberLevelService.list();
|
||||
|
@ -41,6 +45,7 @@ public class MemberLevelController {
|
|||
* 获取会员等级及权益列表
|
||||
*/
|
||||
@GetMapping("getMemberBenefitList")
|
||||
@ApiOperation(value = "获取会员等级及权益列表")
|
||||
public AjaxResult getMemberBenefitList() {
|
||||
|
||||
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.MemberService;
|
||||
import com.mcwl.memberCenter.service.PromotionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -29,6 +31,7 @@ import java.util.Optional;
|
|||
@RestController
|
||||
@RequestMapping("promotion")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "会员中心")
|
||||
public class PromotionController {
|
||||
|
||||
private final PromotionService promotionService;
|
||||
|
@ -42,6 +45,7 @@ public class PromotionController {
|
|||
* 创建活动
|
||||
*/
|
||||
@PostMapping("createPromotion")
|
||||
@ApiOperation(value = "创建活动")
|
||||
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||
|
||||
Date startTime = promotionDto.getStartTime();
|
||||
|
@ -63,6 +67,7 @@ public class PromotionController {
|
|||
* 活动列表
|
||||
*/
|
||||
@GetMapping("promotionList")
|
||||
@ApiOperation(value = "活动列表")
|
||||
public AjaxResult promotionList() {
|
||||
List<Promotion> promotionList = promotionService.lambdaQuery()
|
||||
.gt(Promotion::getEndTime, new Date())
|
||||
|
@ -74,6 +79,7 @@ public class PromotionController {
|
|||
* 获取当前用户参与的活动
|
||||
*/
|
||||
@GetMapping("myPromotionList")
|
||||
@ApiOperation(value = "获取当前用户参与的活动")
|
||||
public AjaxResult myPromotionList() {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
@ -87,6 +93,7 @@ public class PromotionController {
|
|||
* 参与活动
|
||||
*/
|
||||
@PostMapping("joinPromotion")
|
||||
@ApiOperation(value = "参与活动")
|
||||
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
||||
// 用户id
|
||||
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.service.InvitationService;
|
||||
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -26,6 +28,7 @@ import static com.mcwl.common.core.domain.AjaxResult.success;
|
|||
@RestController()
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/invitation")
|
||||
@Api(tags = "邀请管理")
|
||||
public class InvitationController {
|
||||
|
||||
private final InvitationService invitationService;
|
||||
|
@ -37,6 +40,7 @@ public class InvitationController {
|
|||
* @return 邀请码
|
||||
*/
|
||||
@GetMapping("/getInvitationCode")
|
||||
@ApiOperation(value = "获取邀请码")
|
||||
public AjaxResult getInvitationCode() {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
@ -55,6 +59,7 @@ public class InvitationController {
|
|||
*/
|
||||
|
||||
@GetMapping("/list/{userId}")
|
||||
@ApiOperation(value = "获取邀请列表")
|
||||
public AjaxResult list(@PathVariable Long userId) {
|
||||
List<Invitation> list = invitationService.lambdaQuery()
|
||||
.eq(Invitation::getUserId, userId)
|
||||
|
@ -67,6 +72,7 @@ public class InvitationController {
|
|||
* 邀请人收益展示
|
||||
*/
|
||||
@GetMapping("earningsDisplay")
|
||||
@ApiOperation(value = "邀请人收益展示")
|
||||
public AjaxResult earningsDisplay() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.mcwl.common.constant.DictConstants;
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.service.ModelVersionService;
|
||||
import com.mcwl.system.init.DictInit;
|
||||
|
@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/** 模型版本
|
||||
|
@ -85,7 +82,16 @@ public class ModelVersionController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 详情页 版本列表
|
||||
* @param modelId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByModelId")
|
||||
public AjaxResult selectByModelId(@RequestParam Long modelId){
|
||||
|
||||
return modelVersionService.selectByModelId(modelId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "模型版本列表")
|
||||
@PostMapping("list")
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.Report;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.service.ReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 举报功能
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/18
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@RequestMapping("/report")
|
||||
@RestController
|
||||
public class ReportController {
|
||||
|
||||
@Autowired
|
||||
private ReportService reportService;
|
||||
|
||||
/**
|
||||
* 新增举报内容
|
||||
* @param report
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/addReport")
|
||||
public AjaxResult addReport(@RequestBody Report report){
|
||||
|
||||
reportService.addReport(report);
|
||||
return AjaxResult.success("举报成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询举报列表
|
||||
* @param pageVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectReport")
|
||||
public AjaxResult selectReport(@RequestBody PageVo pageVo){
|
||||
|
||||
|
||||
return reportService.selectReport(pageVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除举报
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/deleteReport")
|
||||
public AjaxResult deleteReport(@RequestParam Long id){
|
||||
|
||||
reportService.deleteReport(id);
|
||||
return AjaxResult.success("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/updateStatus")
|
||||
public AjaxResult updateStatus(@RequestParam Long id){
|
||||
|
||||
reportService.updateStatus(id);
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
}
|
|
@ -48,7 +48,7 @@ public class ToActivityController extends BaseController {
|
|||
@PostMapping("finById")
|
||||
public AjaxResult finById(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
return AjaxResult.success(toActivityService.getById(toActivity));
|
||||
return AjaxResult.success(toActivityService.getById(toActivity.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
@ -39,6 +40,16 @@ public class Publish extends BaseEntity {
|
|||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 发布图片
|
||||
*/
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 发布文件
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
|
|
|
@ -32,6 +32,17 @@ public class PublishRes {
|
|||
@NotBlank(message = "内容不能为空")
|
||||
@ApiModelProperty(value = "内容", required = true)
|
||||
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;
|
||||
|
||||
/**
|
||||
* 发布、提问信息
|
||||
* 发布信息
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "发布信息")
|
||||
|
@ -56,6 +56,18 @@ public class PublishVo {
|
|||
@ApiModelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 发布图片
|
||||
*/
|
||||
@ApiModelProperty(value = "发布图片")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 发布文件
|
||||
*/
|
||||
@ApiModelProperty(value = "发布文件")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 发布时间 - 定时发布
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.mcwl.communityCenter.domain.vo;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
@ -8,64 +10,77 @@ import javax.validation.constraints.NotNull;
|
|||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "问题信息")
|
||||
public class QuestionVo {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 社区id
|
||||
*/
|
||||
@ApiModelProperty(value = "社区id")
|
||||
private Long communityId;
|
||||
|
||||
/**
|
||||
* 提问用户id
|
||||
*/
|
||||
@ApiModelProperty(value = "提问用户id")
|
||||
private Long questionUserId;
|
||||
|
||||
/**
|
||||
* 提问用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "提问用户名")
|
||||
private String questionUserName;
|
||||
|
||||
/**
|
||||
* 提问用户头像
|
||||
*/
|
||||
@ApiModelProperty(value = "提问用户头像")
|
||||
private String questionUserAvatar;
|
||||
|
||||
/**
|
||||
* 提问内容
|
||||
*/
|
||||
@ApiModelProperty(value = "提问内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 提问图片
|
||||
*/
|
||||
@ApiModelProperty(value = "提问图片")
|
||||
private String questionUrl;
|
||||
|
||||
/**
|
||||
* 提问时间
|
||||
*/
|
||||
@ApiModelProperty(value = "提问时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 答复用户id
|
||||
*/
|
||||
@ApiModelProperty(value = "答复用户id")
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复内容
|
||||
*/
|
||||
@ApiModelProperty(value = "回复内容")
|
||||
private String reply;
|
||||
|
||||
/**
|
||||
* 回复时间
|
||||
*/
|
||||
@ApiModelProperty(value = "回复时间")
|
||||
private Date replyTime;
|
||||
|
||||
/**
|
||||
* 是否匿名
|
||||
*/
|
||||
@ApiModelProperty(value = "是否匿名")
|
||||
private Integer isAnonymous;
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Mapper
|
||||
public interface PublishMapper extends BaseMapper<Publish> {
|
||||
|
||||
|
@ -22,4 +24,19 @@ public interface PublishMapper extends BaseMapper<Publish> {
|
|||
Long tenantId,
|
||||
@Param("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,
|
||||
@Param("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.vo.PublishVo;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -25,4 +26,8 @@ public interface PublishService extends IService<Publish> {
|
|||
AjaxResult publish(PublishRes publishRes);
|
||||
|
||||
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.vo.QuestionVo;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public interface QuestionService extends IService<Question> {
|
||||
|
@ -30,4 +31,6 @@ public interface QuestionService extends IService<Question> {
|
|||
* @param questionReplyRes 回复信息
|
||||
*/
|
||||
AjaxResult reply(QuestionReplyRes questionReplyRes);
|
||||
|
||||
TableDataInfo listImage(@Valid QuestionPageRes questionPageRes);
|
||||
}
|
||||
|
|
|
@ -98,15 +98,7 @@ public class PublishServiceImpl extends ServiceImpl<PublishMapper, Publish> impl
|
|||
@Override
|
||||
public TableDataInfo getPublishList(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);
|
||||
Page<Publish> page = this.initPage(publishPageRes);
|
||||
|
||||
// 根据租户id和社区id查询分页数据
|
||||
baseMapper.selectByTenantIdAndCommunityIdPage(page, publishPageRes.getTenantId(), publishPageRes.getCommunityId());
|
||||
|
@ -133,4 +125,77 @@ public class PublishServiceImpl extends ServiceImpl<PublishMapper, Publish> impl
|
|||
tableDataInfo.setMsg("查询成功");
|
||||
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
|
||||
public TableDataInfo list(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);
|
||||
Page<Question> page = initPage(questionPageRes);
|
||||
|
||||
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">
|
||||
<mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper">
|
||||
<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
|
||||
where tenant_id = #{tenantId}
|
||||
and community_id = #{communityId}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
<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
|
||||
where id = #{id}
|
||||
and tenant_id = #{tenantId}
|
||||
and community_id = #{communityId}
|
||||
and del_flag = '0'
|
||||
</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>
|
|
@ -23,4 +23,15 @@
|
|||
and community_id = #{communityId}
|
||||
and del_flag = '0'
|
||||
</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>
|
|
@ -3,7 +3,6 @@ package com.mcwl.resource.domain;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -11,9 +10,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -44,11 +41,6 @@ public class ModelProduct extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String modelName;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String versionDescription;
|
||||
/***
|
||||
* 用户id
|
||||
*/
|
||||
|
@ -113,7 +105,14 @@ public class ModelProduct extends BaseEntity {
|
|||
* 审核状态
|
||||
*/
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private Integer auditSatus;
|
||||
private Integer auditStatus;
|
||||
|
||||
/**
|
||||
* 审核(1公开 2自见)
|
||||
*/
|
||||
@ApiModelProperty(value = "审核")
|
||||
private Integer jurisdiction;
|
||||
|
||||
/**
|
||||
* 审核失败原因
|
||||
*/
|
||||
|
|
|
@ -35,9 +35,9 @@ public class ModelVersion extends BaseEntity {
|
|||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 模型id
|
||||
* 模型ID
|
||||
*/
|
||||
@ApiModelProperty(value = "模型id")
|
||||
@ApiModelProperty(value = "模型ID")
|
||||
private Long modelId;
|
||||
/**
|
||||
* 版本名称
|
||||
|
@ -45,9 +45,9 @@ public class ModelVersion extends BaseEntity {
|
|||
@ApiModelProperty(value = "版本名称")
|
||||
private String versionName;
|
||||
/**
|
||||
* 基础模型
|
||||
* 模型类型ID
|
||||
*/
|
||||
@ApiModelProperty(value = "基础模型")
|
||||
@ApiModelProperty(value = "模型类型ID")
|
||||
private Long modelType;
|
||||
/**
|
||||
* 文件地址
|
||||
|
@ -84,11 +84,21 @@ public class ModelVersion extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "cfg")
|
||||
private Integer cfg;
|
||||
/**
|
||||
* 是否免费
|
||||
*/
|
||||
@ApiModelProperty(value = "是否免费")
|
||||
private Integer isFree;
|
||||
/**
|
||||
* 是否公开
|
||||
*/
|
||||
@ApiModelProperty(value = "是否公开")
|
||||
private Integer isPublic;
|
||||
/**
|
||||
* 是否加密
|
||||
*/
|
||||
@ApiModelProperty(value = "是否加密")
|
||||
private String isEncrypt;
|
||||
/**
|
||||
* 是否在线使用
|
||||
*/
|
||||
|
@ -138,7 +148,7 @@ public class ModelVersion extends BaseEntity {
|
|||
* 审核状态
|
||||
*/
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private Integer auditSatus;
|
||||
private Integer auditStatus;
|
||||
/**
|
||||
* 审核失败原因
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
package com.mcwl.resource.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 举报表
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/18
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("report")
|
||||
public class Report {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 被举报的商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 举报人ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 举报类型
|
||||
*/
|
||||
private Integer reportId;
|
||||
|
||||
/**
|
||||
* 区分举报内容(1模型 2图片 3工作流)
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 举报描述
|
||||
*/
|
||||
private String text;
|
||||
|
||||
/**
|
||||
* 状态(0未处理 1已处理)
|
||||
*/
|
||||
private Integer status = 0;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除(0展示 2删除)
|
||||
*/
|
||||
private Integer delFlag = 0;
|
||||
}
|
|
@ -2,7 +2,6 @@ package com.mcwl.resource.domain;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -22,7 +21,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@ApiModel(description = "活动")
|
||||
@TableName("to_activity")
|
||||
public class ToActivity extends BaseEntity {
|
||||
public class ToActivity{
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
/**
|
||||
* 分页+条件
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/13
|
||||
* @apiNote
|
||||
|
@ -21,12 +22,14 @@ import lombok.NoArgsConstructor;
|
|||
@ApiModel(description = "分页+条件")
|
||||
public class PageVo {
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNumber;
|
||||
@ApiModelProperty(value = "每页条数")
|
||||
private Integer pageSize;
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer order;
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNumber;
|
||||
@ApiModelProperty(value = "每页条数")
|
||||
private Integer pageSize;
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer order;
|
||||
@ApiModelProperty(value = "条件过滤")
|
||||
private Integer type;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,6 @@ import java.util.List;
|
|||
public interface ModelVersionMapper extends BaseMapper<ModelVersion> {
|
||||
void addModelVersion(@Param("modelProduct") ModelProduct modelProduct, @Param("modelVersionList") List<ModelVersion> modelVersionList);
|
||||
|
||||
|
||||
void updateByName(ModelVersion modelVersion);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.Report;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/18
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface ReportMapper extends BaseMapper<Report> {
|
||||
}
|
|
@ -17,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
|
|||
public interface WorkFlowLikeMapper extends BaseMapper<WorkFlowLike> {
|
||||
WorkFlowLike getLike(@Param("userId") Long userId, @Param("modelId") Long modelId);
|
||||
|
||||
void updateStatus(WorkFlowLike workFlowLike);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -18,4 +19,6 @@ public interface ModelVersionService extends IService<ModelVersion> {
|
|||
|
||||
List<ModelVersion> selectLogininforList(ModelVersion modelVersion);
|
||||
|
||||
AjaxResult selectByModelId(Long modelId);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.Report;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
|
||||
/**
|
||||
* 举报 业务层
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/18
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
public interface ReportService {
|
||||
void addReport(Report report);
|
||||
|
||||
AjaxResult selectReport(PageVo pageVo);
|
||||
|
||||
void deleteReport(Long id);
|
||||
|
||||
void updateStatus(Long id);
|
||||
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
|
@ -14,6 +16,7 @@ import com.mcwl.common.core.page.TableDataInfo;
|
|||
import com.mcwl.common.core.redis.RedisCache;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.common.utils.baidu.BaiduCensor;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
|
@ -28,6 +31,7 @@ import com.mcwl.system.init.DictInit;
|
|||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -59,6 +63,9 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||
|
||||
/**
|
||||
* 设置模型置顶状态
|
||||
*
|
||||
|
@ -93,8 +100,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
mallProductLambdaQueryWrapper.eq(ModelProduct::getUserId,userId);
|
||||
mallProductLambdaQueryWrapper.eq(ModelProduct::getDelFlag,0);
|
||||
|
||||
|
||||
|
||||
// 开始时间和结束时间过滤
|
||||
if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) {
|
||||
// 查询开始时间和结束时间之间的商品
|
||||
|
@ -135,7 +140,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
page.addOrder(orderItem);
|
||||
|
||||
LambdaQueryWrapper<ModelProduct> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(imagePageRes.getStatus() != null, ModelProduct::getAuditSatus, imagePageRes.getStatus())
|
||||
lqw.eq(imagePageRes.getStatus() != null, ModelProduct::getAuditStatus, imagePageRes.getStatus())
|
||||
.eq(imagePageRes.getUserId() != null, ModelProduct::getUserId, imagePageRes.getUserId())
|
||||
.ge(imagePageRes.getStartTime() != null, ModelProduct::getCreateTime, imagePageRes.getStartTime())
|
||||
.le(imagePageRes.getEndTime() != null, ModelProduct::getCreateTime, imagePageRes.getEndTime());
|
||||
|
@ -185,6 +190,9 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
//批量添加版本
|
||||
modelVersionMapper.addModelVersion(requestModel.getModelProduct(),requestModel.getModelVersionList());
|
||||
|
||||
//执行审核方法
|
||||
audit(requestModel);
|
||||
|
||||
return AjaxResult.success("添加成功,等待审核");
|
||||
}
|
||||
|
||||
|
@ -192,12 +200,13 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
public void updaModel(RequestModel requestModel) {
|
||||
//修改模版的信息
|
||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||
if (ObjectUtils.isEmpty(modelProduct)){
|
||||
if (ObjectUtils.isNotEmpty(modelProduct)){
|
||||
|
||||
}
|
||||
if (StringUtils.isNotNull(modelProduct.getId())){
|
||||
modelProduct.setAuditSatus(3);
|
||||
postMapper.updateModel(requestModel.getModelProduct());
|
||||
if (StringUtils.isNotNull(modelProduct.getId())){
|
||||
modelProduct.setAuditStatus(3);
|
||||
modelProduct.setUpdateTime(new Date());
|
||||
postMapper.updateById(requestModel.getModelProduct());
|
||||
}
|
||||
}
|
||||
|
||||
//修改工作流版本的信息
|
||||
|
@ -205,7 +214,7 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
|
||||
//批量修改
|
||||
for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
||||
modelVersion.setAuditSatus(3);
|
||||
modelVersion.setAuditStatus(3);
|
||||
modelVersionMapper.updateById(modelVersion);
|
||||
}
|
||||
|
||||
|
@ -214,9 +223,11 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper,ModelProduct> impl
|
|||
getModelId()).build();
|
||||
model.setUpdateTime(new Date());
|
||||
postMapper.updateById(model);
|
||||
|
||||
}
|
||||
|
||||
//审核
|
||||
audit(requestModel);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,13 +2,17 @@ package com.mcwl.resource.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.constant.DictConstants;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.service.ModelVersionService;
|
||||
import com.mcwl.system.init.DictInit;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**模型版本 业务实现层
|
||||
|
@ -49,15 +53,30 @@ public class ModelVersionServiceImpl extends ServiceImpl< ModelVersionMapper,Mo
|
|||
return modelVersionMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectByModelId(Long modelId) {
|
||||
|
||||
//根据模型ID查询所有的版本信息
|
||||
LambdaQueryWrapper<ModelVersion> modelVersionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
modelVersionLambdaQueryWrapper.eq(ModelVersion::getModelId,modelId);
|
||||
modelVersionLambdaQueryWrapper.eq(ModelVersion::getDelFlag,0);
|
||||
|
||||
List<ModelVersion> modelVersions = modelVersionMapper.selectList(modelVersionLambdaQueryWrapper);
|
||||
for (ModelVersion modelVersion : modelVersions) {
|
||||
|
||||
ArrayList<String> arrayList = new ArrayList<>();
|
||||
|
||||
//获取
|
||||
String[] split = modelVersion.getHigh().split(",");
|
||||
|
||||
for (String s : split) {
|
||||
arrayList.add(DictInit.getDictValue(DictConstants.DICT_TYPE_MODEL_VERSION_HIGH,s));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
modelVersion.setHighList(arrayList);
|
||||
}
|
||||
return AjaxResult.success(modelVersions);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.Report;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.mapper.ReportMapper;
|
||||
import com.mcwl.resource.service.ReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 举报 业务实现层
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/18
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ReportServiceImpl implements ReportService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ReportMapper reportMapper;
|
||||
|
||||
@Override
|
||||
public void addReport(Report report) {
|
||||
|
||||
report.setCreateTime(new Date());
|
||||
report.setUserId(SecurityUtils.getUserId());
|
||||
reportMapper.insert(report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectReport(PageVo pageVo) {
|
||||
|
||||
Page<Report> page = new Page<>(pageVo.getPageNumber(), pageVo.getPageSize());
|
||||
|
||||
//构造查询条件
|
||||
LambdaQueryWrapper<Report> reportLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
reportLambdaQueryWrapper.eq(Report::getDelFlag, 0);
|
||||
if (pageVo.getType() != null) {
|
||||
reportLambdaQueryWrapper.eq(Report::getStatus, 0);
|
||||
}
|
||||
|
||||
return AjaxResult.success(reportMapper.selectPage(page, reportLambdaQueryWrapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteReport(Long id) {
|
||||
|
||||
Report report = new Report().builder().id(id)
|
||||
.delFlag(2).build();
|
||||
|
||||
reportMapper.updateById(report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(Long id) {
|
||||
|
||||
Report report = new Report().builder().id(id)
|
||||
.status(1)
|
||||
.build();
|
||||
|
||||
reportMapper.updateById(report);
|
||||
}
|
||||
}
|
|
@ -40,10 +40,12 @@ public class WorkFlowCommentServiceImpl extends ServiceImpl<WorkFlowCommentMappe
|
|||
@Override
|
||||
public void comment(WorkFlowComment workFlowComment) {
|
||||
Long parentId = workFlowComment.getParentId();
|
||||
WorkFlowComment mic = workFlowCommentMapper.selectById(parentId);
|
||||
if (parentId != null){
|
||||
WorkFlowComment mic = workFlowCommentMapper.selectById(parentId);
|
||||
|
||||
if (Objects.nonNull(parentId) && Objects.isNull(mic)) {
|
||||
return;
|
||||
if (Objects.nonNull(parentId) && Objects.isNull(mic)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
workFlowComment.setUserId(SecurityUtils.getUserId());
|
||||
workFlowComment.setCreateBy(SecurityUtils.getUsername());
|
||||
|
|
|
@ -49,7 +49,7 @@ public class WorkFlowLikeServiceImpl extends ServiceImpl<WorkFlowLikeMapper, Wor
|
|||
workFlow.setLikeCount(workFlow.getLikeCount() + 1);
|
||||
}
|
||||
// 更新点赞记录
|
||||
baseMapper.updateById(workFlowLike);
|
||||
baseMapper.updateStatus(workFlowLike);
|
||||
// 更新图片点赞数
|
||||
workFlowMapper.updateById(workFlow);
|
||||
return;
|
||||
|
|
|
@ -137,6 +137,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
}
|
||||
|
||||
//修改为合格
|
||||
workFlow.setAuditText("");
|
||||
workFlow.setAuditStatus(workFlow.getJurisdiction());
|
||||
flowMapper.updateById(workFlow);
|
||||
}
|
||||
|
@ -170,7 +171,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
}
|
||||
// 使用逗号拼接所有的失败原因
|
||||
String concatenatedReasons = String.join(", ", failureReasons);
|
||||
workFlow.setAuditText(concatenatedReasons);
|
||||
workFlowVersion.setAuditText(concatenatedReasons);
|
||||
workFlowVersion.setAuditStatus(4);
|
||||
//校验id是否存在 区别修改审核或者新增审核
|
||||
if (workFlowVersion.getId() != null){
|
||||
|
@ -202,7 +203,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
}
|
||||
// 使用逗号拼接所有的失败原因
|
||||
String concatenatedReasons = String.join(", ", failureReasons);
|
||||
workFlow.setAuditText(concatenatedReasons);
|
||||
workFlowVersion.setAuditText(concatenatedReasons);
|
||||
workFlowVersion.setAuditStatus(4);
|
||||
//校验id是否存在 区别修改审核或者新增审核
|
||||
if (workFlowVersion.getId() != null){
|
||||
|
@ -217,6 +218,7 @@ public class WorkFlowServiceImpl extends ServiceImpl<WorkFlowMapper, WorkFlow> i
|
|||
}
|
||||
|
||||
//修改版本成功审核状态
|
||||
workFlow.setAuditText("");
|
||||
workFlowVersion.setAuditStatus(1);
|
||||
workFlowVersionMapper.updateByName(workFlowVersion);
|
||||
log.info("全部通过审核");
|
||||
|
|
|
@ -7,24 +7,30 @@
|
|||
|
||||
<insert id="addModelVersion">
|
||||
INSERT INTO model_version (
|
||||
version_name, model_type, file_path, trigger_words, sampling, high, vae, cfg,
|
||||
model_id,version_name, model_type, file_path, trigger_words, sampling, high, vae, cfg,
|
||||
is_free, is_public, is_encrypt, is_online_use, allow_download_image,
|
||||
allow_software_use, allow_fusion, allow_commercial_use, allow_usage,
|
||||
is_exclusive_model, sample_image_paths, hide_image_gen_info, audit_status,
|
||||
audit_text, del_flag
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<foreach collection="modelVersionList" item="item" separator=",">
|
||||
(
|
||||
#{item.versionName}, #{item.modelType}, #{item.filePath}, #{item.triggerWords},
|
||||
#{modelProduct.id},#{item.versionName}, #{item.modelType}, #{item.filePath}, #{item.triggerWords},
|
||||
#{item.sampling}, #{item.high}, #{item.vae}, #{item.cfg},
|
||||
#{item.isFree}, #{item.isPublic}, #{item.isEncrypt}, #{item.isOnlineUse},
|
||||
#{item.allowDownloadImage}, #{item.allowSoftwareUse}, #{item.allowFusion},
|
||||
#{item.allowCommercialUse}, #{item.allowUsage}, #{item.isExclusiveModel},
|
||||
#{item.sampleImagePaths}, #{item.hideImageGenInfo}, #{item.auditStatus},
|
||||
#{item.auditText}, #{item.delFlag}
|
||||
#{item.sampleImagePaths}, #{item.hideImageGenInfo}, 3,
|
||||
#{item.auditText},'0'
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateByName">
|
||||
update model_version set audit_status = #{auditStatus},
|
||||
audit_text = #{auditText}
|
||||
where version_name = #{versionName} and model_id = #{modelId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -4,18 +4,31 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.WorkFlowLikeMapper">
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE work_flow_like
|
||||
SET user_id = #{userId},
|
||||
work_flow_id = #{workFlowId},
|
||||
create_by = #{createBy},
|
||||
create_time = #{createTime},
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime},
|
||||
del_flag = #{delFlag}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getLike" resultType="com.mcwl.resource.domain.WorkFlowLike">
|
||||
select id,
|
||||
user_id,
|
||||
model_comment_id,
|
||||
work_flow_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
remark
|
||||
from work_flow_like
|
||||
where user_id = #{userId} and model_id = #{modelId}
|
||||
from work_flow_like
|
||||
where user_id = #{userId}
|
||||
and work_flow_id = #{modelId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue