|
@@ -4,7 +4,6 @@ import com.etotem.cfc.common.Result;
|
|
|
import com.etotem.cfc.dto.RecommendationQuery;
|
|
import com.etotem.cfc.dto.RecommendationQuery;
|
|
|
import com.etotem.cfc.dto.RecommendationResult;
|
|
import com.etotem.cfc.dto.RecommendationResult;
|
|
|
import com.etotem.cfc.service.AiGateway;
|
|
import com.etotem.cfc.service.AiGateway;
|
|
|
-import com.etotem.cfc.service.ProfileRecommendService;
|
|
|
|
|
import com.etotem.cfc.service.RecommendationService;
|
|
import com.etotem.cfc.service.RecommendationService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -36,9 +35,6 @@ public class RecommendationController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private AiGateway aiGateway;
|
|
private AiGateway aiGateway;
|
|
|
|
|
|
|
|
- @Resource
|
|
|
|
|
- private ProfileRecommendService profileRecommendService;
|
|
|
|
|
-
|
|
|
|
|
@Operation(summary = "按营养标签搜索推荐内容")
|
|
@Operation(summary = "按营养标签搜索推荐内容")
|
|
|
@PostMapping("/search")
|
|
@PostMapping("/search")
|
|
|
public Result<List<RecommendationResult>> search(
|
|
public Result<List<RecommendationResult>> search(
|
|
@@ -78,21 +74,4 @@ public class RecommendationController {
|
|
|
return Result.success(null);
|
|
return Result.success(null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Operation(summary = "画像驱动推荐")
|
|
|
|
|
- @PostMapping("/profile")
|
|
|
|
|
- public Result<Map<String, Object>> profileRecommend(
|
|
|
|
|
- @RequestBody Map<String, Object> params,
|
|
|
|
|
- HttpServletRequest request) {
|
|
|
|
|
- Long memberId = params.get("memberId") != null
|
|
|
|
|
- ? ParamUtils.getLong(params.get("memberId"))
|
|
|
|
|
- : (Long) request.getAttribute("userId");
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
|
|
- List<String> types = params.get("types") != null
|
|
|
|
|
- ? (List<String>) params.get("types")
|
|
|
|
|
- : Arrays.asList("product", "article", "activity");
|
|
|
|
|
- int limit = params.get("limit") != null
|
|
|
|
|
- ? Integer.parseInt(params.get("limit").toString())
|
|
|
|
|
- : 10;
|
|
|
|
|
- return Result.success(profileRecommendService.recommend(memberId, types, limit));
|
|
|
|
|
}
|
|
}
|
|
|
-}
|
|
|