WXUserController.java 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. package com.ygj.yuemum.controller.wxmini;
  2. import com.ygj.yuemum.domain.wxmini.WXUser;
  3. import com.ygj.yuemum.service.wxmini.WXUserService;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.*;
  6. @RestController
  7. public class WXUserController {
  8. @Autowired
  9. private WXUserService wxUserService;
  10. @GetMapping("/getWXUser")
  11. public WXUser getWXUser(@RequestParam("xu_openid") String xu_openid) {
  12. WXUser wxUser = wxUserService.getWXUser(xu_openid);
  13. return wxUser;
  14. }
  15. @GetMapping("/getWXUserType")
  16. public int getWXUserType(@RequestParam("xu_openid") String xu_openid) {
  17. return wxUserService.getWXUserType(xu_openid);
  18. }
  19. @PostMapping("/insertWXUser")
  20. public int insertWXUser(@ModelAttribute WXUser wxUser) {
  21. return wxUserService.insertWXUser(wxUser);
  22. }
  23. @PostMapping("/updateWXUser")
  24. public int updateWXUser(@ModelAttribute WXUser wxUser) {
  25. return wxUserService.updateWXUser(wxUser);
  26. }
  27. }