yxixi 发表于 2019-2-20 06:42:04

『高级篇』docker之开发课程EdgeService(16)

  >原创文章,欢迎转载。转载请注明:转载自IT人故事会,谢谢!
>原文链接地址:『高级篇』docker之开发课程EdgeService(16)
  课程的edgeService依赖于课程服务的dubbo服务,对外提供的restAPI,跟用户的EdgeService有点类似,只是一个调用的是thrift,一个调用的是dubbo,比较特殊的是课程的EdgeService需要用户登录后才可以访问,如果没有登录的话,需要跳转到登录系统才可以访问。源码:https://github.com/limingios/msA-docker



新建模块course-edge-servce



[*]pom增加依賴




org.springframework.boot
spring-boot-starter-parent
1.5.3.RELEASE

4.0.0
com.idig8
course-edge-service
1.0-SNAPSHOT


org.springframework.boot
spring-boot-starter-web


commons-lang
commons-lang
2.6


io.dubbo.springboot
spring-boot-starter-dubbo
1.0.0


com.idig8
course-dubbo-service-api
1.0-SNAPSHOT


com.idig8
user-edge-service-client
1.0-SNAPSHOT






[*]controller 调用course-dubbo-service-api 中的接口

package com.idig8.course.controller;
  import com.alibaba.dubbo.config.annotation.Reference;
import com.idig8.course.dto.CourseDTO;
import com.idig8.course.service.ICourseService;
import com.idig8.thrift.user.dto.UserDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
  import javax.servlet.http.HttpServletRequest;
import java.util.List;
  /**



  Created by Michael on 2017/11/4.*/
@Controllerbr/>@ResponseBody
页: [1]
查看完整版本: 『高级篇』docker之开发课程EdgeService(16)