Ver código fonte

CMS support UserTag UserRecommend module

guozhaoshun 6 anos atrás
pai
commit
c1cafa0dde

+ 16 - 0
rankin-cms-web/src/main/java/cn/rankin/cmsweb/service/user/UserTagProductRelationServiceInterface.java

@@ -0,0 +1,16 @@
+package cn.rankin.cmsweb.service.user;
+
+import cn.rankin.data.api.user.entity.UserTagProductRelation;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@FeignClient(value = "${service.user.name}")
+public interface UserTagProductRelationServiceInterface {
+
+    @RequestMapping(value = "/userTagProductRelation/{userTagId}", method = RequestMethod.GET)
+    List<UserTagProductRelation> findByUserTagId(@PathVariable("userTagId") String userTagId);
+
+
+}

+ 24 - 0
rankin-user-service/src/main/java/cn/rankin/userservice/controller/UserTagProductRelationController.java

@@ -0,0 +1,24 @@
+package cn.rankin.userservice.controller;
+
+import cn.rankin.data.api.user.entity.UserTagProductRelation;
+import cn.rankin.userservice.service.UserTagProductRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping(value = "/userTagProductRelation")
+public class UserTagProductRelationController {
+
+    @Autowired
+    private UserTagProductRelationService userTagProductRelationService;
+
+    @RequestMapping(value = "/{userTagId}",method = RequestMethod.GET)
+    public List<UserTagProductRelation> findByUserTagId(@PathVariable("userTagId") String userTagId) {
+        List<UserTagProductRelation> userTagProductRelations = userTagProductRelationService.findByUserTagId(userTagId);
+        return userTagProductRelations;
+    }
+
+
+}