Merge branch 'dev/dev_xp' into dev/dev
This commit is contained in:
@@ -3,6 +3,9 @@ package com.ai.da.common.enums;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CreditsEventsEnum {
|
||||
@@ -45,4 +48,9 @@ public enum CreditsEventsEnum {
|
||||
* 对应事件需要消耗or获得的积分
|
||||
*/
|
||||
private String value;
|
||||
|
||||
public static List<String> generateFunctionNames() {
|
||||
return Arrays.asList(SLOGAN.name, LOGO.name, PATTERN.name, MOOD_BOARD.name, SKETCH_BOARD.name,
|
||||
TO_PRODUCT_IMAGE.name, RELIGHT.name, IMAGE_TO_SKETCH.name, POSE_TRANSFORMATION.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,4 +199,11 @@ public class ConvenientInquiryController {
|
||||
public Response<PageBaseResponse<AccountCreditsUsageDTO>> getGenerateFrequency(@Valid @RequestBody AccountCreditsUsageQueryDTO queryDTO){
|
||||
return Response.success(convenientInquiryService.getGenerateFrequency(queryDTO));
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有生成功能的名字")
|
||||
@GetMapping("/getAllGenerateFuncName")
|
||||
public Response<List<String>> getAllGenerateFuncName(){
|
||||
return Response.success(convenientInquiryService.getAllGenerateFuncName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -112,12 +112,12 @@ public class ElementController {
|
||||
@ApiOperation(value = "图片分割")
|
||||
@PostMapping("/imageSegmentation")
|
||||
public Response<List<CollectionElementVO>> selectedImageSeg(
|
||||
@RequestPart(value = "files", required = false) MultipartFile[] files,
|
||||
@RequestPart(value = "file", required = false) MultipartFile[] file,
|
||||
@RequestParam(value = "type", required = false) @Pattern(regexp = "sketch|product", message = "类型必须是sketch或product") String type,
|
||||
@RequestParam(value = "id", required = false) Long id) {
|
||||
// 过滤空文件
|
||||
List<MultipartFile> nonEmptyFiles = Arrays.stream(files)
|
||||
.filter(file -> !file.isEmpty())
|
||||
List<MultipartFile> nonEmptyFiles = Arrays.stream(file)
|
||||
.filter(item -> !item.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
// 参数校验
|
||||
if ((nonEmptyFiles.isEmpty()) && id == null) {
|
||||
|
||||
@@ -56,4 +56,6 @@ public interface ConvenientInquiryService extends IService<Questionnaire> {
|
||||
String exportTransactionRecords(QueryPaymentInfoDTO queryPaymentInfoDTO, HttpServletResponse response);
|
||||
|
||||
PageBaseResponse<AccountCreditsUsageDTO> getGenerateFrequency(AccountCreditsUsageQueryDTO queryDTO);
|
||||
|
||||
List<String> getAllGenerateFuncName();
|
||||
}
|
||||
|
||||
@@ -905,4 +905,8 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getAllGenerateFuncName(){
|
||||
return CreditsEventsEnum.generateFunctionNames();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<!-- 查询总记录数 (优化版) -->
|
||||
<select id="countCreditUsage" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
SELECT COUNT(DISTINCT a.id)
|
||||
FROM t_account a
|
||||
<if test="changeEvent != null or startTime != null or endTime != null">
|
||||
LEFT JOIN t_credits_detail cd ON a.id = cd.account_id
|
||||
|
||||
Reference in New Issue
Block a user