BuyController.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package com.bofeng.wx.controller;
  2. import com.bofeng.entity.Buy;
  3. import com.bofeng.entity.JmTuangou;
  4. import com.bofeng.service.BuyService;
  5. import com.yvan.Model;
  6. import com.yvan.ModelOps;
  7. import com.yvan.mvc.Pd;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.ui.ModelMap;
  10. import org.springframework.web.bind.annotation.GetMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import org.springframework.web.servlet.ModelAndView;
  13. import java.util.List;
  14. @RestController
  15. public class BuyController {
  16. @Autowired
  17. private BuyService buyService;
  18. @GetMapping("/home/home/buyGroup")
  19. public ModelOps buyGroup(Buy buy) {
  20. return ModelOps.newSuccess(buyService.buyGroup(buy));
  21. }
  22. @GetMapping("/home/buytc.html")
  23. public ModelAndView buytc(@Pd(name = "userId") Long userId, @Pd(name = "jmId") Long jmId,
  24. @Pd(name = "type") Integer type, @Pd(name = "tgStatus") Integer tgStatus,
  25. @Pd(name = "buyId") Long buyId, ModelMap model) {
  26. model.put("userId", userId);
  27. model.put("jmId", jmId);
  28. model.put("type", type);
  29. model.put("tgStatus", tgStatus);
  30. model.put("buyId", buyId);
  31. buyService.updateStatus();
  32. return new ModelAndView("/home/buytc.ftl", model);
  33. }
  34. @GetMapping("/home/buy/group")
  35. public Model<List<JmTuangou>> group(@Pd(name = "userId") Long userId) {
  36. return Model.newSuccess(buyService.group(userId));
  37. }
  38. @GetMapping("/home/Mygroup/group")
  39. public Model<List<Buy>> MyGroup(@Pd(name = "userId") Long userId) {
  40. return Model.newSuccess(buyService.MyGroup(userId));
  41. }
  42. @GetMapping("/home/queryGroup/buyGroup")
  43. public Model<Buy> queryGroup(@Pd(name = "buyId") Long buyId) {
  44. return Model.newSuccess(buyService.queryGroup(buyId));
  45. }
  46. @GetMapping("/home/querysj/buytj")
  47. public Model<JmTuangou> buytj(@Pd(name = "userId") Long userId, @Pd(name = "jmId") Long jmId, ModelMap model) {
  48. return Model.newSuccess(buyService.selectGroup(userId, jmId));
  49. }
  50. @GetMapping("/home/back/buyBack")
  51. public ModelOps buyBack(Buy buy) {
  52. return ModelOps.newSuccess(buyService.buyBack(buy));
  53. }
  54. @GetMapping("/query/getAll/status")
  55. public Model<Buy> status(Buy buy) {
  56. return Model.newSuccess(buyService.status(buy));
  57. }
  58. }