【增加】ai image 增加release 列表(画廊、广场使用)

This commit is contained in:
cherishsince 2024-07-15 15:32:04 +08:00
parent 73502d565f
commit 6b69dd74d4
5 changed files with 42 additions and 10 deletions

View File

@ -6,10 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDrawReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImagePageReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageRespVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageUpdateReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.*;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyActionReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyImagineReqVO;
import cn.iocoder.yudao.module.ai.dal.dataobject.image.AiImageDO;
@ -131,4 +128,10 @@ public class AiImageController {
return success(true);
}
@GetMapping("/release-list")
@Operation(summary = "发布列表")
public CommonResult<PageResult<AiImageRespVO>> releaseList(AiImageReleaseListReqVO releaseListReqVO) {
PageResult<AiImageDO> pageResult = imageService.releaseList(releaseListReqVO);
return success(BeanUtils.toBean(pageResult, AiImageRespVO.class));
}
}

View File

@ -0,0 +1,14 @@
package cn.iocoder.yudao.module.ai.controller.admin.image.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "Ai Image 发布列表 req")
@Data
public class AiImageReleaseListReqVO extends PageParam {
@Schema(description = "提示词")
private String prompt;
}

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImagePageReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageReleaseListReqVO;
import cn.iocoder.yudao.module.ai.dal.dataobject.image.AiImageDO;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +44,10 @@ public interface AiImageMapper extends BaseMapperX<AiImageDO> {
AiImageDO::getPlatform, platform);
}
default PageResult<AiImageDO> selectPageOfReleaseList(AiImageReleaseListReqVO releaseListReqVO) {
return selectPage(releaseListReqVO, new LambdaQueryWrapperX<AiImageDO>()
.eqIfPresent(AiImageDO::getPublicStatus, Boolean.TRUE)
.eqIfPresent(AiImageDO::getPrompt, releaseListReqVO.getPrompt())
.orderByDesc(AiImageDO::getId));
}
}

View File

@ -3,9 +3,7 @@ package cn.iocoder.yudao.module.ai.service.image;
import cn.iocoder.yudao.framework.ai.core.model.midjourney.api.MidjourneyApi;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDrawReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImagePageReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageUpdateReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.*;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyActionReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyImagineReqVO;
import cn.iocoder.yudao.module.ai.dal.dataobject.image.AiImageDO;
@ -118,4 +116,11 @@ public interface AiImageService {
*/
Long midjourneyAction(Long userId, AiMidjourneyActionReqVO reqVO);
/**
* 发布列表
* @param releaseListReqVO
* @return
*/
PageResult<AiImageDO> releaseList(AiImageReleaseListReqVO releaseListReqVO);
}

View File

@ -13,9 +13,7 @@ import cn.iocoder.yudao.framework.ai.core.model.midjourney.api.MidjourneyApi;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDrawReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImagePageReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageUpdateReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.*;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyActionReqVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyImagineReqVO;
import cn.iocoder.yudao.module.ai.dal.dataobject.image.AiImageDO;
@ -338,6 +336,11 @@ public class AiImageServiceImpl implements AiImageService {
return newImage.getId();
}
@Override
public PageResult<AiImageDO> releaseList(AiImageReleaseListReqVO releaseListReqVO) {
return imageMapper.selectPageOfReleaseList(releaseListReqVO);
}
/**
* 获得自身的代理对象解决 AOP 生效问题
*