Ver código fonte

代码优化

gaodm 5 anos atrás
pai
commit
5f482deca2

+ 0 - 25
gateway-service/src/main/java/com/diagbot/client/UserServiceClient.java

@@ -1,25 +0,0 @@
-package com.diagbot.client;
-
-import com.diagbot.client.hystrix.UserServiceHystrix;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.User;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-
-/**
- * @Description: 请求认证授权服务器客户端
- * @author: gaodm
- * @time: 2018/8/2 13:37
- */
-@FeignClient(value = "user-service", fallback = UserServiceHystrix.class)
-public interface UserServiceClient {
-
-    @PostMapping("/user/login")
-    RespDTO<User> login(@RequestParam("username") String username, @RequestParam("password") String password);
-
-}
-
-
-

+ 0 - 24
gateway-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -1,24 +0,0 @@
-package com.diagbot.client.hystrix;
-
-
-import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.RespDTO;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-
-/**
- * @Description: 请求认证授权服务器客户端(请求失败熔断)
- * @author: gaodm
- * @time: 2018/8/2 13:37
- */
-@Component
-@Slf4j
-public class UserServiceHystrix implements UserServiceClient {
-
-    @Override
-    public RespDTO login(String username, String password) {
-        log.error("【hystrix】调用{}异常", "login");
-        return null;
-    }
-
-}

+ 0 - 29
gateway-service/src/main/java/com/diagbot/dto/LoginDTO.java

@@ -1,29 +0,0 @@
-package com.diagbot.dto;
-
-import com.diagbot.entity.User;
-
-/**
- * @Description: 登录输出类
- * @author: gaodm
- * @time: 2018/8/2 14:22
- */
-public class LoginDTO {
-    private User user;
-    private String token;
-
-    public User getUser() {
-        return user;
-    }
-
-    public void setUser(User user) {
-        this.user = user;
-    }
-
-    public String getToken() {
-        return token;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-}

+ 0 - 21
gateway-service/src/main/java/com/diagbot/entity/Token.java

@@ -1,21 +0,0 @@
-package com.diagbot.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.io.Serializable;
-
-/**
- * @Description: token
- * @Author: ztg
- * @Date: 2018/9/19 13:14
- */
-@Getter
-@Setter
-public class Token implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String token;
-
-}