Merge remote-tracking branch 'origin/feature/resource' into preview
commit
75cdc9ea16
|
@ -4,11 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.service.MallProductService;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
@ -26,16 +27,13 @@ import java.util.List;
|
|||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/MallProduct")
|
||||
@RequestMapping("/model")
|
||||
public class MallProductController extends BaseController {
|
||||
|
||||
|
||||
private final MallProductService mallProductRuleInfoService;
|
||||
|
||||
public MallProductController(MallProductService mallProductService) {
|
||||
this.mallProductRuleInfoService = mallProductService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ModelService modelService;
|
||||
|
||||
|
||||
/***
|
||||
|
@ -90,50 +88,46 @@ public class MallProductController extends BaseController {
|
|||
public TableDataInfo list(@RequestBody ModelProduct mallProduct)
|
||||
{
|
||||
startPage();
|
||||
List<ModelProduct> list = mallProductRuleInfoService.selectMallProductList(mallProduct);
|
||||
List<ModelProduct> list = modelService.selectMallProductList(mallProduct);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long Id)
|
||||
|
||||
|
||||
@PostMapping("finbyid")
|
||||
public AjaxResult finbyid(@RequestBody ModelProduct modelVersion)
|
||||
{
|
||||
return success(mallProductRuleInfoService.getById(Id));
|
||||
ModelProduct modelVersion1 = modelService.getById(modelVersion.getId());
|
||||
return AjaxResult.success(modelVersion1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody ModelProduct mallProduct)
|
||||
@PostMapping("insert")
|
||||
public AjaxResult insert(@RequestBody ModelProduct modelVersion)
|
||||
{
|
||||
|
||||
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
modelVersion.setUserId(userId);
|
||||
modelVersion.setCreateBy(getUsername());
|
||||
modelService.save(modelVersion);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PutMapping("/upda")
|
||||
public AjaxResult edit(@RequestBody ModelProduct mallProduct)
|
||||
@PostMapping("update")
|
||||
public AjaxResult update(@RequestBody ModelProduct modelVersion)
|
||||
{
|
||||
mallProduct.setUpdateBy(getUsername());
|
||||
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
modelVersion.setUserId(userId);
|
||||
modelVersion.setUpdateBy(getUsername());
|
||||
modelService.updateById(modelVersion);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult remove(@RequestBody IdsParam ids)
|
||||
@PostMapping("delete")
|
||||
public AjaxResult delete(@RequestBody ModelProduct modelVersion)
|
||||
{
|
||||
mallProductRuleInfoService.deleteMallProductByIds(ids);
|
||||
return success();
|
||||
modelService.removeById(modelVersion.getId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,7 +137,7 @@ public class MallProductController extends BaseController {
|
|||
@PostMapping("/selectByUserId")
|
||||
public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){
|
||||
|
||||
Page<ModelProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
|
||||
Page<ModelProduct> mallProductList = modelService.selectByUserId(mallProductVo);
|
||||
return AjaxResult.success(mallProductList);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
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.ModelVersion;
|
||||
import com.mcwl.resource.service.ModelVersionService;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** 模型版本
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
* @Filename:ModelVersionController
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 16:47
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("ModelVersion")
|
||||
public class ModelVersionController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ModelVersionService modelVersionService;
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* 图片
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/file")
|
||||
public AjaxResult Malifile(@RequestParam MultipartFile file){
|
||||
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrlFile")
|
||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* 下载zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrl")
|
||||
public AjaxResult zipUrl(@RequestParam MultipartFile file){
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("list")
|
||||
public TableDataInfo list(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
startPage();
|
||||
List<ModelVersion> list = modelVersionService.selectLogininforList(modelVersion);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("finbyid")
|
||||
public AjaxResult finbyid(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
ModelVersion modelVersion1 = modelVersionService.getById(modelVersion.getId());
|
||||
return AjaxResult.success(modelVersion1);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("insert")
|
||||
public AjaxResult insert(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
|
||||
modelVersionService.save(modelVersion);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("update")
|
||||
public AjaxResult update(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
modelVersionService.updateById(modelVersion);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
public AjaxResult delete(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
modelVersionService.removeById(modelVersion.getId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
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.ToActivity;
|
||||
import com.mcwl.resource.service.ToActivityService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
* @Filename:ToActivityController
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 17:59
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("ToActivity")
|
||||
public class ToActivityController extends BaseController {
|
||||
@Autowired
|
||||
private ToActivityService toActivityService;
|
||||
|
||||
/**
|
||||
* 查询活动列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
startPage();
|
||||
List<ToActivity> list = toActivityService.selectToActivityList(toActivity);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("finById")
|
||||
public AjaxResult finById(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
return AjaxResult.success(toActivityService.getById(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("add")
|
||||
public AjaxResult add(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
return AjaxResult.success(toActivityService.save(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("update")
|
||||
public AjaxResult update(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
return AjaxResult.success(toActivityService.updateById(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("delete")
|
||||
public AjaxResult delete(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
return AjaxResult.success(toActivityService.removeById(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("deleteByIds")
|
||||
public AjaxResult deleteByIds(@RequestBody List<ToActivity> toActivity)
|
||||
{
|
||||
return AjaxResult.success(toActivityService.removeByIds(toActivity));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.comment.mapper.CommentMapper">
|
||||
<insert id="insert">
|
||||
insert into mall_product_comment(id, parent_id, product_id, user_id, content, rating, create_by, create_time,
|
||||
update_by, update_time, del_flag, remark)
|
||||
values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime},
|
||||
#{updateBy}, #{updateTime}, #{remark}, #{delFlag})
|
||||
</insert>
|
||||
<update id="upda"></update>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete
|
||||
from model
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="findById" resultType="com.mcwl.resource.domain.ModelProduct">
|
||||
select
|
||||
id,
|
||||
parent_id,
|
||||
product_id,
|
||||
user_id,
|
||||
content,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
del_flag
|
||||
from model
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity">
|
||||
select
|
||||
id,
|
||||
parent_id,
|
||||
product_id,
|
||||
user_id,
|
||||
content,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
del_flag
|
||||
from mall_product_comment
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,52 +0,0 @@
|
|||
package com.mcwl.common.utils.bean;
|
||||
|
||||
import com.mcwl.common.utils.BetweenTimeUtil;
|
||||
|
||||
|
||||
import com.mcwl.common.domain.RequestConditionEntity;
|
||||
import com.mcwl.common.utils.ResponsePageEntity;
|
||||
import com.mcwl.common.web.BaseMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公共service
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class BaseService<K, V> {
|
||||
/**
|
||||
* 获取BaseMapper
|
||||
*
|
||||
* @return BaseMapper
|
||||
*/
|
||||
protected abstract BaseMapper getBaseMapper();
|
||||
/**
|
||||
* 用户自定义导出逻辑
|
||||
*
|
||||
* @param v 查询条件
|
||||
* @return 是否自定义
|
||||
*/
|
||||
public boolean customizeExport(V v) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的分页接口
|
||||
*
|
||||
* @return 数据
|
||||
* @param s 分页请求参数
|
||||
* @param <T> 分页返回实体
|
||||
*/
|
||||
public <S extends RequestConditionEntity, T> ResponsePageEntity<T> searchByPage(S s) {
|
||||
BetweenTimeUtil.parseTime(s);
|
||||
int count = getBaseMapper().searchCount(s);
|
||||
if (count == 0) {
|
||||
return ResponsePageEntity.buildEmpty(s);
|
||||
}
|
||||
List<T> dataList = getBaseMapper().searchByCondition(s);
|
||||
return ResponsePageEntity.build(s, count, dataList);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,31 +1,31 @@
|
|||
package com.mcwl.common.web;
|
||||
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公共mapper
|
||||
|
||||
*/
|
||||
public interface BaseMapper<K, V> {
|
||||
|
||||
/**
|
||||
* 根据条件查询数据的数量
|
||||
*
|
||||
* @param v 实体类
|
||||
* @return 数量
|
||||
*/
|
||||
int searchCount(V v);
|
||||
|
||||
/**
|
||||
* 根据条件查询数据
|
||||
*
|
||||
* @param v 实体类
|
||||
* @return List<K> 实体类的集合
|
||||
* @throws DataAccessException 数据访问异常
|
||||
*/
|
||||
List<K> searchByCondition(V v) throws DataAccessException;
|
||||
|
||||
}
|
||||
//package com.mcwl.common.web;
|
||||
//
|
||||
//
|
||||
//import org.springframework.dao.DataAccessException;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * 公共mapper
|
||||
//
|
||||
// */
|
||||
//public interface BaseMapper<K, V> {
|
||||
//
|
||||
// /**
|
||||
// * 根据条件查询数据的数量
|
||||
// *
|
||||
// * @param v 实体类
|
||||
// * @return 数量
|
||||
// */
|
||||
// int searchCount(V v);
|
||||
//
|
||||
// /**
|
||||
// * 根据条件查询数据
|
||||
// *
|
||||
// * @param v 实体类
|
||||
// * @return List<K> 实体类的集合
|
||||
// * @throws DataAccessException 数据访问异常
|
||||
// */
|
||||
// List<K> searchByCondition(V v) throws DataAccessException;
|
||||
//
|
||||
//}
|
||||
|
|
|
@ -7,8 +7,6 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 模型表
|
||||
* @Author:ChenYan
|
||||
|
@ -29,10 +27,18 @@ public class ModelProduct extends BaseEntity {
|
|||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 版本ID
|
||||
*/
|
||||
private Long versionId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String modelName;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String versionDescription;
|
||||
/***
|
||||
* 用户id
|
||||
*/
|
||||
|
@ -56,7 +62,7 @@ public class ModelProduct extends BaseEntity {
|
|||
/**
|
||||
* 参与活动
|
||||
*/
|
||||
private String activityParticipation;
|
||||
private String activityId;
|
||||
/**
|
||||
* 是否原创
|
||||
*/
|
||||
|
@ -68,11 +74,23 @@ public class ModelProduct extends BaseEntity {
|
|||
/**
|
||||
* 生图次数
|
||||
*/
|
||||
private Integer real;
|
||||
private Integer reals;
|
||||
/**
|
||||
* 下载次数
|
||||
*/
|
||||
private Integer number;
|
||||
private Integer numbers;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer auditSatus;
|
||||
/**
|
||||
* 审核失败原因
|
||||
*/
|
||||
private String auditText;
|
||||
/**
|
||||
* 是否推荐模型
|
||||
*/
|
||||
private Integer isRecommend;
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
|
|
|
@ -2,11 +2,9 @@ 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 lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.locationtech.jts.noding.SegmentString;
|
||||
|
||||
/**
|
||||
* 模型版本
|
||||
|
@ -21,7 +19,7 @@ import org.locationtech.jts.noding.SegmentString;
|
|||
@NoArgsConstructor
|
||||
@Data
|
||||
@TableName("model_version")
|
||||
public class ModelVersion extends BaseEntity {
|
||||
public class ModelVersion {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
|
@ -35,7 +33,7 @@ public class ModelVersion extends BaseEntity {
|
|||
/**
|
||||
* 模型类型ID
|
||||
*/
|
||||
private Long modelTypeId;
|
||||
private Long modelType;
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
|
@ -48,6 +46,22 @@ public class ModelVersion extends BaseEntity {
|
|||
* 触发词
|
||||
*/
|
||||
private String triggerWords;
|
||||
/**
|
||||
* 采样方法
|
||||
*/
|
||||
private String sampling;
|
||||
/**
|
||||
* 高清修复
|
||||
*/
|
||||
private String high;
|
||||
/**
|
||||
* vae
|
||||
*/
|
||||
private Integer vae;
|
||||
/**
|
||||
* cfg
|
||||
*/
|
||||
private Integer cfg;
|
||||
/**
|
||||
* 是否公开
|
||||
*/
|
||||
|
@ -89,9 +103,13 @@ public class ModelVersion extends BaseEntity {
|
|||
*/
|
||||
private Integer hideImageGenInfo;
|
||||
/**
|
||||
* 状态
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
private Integer auditSatus;
|
||||
/**
|
||||
* 审核失败原因
|
||||
*/
|
||||
private String auditText;
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.resource.mapper
|
||||
* @Filename:ModelVersionMapper
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 16:55
|
||||
*/
|
||||
@Mapper
|
||||
public interface ModelVersionMapper extends BaseMapper<ModelVersion> {
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ToActivity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.resource.mapper
|
||||
* @Filename:ToActivityMapper
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 18:01
|
||||
*/
|
||||
@Mapper
|
||||
public interface ToActivityMapper extends BaseMapper<ToActivity> {
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -16,13 +17,10 @@ import java.util.List;
|
|||
* @Description TODO
|
||||
* @Date:2024/12/30 18:20
|
||||
*/
|
||||
public interface MallProductService extends IService<ModelProduct> {
|
||||
public interface ModelService extends IService<ModelProduct> {
|
||||
|
||||
List<ModelProduct> selectMallProductList(ModelProduct sysJob);
|
||||
|
||||
|
||||
|
||||
|
||||
int insertMallProduct(ModelProduct mallProduct);
|
||||
|
||||
int updateMallProduct(ModelProduct mallProduct);
|
||||
|
@ -34,5 +32,4 @@ public interface MallProductService extends IService<ModelProduct> {
|
|||
|
||||
Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.resource.service
|
||||
* @Filename:ModelVersionService
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 16:52
|
||||
*/
|
||||
|
||||
public interface ModelVersionService extends IService<ModelVersion> {
|
||||
|
||||
List<ModelVersion> selectLogininforList(ModelVersion modelVersion);
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ToActivity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.resource.service
|
||||
* @Filename:ToActivityService
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 18:00
|
||||
*/
|
||||
public interface ToActivityService extends IService<ToActivity> {
|
||||
List<ToActivity> selectToActivityList(ToActivity toActivity);
|
||||
|
||||
}
|
|
@ -7,9 +7,8 @@ import com.mcwl.resource.domain.MallProductLike;
|
|||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.mapper.MallProductLikeMapper;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
import com.mcwl.resource.service.MallProductLikeService;
|
||||
import com.mcwl.resource.service.MallProductService;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -29,7 +28,7 @@ public class MallProductLikeServiceImpl implements MallProductLikeService {
|
|||
private MallProductLikeMapper mallProductLikeMapper;
|
||||
|
||||
@Autowired
|
||||
private MallProductService mallProductService;
|
||||
private ModelService mallProductService;
|
||||
|
||||
@Override
|
||||
public Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo) {
|
||||
|
@ -83,4 +82,6 @@ public class MallProductLikeServiceImpl implements MallProductLikeService {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,9 +8,10 @@ import com.mcwl.common.core.redis.RedisCache;
|
|||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
import com.mcwl.resource.service.MallProductService;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.mapper.MallProductMapper;
|
||||
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -26,7 +27,7 @@ import java.util.List;
|
|||
* @Date:2024/12/30 18:22
|
||||
*/
|
||||
@Service
|
||||
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements MallProductService {
|
||||
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements ModelService {
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
|
@ -90,24 +91,8 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelP
|
|||
|
||||
@Override
|
||||
public Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list) {
|
||||
|
||||
// 创建分页对象
|
||||
Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
mallProductLambdaQueryWrapper.in(ModelProduct::getModelTypeId,list);
|
||||
|
||||
if (mallProductVo.getOrder() == 1){
|
||||
mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getModelTypeId);
|
||||
}else {
|
||||
mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getNumber);
|
||||
}
|
||||
|
||||
return postMapper.selectPage(mallProductPage,mallProductLambdaQueryWrapper);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
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.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.service.ModelVersionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.resource.service.impl
|
||||
* @Filename:ModelVersionServiceImpl
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 16:53
|
||||
*/
|
||||
@Service
|
||||
public class ModelVersionServiceImpl extends ServiceImpl< ModelVersionMapper,ModelVersion> implements ModelVersionService {
|
||||
|
||||
@Autowired
|
||||
private ModelVersionService modelVersionService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ModelVersionMapper modelVersionMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<ModelVersion> selectLogininforList(ModelVersion modelVersion) {
|
||||
|
||||
// 创建一个 LambdaQueryWrapper 实例
|
||||
LambdaQueryWrapper<ModelVersion> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 使用非空检查来添加查询条件
|
||||
if (StringUtils.isNotNull(modelVersion.getIsExclusiveModel())) {
|
||||
queryWrapper.eq(ModelVersion::getIsExclusiveModel, modelVersion.getIsExclusiveModel());
|
||||
}
|
||||
|
||||
|
||||
if (StringUtils.isNotNull(modelVersion.getVersionName())) {
|
||||
queryWrapper.eq(ModelVersion::getVersionName, modelVersion.getVersionName());
|
||||
}
|
||||
|
||||
return modelVersionMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
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.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.ToActivity;
|
||||
import com.mcwl.resource.mapper.ToActivityMapper;
|
||||
import com.mcwl.resource.service.ToActivityService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.resource.service
|
||||
* @Filename:ToActivityServiceImpl
|
||||
* @Description TODO
|
||||
* @Date:2025/1/9 18:01
|
||||
*/
|
||||
@Service
|
||||
public class ToActivityServiceImpl extends ServiceImpl<ToActivityMapper, ToActivity> implements ToActivityService {
|
||||
|
||||
@Autowired
|
||||
private ToActivityService toActivityService;
|
||||
|
||||
@Autowired
|
||||
private ToActivityMapper toActivityMapper;
|
||||
|
||||
@Override
|
||||
public List<ToActivity> selectToActivityList(ToActivity toActivity) {
|
||||
LambdaQueryWrapper<ToActivity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ToActivity::getActivityName, toActivity.getActivityName());
|
||||
return toActivityMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -9,4 +9,5 @@
|
|||
<select id="sumNumber" resultType="java.lang.Long">
|
||||
SELECT sum(number)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue