Merge remote-tracking branch 'origin/dev/dev' into prod/release_1.0
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.aida.lanecarford.controller;
|
package com.aida.lanecarford.controller;
|
||||||
|
|
||||||
import com.aida.lanecarford.common.ApiResponse;
|
import com.aida.lanecarford.common.ApiResponse;
|
||||||
|
import com.aida.lanecarford.entity.Suggestion;
|
||||||
import com.aida.lanecarford.entity.TryOnEffect;
|
import com.aida.lanecarford.entity.TryOnEffect;
|
||||||
import com.aida.lanecarford.service.TryOnEffectService;
|
import com.aida.lanecarford.service.TryOnEffectService;
|
||||||
import com.aida.lanecarford.vo.TryOnResultVo;
|
import com.aida.lanecarford.vo.TryOnResultVo;
|
||||||
@@ -77,4 +78,14 @@ public class TryOnEffectController {
|
|||||||
tryOnEffectService.cancelFavoriteTryOnEffect(tryOnId);
|
tryOnEffectService.cancelFavoriteTryOnEffect(tryOnId);
|
||||||
return ApiResponse.success();
|
return ApiResponse.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为生成结果添加意见和建议
|
||||||
|
*/
|
||||||
|
@Operation(summary = "为生成结果添加意见和建议", description = "为指定试穿效果添加意见和建议")
|
||||||
|
@PostMapping("/add-comment")
|
||||||
|
public ApiResponse<Void> addComment(@RequestBody Suggestion suggestion) {
|
||||||
|
tryOnEffectService.addComment(suggestion);
|
||||||
|
return ApiResponse.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
53
src/main/java/com/aida/lanecarford/entity/Suggestion.java
Normal file
53
src/main/java/com/aida/lanecarford/entity/Suggestion.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package com.aida.lanecarford.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见建议实体类
|
||||||
|
*
|
||||||
|
* @author AI Assistant
|
||||||
|
* @since 2024-01-01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("suggestions")
|
||||||
|
public class Suggestion extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顾客ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "顾客ID", example = "1", required = true)
|
||||||
|
@TableField("customer_id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进店记录ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "进店记录ID", example = "1", required = true)
|
||||||
|
@TableField("visit_record_id")
|
||||||
|
private Long visitRecordId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试穿效果ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "试穿效果ID", example = "1", required = true)
|
||||||
|
@TableField("try_on_effects_id")
|
||||||
|
private Long tryOnEffectsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见建议内容
|
||||||
|
*/
|
||||||
|
@Schema(description = "意见建议内容", example = "这件衣服颜色不太合适,建议换成浅色系", required = true)
|
||||||
|
@TableField("suggestion")
|
||||||
|
private String suggestion;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.aida.lanecarford.mapper;
|
||||||
|
|
||||||
|
import com.aida.lanecarford.entity.Suggestion;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 意见建议Mapper接口
|
||||||
|
*
|
||||||
|
* @author AI Assistant
|
||||||
|
* @since 2024-01-01
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SuggestionMapper extends BaseMapper<Suggestion> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.aida.lanecarford.service;
|
package com.aida.lanecarford.service;
|
||||||
|
|
||||||
|
import com.aida.lanecarford.entity.Suggestion;
|
||||||
import com.aida.lanecarford.entity.TryOnEffect;
|
import com.aida.lanecarford.entity.TryOnEffect;
|
||||||
import com.aida.lanecarford.vo.TryOnResultVo;
|
import com.aida.lanecarford.vo.TryOnResultVo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
@@ -32,4 +33,11 @@ public interface TryOnEffectService extends IService<TryOnEffect> {
|
|||||||
void cancelFavoriteTryOnEffect(Long tryOnId);
|
void cancelFavoriteTryOnEffect(Long tryOnId);
|
||||||
|
|
||||||
List<TryOnResultVo> getTryOnEffectsByStyleId(Long styleId);
|
List<TryOnResultVo> getTryOnEffectsByStyleId(Long styleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加意见建议
|
||||||
|
* @param suggestion 意见建议实体
|
||||||
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
boolean addComment(Suggestion suggestion);
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,10 @@ import com.aida.lanecarford.entity.*;
|
|||||||
import com.aida.lanecarford.exception.BusinessException;
|
import com.aida.lanecarford.exception.BusinessException;
|
||||||
import com.aida.lanecarford.mapper.CustomerMapper;
|
import com.aida.lanecarford.mapper.CustomerMapper;
|
||||||
import com.aida.lanecarford.mapper.OutfitRequestMapper;
|
import com.aida.lanecarford.mapper.OutfitRequestMapper;
|
||||||
|
import com.aida.lanecarford.mapper.SuggestionMapper;
|
||||||
import com.aida.lanecarford.mapper.TryOnEffectMapper;
|
import com.aida.lanecarford.mapper.TryOnEffectMapper;
|
||||||
import com.aida.lanecarford.service.*;
|
import com.aida.lanecarford.service.*;
|
||||||
|
import com.aida.lanecarford.entity.Suggestion;
|
||||||
import com.aida.lanecarford.util.MinioUtil;
|
import com.aida.lanecarford.util.MinioUtil;
|
||||||
import com.aida.lanecarford.util.StringListConverter;
|
import com.aida.lanecarford.util.StringListConverter;
|
||||||
import com.aida.lanecarford.vo.TryOnResultVo;
|
import com.aida.lanecarford.vo.TryOnResultVo;
|
||||||
@@ -53,6 +55,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
|||||||
private final MinioUtil minioUtil;
|
private final MinioUtil minioUtil;
|
||||||
private final MinioConfig minioConfig;
|
private final MinioConfig minioConfig;
|
||||||
private final FaceSwapConfig faceSwapConfig;
|
private final FaceSwapConfig faceSwapConfig;
|
||||||
|
private final SuggestionMapper suggestionMapper;
|
||||||
private final OutfitRequestMapper outfitRequestMapper;
|
private final OutfitRequestMapper outfitRequestMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -179,6 +182,30 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
|||||||
return tryOnResultVos;
|
return tryOnResultVos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加意见建议
|
||||||
|
* @param suggestion 意见建议实体
|
||||||
|
* @return 是否添加成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean addComment(Suggestion suggestion) {
|
||||||
|
try {
|
||||||
|
// 保存意见建议
|
||||||
|
int result = suggestionMapper.insert(suggestion);
|
||||||
|
|
||||||
|
if (result > 0) {
|
||||||
|
log.info("意见建议添加成功 - id: {}", suggestion.getId());
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
log.error("意见建议添加失败");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("添加意见建议时发生异常: {}", e.getMessage(), e);
|
||||||
|
throw new BusinessException("Add suggestion failed", "添加意见建议失败", ResultEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//目前用于customize your look页面点击finish后的显示
|
//目前用于customize your look页面点击finish后的显示
|
||||||
@Override
|
@Override
|
||||||
public List<TryOnResultVo> getTryOnEffectsByStyleId(Long styleId) {
|
public List<TryOnResultVo> getTryOnEffectsByStyleId(Long styleId) {
|
||||||
|
|||||||
@@ -166,4 +166,19 @@ CREATE TABLE `outfit_request` (
|
|||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='穿搭请求表';
|
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='穿搭请求表';
|
||||||
|
|
||||||
|
-- 9. 意见建议表
|
||||||
|
CREATE TABLE `suggestions` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '意见建议ID',
|
||||||
|
`customer_id` bigint NOT NULL COMMENT '顾客ID',
|
||||||
|
`visit_record_id` bigint NOT NULL COMMENT '进店记录ID',
|
||||||
|
`try_on_effects_id` bigint NOT NULL COMMENT '试穿效果ID',
|
||||||
|
`suggestion` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '意见建议内容',
|
||||||
|
`created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`updated_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
`deleted` tinyint DEFAULT '0' COMMENT '逻辑删除标志(0-未删除,1-已删除)',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='意见建议表';
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user