AppletHomeController.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.zsElectric.boot.business.controller.applet;
  2. import com.zsElectric.boot.business.model.vo.UserInfoVO;
  3. import com.zsElectric.boot.business.service.UserInfoService;
  4. import com.zsElectric.boot.core.web.Result;
  5. import io.swagger.v3.oas.annotations.Operation;
  6. import com.baomidou.mybatisplus.core.metadata.IPage;
  7. import com.zsElectric.boot.business.model.query.StationInfoQuery;
  8. import com.zsElectric.boot.business.model.vo.StationInfoVO;
  9. import com.zsElectric.boot.business.service.AppletHomeService;
  10. import com.zsElectric.boot.core.web.PageResult;
  11. import io.swagger.v3.oas.annotations.Operation;
  12. import io.swagger.v3.oas.annotations.tags.Tag;
  13. import lombok.RequiredArgsConstructor;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.PostMapping;
  16. import org.springframework.web.bind.annotation.RequestBody;
  17. import org.springframework.web.bind.annotation.RequestMapping;
  18. import org.springframework.web.bind.annotation.RestController;
  19. @Tag(name = "主页相关接口")
  20. @RestController
  21. @RequestMapping("/applet/v1/home")
  22. @RequiredArgsConstructor
  23. public class AppletHomeController {
  24. private final UserInfoService userInfoService;
  25. @Operation(summary = "微信小程序获取当前登录信息")
  26. @GetMapping("/getUserInfo")
  27. public Result<UserInfoVO> getUserInfo() {
  28. UserInfoVO currentUserInfo = userInfoService.getCurrentUserInfo();
  29. return Result.success(currentUserInfo);
  30. }
  31. private final AppletHomeService appletHomeService;
  32. /**
  33. * 用户端分页查询站点信息
  34. *
  35. * @param queryParams 查询参数
  36. * @return 站点信息分页列表
  37. */
  38. @Operation(summary = "用户端分页查询站点信息")
  39. @PostMapping("/getStationInfoPage")
  40. public PageResult<StationInfoVO> getStationInfoPage(@RequestBody StationInfoQuery queryParams) {
  41. IPage<StationInfoVO> result = appletHomeService.getStationInfoPage(queryParams);
  42. return PageResult.success(result);
  43. }
  44. }