2024-01-19 17:12:41 +08:00
|
|
|
package com.qihang.tao.controller;
|
|
|
|
|
|
2024-02-26 20:51:10 +08:00
|
|
|
import com.qihang.tao.domain.TaoGoods;
|
|
|
|
|
import com.qihang.tao.mapper.TaoGoodsMapper;
|
2024-01-22 14:35:36 +08:00
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
2024-01-19 17:12:41 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
@RestController
|
2024-02-25 11:11:57 +08:00
|
|
|
public class
|
|
|
|
|
HomeController {
|
2024-02-26 20:51:10 +08:00
|
|
|
@Autowired
|
|
|
|
|
private TaoGoodsMapper goodsMapper;
|
2024-01-25 20:31:16 +08:00
|
|
|
@GetMapping("/")
|
2024-01-19 17:12:41 +08:00
|
|
|
public String home(){
|
2024-01-25 20:31:16 +08:00
|
|
|
return "{'code':0,'msg':'请通过api访问'}";
|
2024-01-19 17:12:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Value(value = "${zhijian.name:1}")
|
|
|
|
|
private String serverName;
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/test/na")
|
2024-01-22 14:35:36 +08:00
|
|
|
public String get(HttpServletRequest request) {
|
|
|
|
|
String token = request.getHeader("Authorization");
|
|
|
|
|
System.out.println("tao-api token:"+token);
|
2024-02-26 20:51:10 +08:00
|
|
|
|
|
|
|
|
TaoGoods taoGoods = goodsMapper.selectById(1L);
|
|
|
|
|
|
2024-01-19 17:12:41 +08:00
|
|
|
return serverName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|