TASK:aida;
This commit is contained in:
@@ -217,7 +217,10 @@ public class MyTaskScheduler {
|
|||||||
String directoryPath = "C:\\Users\\10233\\Downloads\\blouse done\\blouse done\\废土风";
|
String directoryPath = "C:\\Users\\10233\\Downloads\\blouse done\\blouse done\\废土风";
|
||||||
List<String> fileNames = getFileNames(directoryPath);
|
List<String> fileNames = getFileNames(directoryPath);
|
||||||
for (String fileName : fileNames) {
|
for (String fileName : fileNames) {
|
||||||
|
String tableName = "female_top";
|
||||||
|
String style = "feitufeng";
|
||||||
|
Long idByFileName = attributeRetrievalMapper.getIdByFileName(fileName, tableName);
|
||||||
|
attributeRetrievalMapper.updateStyleById(idByFileName, style, tableName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,4 +105,10 @@ public class PortfolioController {
|
|||||||
public Response<Long> viewsGet(@RequestParam("id") Long id) {
|
public Response<Long> viewsGet(@RequestParam("id") Long id) {
|
||||||
return Response.success(portfolioService.viewsGet(id));
|
return Response.success(portfolioService.viewsGet(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除评论")
|
||||||
|
@PostMapping("/commentDelete")
|
||||||
|
public Response<Boolean> commentDelete(@Valid @RequestBody CommentDTO commentDTO) {
|
||||||
|
return Response.success(portfolioService.commentDelete(commentDTO));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ public class WorkspaceController {
|
|||||||
@GetMapping("/getMannequins")
|
@GetMapping("/getMannequins")
|
||||||
@ApiOperationSupport(order = 6)
|
@ApiOperationSupport(order = 6)
|
||||||
@ApiOperation(value = "获取模特")
|
@ApiOperation(value = "获取模特")
|
||||||
public Response<List<ModelsVO>> getMannequins(@RequestParam("sex") String sex) {
|
public Response<List<ModelsVO>> getMannequins(@RequestParam("sex") String sex, @RequestParam("style") String style) {
|
||||||
List<ModelsVO> modelsVO = workspaceService.getMannequins(sex);
|
List<ModelsVO> modelsVO = workspaceService.getMannequins(sex, style);
|
||||||
return Response.success(modelsVO);
|
return Response.success(modelsVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,4 +22,8 @@ public interface AttributeRetrievalMapper {
|
|||||||
AttributeRetrieval getSystemRandom(String tableName);
|
AttributeRetrieval getSystemRandom(String tableName);
|
||||||
|
|
||||||
List<AttributeRetrieval> getSystemSketchPoolBySameCategory(AttributeRetrieval attributeRetrievalAttrDict, String tableName);
|
List<AttributeRetrieval> getSystemSketchPoolBySameCategory(AttributeRetrieval attributeRetrievalAttrDict, String tableName);
|
||||||
|
|
||||||
|
Long getIdByFileName(String fileName, String tableName);
|
||||||
|
|
||||||
|
void updateStyleById(Long idByFileName, String style, String tableName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class AttributeRetrieval {
|
|||||||
private String openingType;
|
private String openingType;
|
||||||
private String subtype;
|
private String subtype;
|
||||||
|
|
||||||
private String sleeve;
|
private String style;
|
||||||
private String sleeve1;
|
|
||||||
private String sleeve2;
|
private Integer deprecated;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class StyleKeywordMapper {
|
|||||||
wabiSabiKeywords.put("Printboard", Arrays.asList("natural materials such as wood", "stone", "hemp rope", "neutral tones and light colors"));
|
wabiSabiKeywords.put("Printboard", Arrays.asList("natural materials such as wood", "stone", "hemp rope", "neutral tones and light colors"));
|
||||||
wabiSabiKeywords.put("Sketchboard", Arrays.asList("a quiet and peaceful atmosphere"));
|
wabiSabiKeywords.put("Sketchboard", Arrays.asList("a quiet and peaceful atmosphere"));
|
||||||
|
|
||||||
styleCategoryKeywords.put(StyleEnum.NEO_CHINESE, neoChineseKeywords);
|
styleCategoryKeywords.put(StyleEnum.NEW_CHINESE, neoChineseKeywords);
|
||||||
styleCategoryKeywords.put(StyleEnum.COUNTRY_STYLE, countryStyleKeywords);
|
styleCategoryKeywords.put(StyleEnum.COUNTRY_STYLE, countryStyleKeywords);
|
||||||
styleCategoryKeywords.put(StyleEnum.FUTURISM, futurismKeywords);
|
styleCategoryKeywords.put(StyleEnum.FUTURISM, futurismKeywords);
|
||||||
styleCategoryKeywords.put(StyleEnum.MINIMALISM, minimalistKeywords);
|
styleCategoryKeywords.put(StyleEnum.MINIMALISM, minimalistKeywords);
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public class WorkspaceVO extends Workspace {
|
|||||||
|
|
||||||
private String styleName;
|
private String styleName;
|
||||||
|
|
||||||
|
private String style;
|
||||||
|
|
||||||
private Map<String, List<String>> allKeywordsByStyle;
|
private Map<String, List<String>> allKeywordsByStyle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,6 @@ public interface PortfolioService extends IService<Portfolio> {
|
|||||||
Boolean viewsIncrease(Long id);
|
Boolean viewsIncrease(Long id);
|
||||||
|
|
||||||
Long viewsGet(Long id);
|
Long viewsGet(Long id);
|
||||||
|
|
||||||
|
Boolean commentDelete(CommentDTO commentDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public interface WorkspaceService extends IService<Workspace> {
|
|||||||
|
|
||||||
WorkspaceVO getByIdNew(Long id);
|
WorkspaceVO getByIdNew(Long id);
|
||||||
|
|
||||||
List<ModelsVO> getMannequins(String sex);
|
List<ModelsVO> getMannequins(String sex, String style);
|
||||||
|
|
||||||
void systemFileCopy();
|
void systemFileCopy();
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.ai.da.model.enums.Sex;
|
|||||||
import com.ai.da.model.vo.*;
|
import com.ai.da.model.vo.*;
|
||||||
import com.ai.da.service.*;
|
import com.ai.da.service.*;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -635,6 +636,29 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
return redisUtil.getViewCount(id);
|
return redisUtil.getViewCount(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean commentDelete(CommentDTO commentDTO) {
|
||||||
|
|
||||||
|
Long id = commentDTO.getId();
|
||||||
|
Portfolio portfolio = portfolioMapper.selectById(commentDTO.getPortfolioId());
|
||||||
|
Comment comment = commentMapper.selectById(id);
|
||||||
|
if (!Objects.equals(comment.getAccountId(), commentDTO.getAccountId()) || !Objects.equals(portfolio.getAccountId(), commentDTO.getAccountId())) {
|
||||||
|
throw new BusinessException("You do not have the permission to delete this comment");
|
||||||
|
}
|
||||||
|
// 删除主评论
|
||||||
|
commentMapper.deleteById(id);
|
||||||
|
|
||||||
|
// 删除子评论
|
||||||
|
LambdaQueryWrapper<Comment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(Comment::getParentLevel1Id, id)
|
||||||
|
.or()
|
||||||
|
.eq(Comment::getParentLevel2Id, id);
|
||||||
|
commentMapper.delete(lambdaQueryWrapper);
|
||||||
|
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
private List<CommentVO> getChildCommentVOList(Long id) {
|
private List<CommentVO> getChildCommentVOList(Long id) {
|
||||||
QueryWrapper<Comment> qw = new QueryWrapper<>();
|
QueryWrapper<Comment> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(Comment::getParentLevel1Id, id);
|
qw.lambda().eq(Comment::getParentLevel1Id, id);
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
Long styleId = workspaceRelStyles.get(0).getStyleId();
|
Long styleId = workspaceRelStyles.get(0).getStyleId();
|
||||||
Style style = styleMapper.selectById(styleId);
|
Style style = styleMapper.selectById(styleId);
|
||||||
StyleEnum styleEnum = StyleEnum.fromName(style.getName());
|
StyleEnum styleEnum = StyleEnum.fromName(style.getName());
|
||||||
|
vo.setStyle(styleEnum.name());
|
||||||
Map<String, List<String>> allKeywordsByStyle = StyleKeywordMapper.getAllKeywordsByStyle(styleEnum);
|
Map<String, List<String>> allKeywordsByStyle = StyleKeywordMapper.getAllKeywordsByStyle(styleEnum);
|
||||||
vo.setAllKeywordsByStyle(allKeywordsByStyle);
|
vo.setAllKeywordsByStyle(allKeywordsByStyle);
|
||||||
if (authPrincipalVo.getLanguage().equals(Language.ENGLISH.name())) {
|
if (authPrincipalVo.getLanguage().equals(Language.ENGLISH.name())) {
|
||||||
@@ -323,7 +323,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ModelsVO> getMannequins(String sex) {
|
public List<ModelsVO> getMannequins(String sex, String style) {
|
||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
List<ModelsVO> result = new ArrayList<>();
|
List<ModelsVO> result = new ArrayList<>();
|
||||||
QueryWrapper<Library> libraryQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<Library> libraryQueryWrapper = new QueryWrapper<>();
|
||||||
@@ -350,6 +350,11 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
// sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, SysFileLevel2TypeEnum.BODY.getRealName());
|
// sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, SysFileLevel2TypeEnum.BODY.getRealName());
|
||||||
sysFileQueryWrapper.lambda().eq(SysFile::getLevel1Type, "Models");
|
sysFileQueryWrapper.lambda().eq(SysFile::getLevel1Type, "Models");
|
||||||
sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, sex);
|
sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, sex);
|
||||||
|
if (!StringUtils.isEmpty(style)) {
|
||||||
|
sysFileQueryWrapper.lambda().eq(SysFile::getLevel3Type, style);
|
||||||
|
}else {
|
||||||
|
sysFileQueryWrapper.lambda().isNull(SysFile::getLevel3Type);
|
||||||
|
}
|
||||||
List<SysFile> sysFileList = sysFileMapper.selectList(sysFileQueryWrapper);
|
List<SysFile> sysFileList = sysFileMapper.selectList(sysFileQueryWrapper);
|
||||||
if (!CollectionUtils.isEmpty(sysFileList)) {
|
if (!CollectionUtils.isEmpty(sysFileList)) {
|
||||||
List<ModelVO> modelVOList = new ArrayList<>();
|
List<ModelVO> modelVOList = new ArrayList<>();
|
||||||
|
|||||||
@@ -65,4 +65,18 @@
|
|||||||
RAND()
|
RAND()
|
||||||
LIMIT 20
|
LIMIT 20
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getIdByFileName" resultType="java.lang.Long">
|
||||||
|
SELECT
|
||||||
|
ID
|
||||||
|
FROM
|
||||||
|
${tableName}
|
||||||
|
WHERE img_name = #{fileName}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateStyleById">
|
||||||
|
update ${tableName}
|
||||||
|
set style = #{style}
|
||||||
|
where ID = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user