src/com/shop/service/OsAddressService.java

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.shop.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.shop.dao.OsAddressMapper;
import com.shop.po.OsAddress;
import com.shop.po.OsProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 康健
 * @Date 2017/8/12 9:33
 */
@Service
public class OsAddressService {

    @Autowired
    private OsAddressMapper osAddressMapper;
    private Page<OsAddress> l ;

    public Page<OsAddress> getL() {
        return l;
    }

    public void setL(Page<OsAddress> l) {
        this.l = l;
    }



    public List<OsAddress> listAddress(Long userId) {
        List<OsAddress> list = osAddressMapper.selectByUserId(userId);
        return list;
    }

    public OsAddress getAddress(Long addressId) {
        OsAddress osAddress = osAddressMapper.selectByAddressId(addressId);
        return osAddress;
    }

    //分页查询收货地址
    public List<OsAddress> pageAddressInfo(Integer page, Integer limit, Long userId) {
        PageHelper.startPage(page, limit);
        List<OsAddress> list = osAddressMapper.selectByUserId(userId);
        this. l = (Page<OsAddress>)list;
        return list;
    }

    //新增收货地址
    public int insertAddress(OsAddress osAddress) {
        int count = osAddressMapper.insertSelective(osAddress);
        return count;
    }

    //更新收货地址
    public int updatetAddress(OsAddress osAddress) {
        int count = osAddressMapper.updateByPrimaryKeySelective(osAddress);
后面还有 9 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。