package com.bofeng.wx.controller; import com.bofeng.entity.Buy; import com.bofeng.entity.JmTuangou; import com.bofeng.service.BuyService; import com.yvan.Model; import com.yvan.ModelOps; import com.yvan.mvc.Pd; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import java.util.List; @RestController public class BuyController { @Autowired private BuyService buyService; @GetMapping("/home/home/buyGroup") public ModelOps buyGroup(Buy buy) { return ModelOps.newSuccess(buyService.buyGroup(buy)); } @GetMapping("/home/buytc.html") public ModelAndView buytc(@Pd(name = "userId") Long userId, @Pd(name = "jmId") Long jmId, @Pd(name = "type") Integer type, @Pd(name = "tgStatus") Integer tgStatus, @Pd(name = "buyId") Long buyId, ModelMap model) { model.put("userId", userId); model.put("jmId", jmId); model.put("type", type); model.put("tgStatus", tgStatus); model.put("buyId", buyId); buyService.updateStatus(); return new ModelAndView("/home/buytc.ftl", model); } @GetMapping("/home/buy/group") public Model> group(@Pd(name = "userId") Long userId) { return Model.newSuccess(buyService.group(userId)); } @GetMapping("/home/Mygroup/group") public Model> MyGroup(@Pd(name = "userId") Long userId) { return Model.newSuccess(buyService.MyGroup(userId)); } @GetMapping("/home/queryGroup/buyGroup") public Model queryGroup(@Pd(name = "buyId") Long buyId) { return Model.newSuccess(buyService.queryGroup(buyId)); } @GetMapping("/home/querysj/buytj") public Model buytj(@Pd(name = "userId") Long userId, @Pd(name = "jmId") Long jmId, ModelMap model) { return Model.newSuccess(buyService.selectGroup(userId, jmId)); } @GetMapping("/home/back/buyBack") public ModelOps buyBack(Buy buy) { return ModelOps.newSuccess(buyService.buyBack(buy)); } @GetMapping("/query/getAll/status") public Model status(Buy buy) { return Model.newSuccess(buyService.status(buy)); } }