123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package com.gyee.runeconomy.controller;
- import com.gyee.common.model.StringUtils;
- import com.gyee.runeconomy.dto.R;
- import com.gyee.runeconomy.dto.ResultMsg;
- import com.gyee.runeconomy.model.auto.ProBasicSubStation;
- import com.gyee.runeconomy.service.TokenService;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.context.request.RequestContextHolder;
- import org.springframework.web.context.request.ServletRequestAttributes;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletRequest;
- import java.util.List;
- /**
- * <p>
- * 调度场站名称 前端控制器
- * </p>
- *
- * @author wang
- * @since 2022-11-22
- */
- @RestController
- @RequestMapping("//substation")
- public class ProBasicSubStationController {
- @Resource
- private TokenService tokenService;
- @GetMapping("/queryall")
- @ResponseBody
- @ApiOperation(value = "获得升压站信息", notes = "获得升压站信息")
- public R queryAll() throws Exception {
- HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
- List<ProBasicSubStation> sublist = tokenService.getSubwpls(request);
- if (StringUtils.isNotNull(sublist)) {
- return R.data(ResultMsg.ok(sublist));
- } else {
- return R.error(ResultMsg.error());
- }
- }
- }
|