{“shopCategoryList”:[{“shopCategoryId”:1,“shopCategoryName”:“吃”,“shopCategoryDesc”:“美好的一天从吃东西开始”,“shopCategoryImg”:"\upload\images\item\shopcategory\eat.jpeg",“priority”:1,“createTime”:null,“lastEditTime”:null,“parent”:null},{“shopCategoryId”:2,“shopCategoryName”:“住”,“shopCategoryDesc”:“能躺着就决不站着”,“shopCategoryImg”:"\upload\images\item\shopcategory\2.jpg",“priority”:1,“createTime”:null,“lastEditTime”:null,“parent”:null},{“shopCategoryId”:3,“shopCategoryName”:“娱乐”,“shopCategoryDesc”:"!!快乐!!",“shopCategoryImg”:"\upload\images\item\shopcategory\4.jpg",“priority”:1,“createTime”:null,“lastEditTime”:null,“parent”:null},{“shopCategoryId”:4,“shopCategoryName”:“旅游”,“shopCategoryDesc”:“说走就走”,“shopCategoryImg”:"\upload\images\item\shopcategory\5.jpg",“priority”:1,“createTime”:null,“lastEditTime”:null,“parent”:null},{“shopCategoryId”:5,“shopCategoryName”:“生活”,“shopCategoryDesc”:“享受生活”,“shopCategoryImg”:"\upload\images\item\shopcategory\6.jpg",“priority”:1,“createTime”:null,“lastEditTime”:null,“parent”:null}],“success”:true,“headLineList”:[{“headId”:null,“headName”:null,“headLink”:null,“enableStatus”:1,“headImg”:null,“priority”:1,“createTime”:null,“lastEditTime”:null},{“headId”:null,“headName”:null,“headLink”:null,“enableStatus”:1,“headImg”:null,“priority”:1,“createTime”:null,“lastEditTime”:null}]}
数据库里是有值的 测试的时候也是对的
这是我的headline 代码 headlinedao
package com.homework.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.homework.entity.HeadLine;
public interface HeadLineDao {
/**
* 根据传入的查询条件(头条名查询头条)
*
* @return
*/
List<HeadLine> queryHeadLine(@Param("headLineCondition") HeadLine headLineCondition);
/**
* 根据头条id返回唯一的头条信息
*
* @param lineId
* @return
*/
HeadLine queryHeadLineById(long lineId);
/**
* 根据传入的Id列表查询头条信息(供超级管理员选定删除头条的时候用,主要是处理图片)
*
* @param lineIdList
* @return
*/
List<HeadLine> queryHeadLineByIds(List<Long> lineIdList);
/**
* 插入头条
*
* @param headLine
* @return
*/
int insertHeadLine(HeadLine headLine);
/**
* 更新头条信息
*
* @param headLine
* @return
*/
int updateHeadLine(HeadLine headLine);
/**
* 删除头条
*
* @param headLineId
* @return
*/
int deleteHeadLine(long headLineId);
/**
*
* @param lineIdList
* @return
*/
int batchDeleteHeadLine(List<Long> lineIdList);
}
这是我的mapper文件HeadLineDao.xml
这是我的service文件
package com.homework.service;
import java.io.IOException;
import java.util.List;
import com.homework.entity.HeadLine;
public interface HeadLineService {
/**
* 根据传入的条件返回指定的头条列表
*
* @param headLineCondition
* @return
* @throws IOException
*/
List<HeadLine> getHeadLineList(HeadLine headLineCondition);
}
这是impl文件
package com.homework.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homework.dao.HeadLineDao;
import com.homework.entity.HeadLine;
import com.homework.service.HeadLineService;
@Service
public class HeadLineServiceImpl implements HeadLineService {
@Autowired
private HeadLineDao headLineDao;
@Override
public List<HeadLine> getHeadLineList(HeadLine headLineCondition) {
// TODO Auto-generated method stub
return headLineDao.queryHeadLine(headLineCondition);
}
}
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程