首页>代码>ssm微信小程序物业管理系统,有网站后台管理系统>/SheQu/src/main/java/com/shequ/controller/api/GoodsPayApi.java
package com.shequ.controller.api;

import com.alibaba.fastjson.JSON;
import com.shequ.mapper.GoodsPayMapper;
import com.shequ.pojo.Goods;
import com.shequ.service.GoodsPayService;
import com.shequ.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;


@Controller
public class GoodsPayApi {
    @Autowired
    GoodsPayService goodsPayService;
    /*
    微信小程序端提供json接口的。记录商品购买
     */
    @ResponseBody
    @RequestMapping(value = "/insertBuyGoods")
    public String insertBuyGoods(@RequestBody Map map){
        int n = goodsPayService.insertBuyGoods(map);
        if(n>0){
            return "success";
        }
        return "failure";
    }

    @ResponseBody
    @RequestMapping(value = "/findMyGoods",produces="application/json;charset=UTF-8")
    public String findMyGoods(@RequestParam("uid")String uid){
        List<Goods> goods = goodsPayService.findMyGoods(uid);
        String result = JSON.toJSONString(goods);
        System.out.println(result);
        return result;
    }
}
最近下载更多
DFwang  LV5 3月14日
新哥新奇士橙  LV4 1月26日
zolscy  LV24 2024年11月27日
唐僧洗头爱飘柔  LV22 2024年9月13日
lo8lukoukoum  LV4 2024年4月9日
ningningnn  LV3 2024年2月24日
晴曛  LV6 2023年12月29日
阿狸哦  LV2 2023年12月2日
lzpsuifeng  LV3 2023年10月13日
348835269  LV11 2023年9月27日
最近浏览更多
chengguo123 4月2日
暂无贡献等级
哪里的完整版  LV8 4月1日
lipiao161  LV16 3月15日
DFwang  LV5 3月14日
新哥新奇士橙  LV4 1月26日
zyfile  LV1 1月9日
xiaoaitx  LV8 1月2日
xianyu091012  LV5 2024年12月28日
梁英孩 2024年12月9日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友