GetUserController.java 1.1 KB
package com.sunyo.wlpt.dispatch.controller;

import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.fegin.GetUserFegin;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author 子诚
 * Description:
 * 时间:2020/5/8 16:38
 */
@RequestMapping("/dispatch")
@RestController
public class GetUserController {

    @Resource
    private GetUserFegin getUserFegin;

    @GetMapping("/user/getUser")
    public ResultJson<PageInfo> getUser(@RequestParam(value = "userName", required = false) String userName, HttpServletRequest request) {
        String token = request.getHeader("Authorization");
        System.out.println(userName + "的token是" + token);
        return getUserFegin.list(userName, token);
    }
}