敏捷工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

2 years ago
  1. package com.whn.hellospring.controller;
  2. import com.whn.hellospring.common.StateMessage;
  3. import com.whn.hellospring.common.Status;
  4. import com.whn.hellospring.model.VersionDO;
  5. import com.whn.hellospring.request.VersionRequest;
  6. import com.whn.hellospring.service.AppService;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.RequestBody;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import java.util.List;
  13. @RestController
  14. @RequestMapping(value = "/app")
  15. public class AppController {
  16. @Autowired
  17. AppService appService;
  18. /**
  19. * 获取版本号
  20. */
  21. @GetMapping(value = "/version")
  22. public Status getVersion(@RequestBody VersionRequest request) {
  23. try {
  24. List<VersionDO> version = appService.getVersion(request.getEquipment());
  25. Status status = new Status(StateMessage.SUCCESS, version);
  26. return status;
  27. } catch (Exception e) {
  28. return new Status(StateMessage.UN_KNOW_REASON);
  29. }
  30. }
  31. }