Quellcode durchsuchen

移除新闻相关的接口

jishenghua vor 9 Monaten
Ursprung
Commit
e154d65e4d

+ 0 - 126
gyj-iot-boot/gyjiot-open-api/src/main/java/com/gyjiot/data/controller/NewsCategoryController.java

@@ -1,126 +0,0 @@
-package com.gyjiot.data.controller;
-
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
-import com.gyjiot.iot.model.IdAndName;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.gyjiot.common.annotation.Log;
-import com.gyjiot.common.core.controller.BaseController;
-import com.gyjiot.common.core.domain.AjaxResult;
-import com.gyjiot.common.enums.BusinessType;
-import com.gyjiot.iot.domain.NewsCategory;
-import com.gyjiot.iot.service.INewsCategoryService;
-import com.gyjiot.common.utils.poi.ExcelUtil;
-import com.gyjiot.common.core.page.TableDataInfo;
-
-/**
- * 新闻分类Controller
- * 
- * @author jishenghua
- * @date 2022-04-09
- */
-@Api(tags = "新闻分类")
-@RestController
-@RequestMapping("/iot/newsCategory")
-public class NewsCategoryController extends BaseController
-{
-    @Autowired
-    private INewsCategoryService newsCategoryService;
-
-    /**
-     * 查询新闻分类列表
-     */
-    @PreAuthorize("@ss.hasPermi('iot:newsCategory:list')")
-    @GetMapping("/list")
-    @ApiOperation("新闻分类分页列表")
-    public TableDataInfo list(NewsCategory newsCategory)
-    {
-        startPage();
-        List<NewsCategory> list = newsCategoryService.selectNewsCategoryList(newsCategory);
-        return getDataTable(list);
-    }
-
-    /**
-     * 查询新闻分类简短列表
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:list')")
-    @GetMapping("/newsCategoryShortList")
-    @ApiOperation("分类简短列表")
-    public AjaxResult newsCategoryShortList()
-    {
-        List<IdAndName> list = newsCategoryService.selectNewsCategoryShortList();
-        return AjaxResult.success(list);
-    }
-
-    /**
-     * 导出新闻分类列表
-     */
-    @PreAuthorize("@ss.hasPermi('iot:newsCategory:export')")
-    @Log(title = "新闻分类", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, NewsCategory newsCategory)
-    {
-        List<NewsCategory> list = newsCategoryService.selectNewsCategoryList(newsCategory);
-        ExcelUtil<NewsCategory> util = new ExcelUtil<NewsCategory>(NewsCategory.class);
-        util.exportExcel(response, list, "新闻分类数据");
-    }
-
-    /**
-     * 获取新闻分类详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('iot:newsCategory:query')")
-    @GetMapping(value = "/{categoryId}")
-    @ApiOperation("新闻分类详情")
-    public AjaxResult getInfo(@PathVariable("categoryId") Long categoryId)
-    {
-        return AjaxResult.success(newsCategoryService.selectNewsCategoryByCategoryId(categoryId));
-    }
-
-    /**
-     * 新增新闻分类
-     */
-    @PreAuthorize("@ss.hasPermi('iot:newsCategory:add')")
-    @Log(title = "新闻分类", businessType = BusinessType.INSERT)
-    @PostMapping
-    @ApiOperation("添加新闻分类")
-    public AjaxResult add(@RequestBody NewsCategory newsCategory)
-    {
-        return toAjax(newsCategoryService.insertNewsCategory(newsCategory));
-    }
-
-    /**
-     * 修改新闻分类
-     */
-    @PreAuthorize("@ss.hasPermi('iot:newsCategory:edit')")
-    @Log(title = "新闻分类", businessType = BusinessType.UPDATE)
-    @PutMapping
-    @ApiOperation("修改新闻分类")
-    public AjaxResult edit(@RequestBody NewsCategory newsCategory)
-    {
-        return toAjax(newsCategoryService.updateNewsCategory(newsCategory));
-    }
-
-    /**
-     * 删除新闻分类
-     */
-    @PreAuthorize("@ss.hasPermi('iot:newsCategory:remove')")
-    @Log(title = "新闻分类", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{categoryIds}")
-    @ApiOperation("删除新闻分类")
-    public AjaxResult remove(@PathVariable Long[] categoryIds)
-    {
-        return newsCategoryService.deleteNewsCategoryByCategoryIds(categoryIds);
-    }
-}

+ 0 - 141
gyj-iot-boot/gyjiot-open-api/src/main/java/com/gyjiot/data/controller/NewsController.java

@@ -1,141 +0,0 @@
-package com.gyjiot.data.controller;
-
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
-import com.gyjiot.iot.model.CategoryNews;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.gyjiot.common.annotation.Log;
-import com.gyjiot.common.core.controller.BaseController;
-import com.gyjiot.common.core.domain.AjaxResult;
-import com.gyjiot.common.enums.BusinessType;
-import com.gyjiot.iot.domain.News;
-import com.gyjiot.iot.service.INewsService;
-import com.gyjiot.common.utils.poi.ExcelUtil;
-import com.gyjiot.common.core.page.TableDataInfo;
-
-/**
- * 新闻资讯Controller
- * 
- * @author jishenghua
- * @date 2022-04-09
- */
-@Api(tags = "新闻资讯")
-@RestController
-@RequestMapping("/iot/news")
-public class NewsController extends BaseController
-{
-    @Autowired
-    private INewsService newsService;
-
-    /**
-     * 查询新闻资讯列表
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:list')")
-    @GetMapping("/list")
-    @ApiOperation("新闻分页列表")
-    public TableDataInfo list(News news)
-    {
-        startPage();
-        List<News> list = newsService.selectNewsList(news);
-        return getDataTable(list);
-    }
-
-    /**
-     * 查询轮播的新闻资讯
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:list')")
-    @GetMapping("/bannerList")
-    @ApiOperation("轮播新闻列表")
-    public AjaxResult bannerList()
-    {
-        News news=new News();
-        news.setIsBanner(1);
-        news.setStatus(1);
-        List<News> list = newsService.selectNewsList(news);
-        return AjaxResult.success(list);
-    }
-
-    /**
-     * 查询置顶的新闻资讯
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:list')")
-    @GetMapping("/topList")
-    @ApiOperation("置顶新闻列表")
-    public AjaxResult topList()
-    {
-        List<CategoryNews> list = newsService.selectTopNewsList();
-        return AjaxResult.success(list);
-    }
-
-    /**
-     * 导出新闻资讯列表
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:export')")
-    @Log(title = "新闻资讯", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, News news)
-    {
-        List<News> list = newsService.selectNewsList(news);
-        ExcelUtil<News> util = new ExcelUtil<News>(News.class);
-        util.exportExcel(response, list, "新闻资讯数据");
-    }
-
-    /**
-     * 获取新闻资讯详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:query')")
-    @GetMapping(value = "/{newsId}")
-    @ApiOperation("新闻详情")
-    public AjaxResult getInfo(@PathVariable("newsId") Long newsId)
-    {
-        return AjaxResult.success(newsService.selectNewsByNewsId(newsId));
-    }
-
-    /**
-     * 新增新闻资讯
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:add')")
-    @Log(title = "新闻资讯", businessType = BusinessType.INSERT)
-    @PostMapping
-    @ApiOperation("添加新闻资讯")
-    public AjaxResult add(@RequestBody News news)
-    {
-        return toAjax(newsService.insertNews(news));
-    }
-
-    /**
-     * 修改新闻资讯
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:edit')")
-    @Log(title = "新闻资讯", businessType = BusinessType.UPDATE)
-    @PutMapping
-    @ApiOperation("修改新闻资讯")
-    public AjaxResult edit(@RequestBody News news)
-    {
-        return toAjax(newsService.updateNews(news));
-    }
-
-    /**
-     * 删除新闻资讯
-     */
-    @PreAuthorize("@ss.hasPermi('iot:news:remove')")
-    @Log(title = "新闻资讯", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{newsIds}")
-    @ApiOperation("删除新闻资讯")
-    public AjaxResult remove(@PathVariable Long[] newsIds)
-    {
-        return toAjax(newsService.deleteNewsByNewsIds(newsIds));
-    }
-}

+ 0 - 79
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/java/com/gyjiot/iot/mapper/NewsCategoryMapper.java

@@ -1,79 +0,0 @@
-package com.gyjiot.iot.mapper;
-
-import java.util.List;
-import com.gyjiot.iot.domain.NewsCategory;
-import com.gyjiot.iot.model.IdAndName;
-import org.springframework.stereotype.Repository;
-
-/**
- * 新闻分类Mapper接口
- * 
- * @author ji-sheng-hua
- * @date 2022-04-09
- */
-@Repository
-public interface NewsCategoryMapper 
-{
-    /**
-     * 查询新闻分类
-     * 
-     * @param categoryId 新闻分类主键
-     * @return 新闻分类
-     */
-    public NewsCategory selectNewsCategoryByCategoryId(Long categoryId);
-
-    /**
-     * 查询新闻分类列表
-     * 
-     * @param newsCategory 新闻分类
-     * @return 新闻分类集合
-     */
-    public List<NewsCategory> selectNewsCategoryList(NewsCategory newsCategory);
-
-    /**
-     * 查询新闻分类简短列表
-     *
-     * @return 新闻分类集合
-     */
-    public List<IdAndName> selectNewsCategoryShortList();
-
-    /**
-     * 新增新闻分类
-     * 
-     * @param newsCategory 新闻分类
-     * @return 结果
-     */
-    public int insertNewsCategory(NewsCategory newsCategory);
-
-    /**
-     * 修改新闻分类
-     * 
-     * @param newsCategory 新闻分类
-     * @return 结果
-     */
-    public int updateNewsCategory(NewsCategory newsCategory);
-
-    /**
-     * 删除新闻分类
-     * 
-     * @param categoryId 新闻分类主键
-     * @return 结果
-     */
-    public int deleteNewsCategoryByCategoryId(Long categoryId);
-
-    /**
-     * 批量删除新闻分类
-     * 
-     * @param categoryIds 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deleteNewsCategoryByCategoryIds(Long[] categoryIds);
-
-    /**
-     * 分类下的新闻数量
-     *
-     * @param categoryIds 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int newsCountInCategorys(Long[] categoryIds);
-}

+ 0 - 70
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/java/com/gyjiot/iot/mapper/NewsMapper.java

@@ -1,70 +0,0 @@
-package com.gyjiot.iot.mapper;
-
-import java.util.List;
-import com.gyjiot.iot.domain.News;
-import org.springframework.stereotype.Repository;
-
-/**
- * 新闻资讯Mapper接口
- * 
- * @author ji-sheng-hua
- * @date 2022-04-09
- */
-@Repository
-public interface NewsMapper 
-{
-    /**
-     * 查询新闻资讯
-     * 
-     * @param newsId 新闻资讯主键
-     * @return 新闻资讯
-     */
-    public News selectNewsByNewsId(Long newsId);
-
-    /**
-     * 查询新闻资讯列表
-     * 
-     * @param news 新闻资讯
-     * @return 新闻资讯集合
-     */
-    public List<News> selectNewsList(News news);
-
-    /**
-     * 查询置顶新闻资讯列表
-     *
-     * @return 新闻资讯集合
-     */
-    public List<News> selectTopNewsList();
-
-    /**
-     * 新增新闻资讯
-     * 
-     * @param news 新闻资讯
-     * @return 结果
-     */
-    public int insertNews(News news);
-
-    /**
-     * 修改新闻资讯
-     * 
-     * @param news 新闻资讯
-     * @return 结果
-     */
-    public int updateNews(News news);
-
-    /**
-     * 删除新闻资讯
-     * 
-     * @param newsId 新闻资讯主键
-     * @return 结果
-     */
-    public int deleteNewsByNewsId(Long newsId);
-
-    /**
-     * 批量删除新闻资讯
-     * 
-     * @param newsIds 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deleteNewsByNewsIds(Long[] newsIds);
-}

+ 0 - 71
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/java/com/gyjiot/iot/service/INewsCategoryService.java

@@ -1,71 +0,0 @@
-package com.gyjiot.iot.service;
-
-import java.util.List;
-
-import com.gyjiot.common.core.domain.AjaxResult;
-import com.gyjiot.iot.domain.NewsCategory;
-import com.gyjiot.iot.model.IdAndName;
-
-/**
- * 新闻分类Service接口
- * 
- * @author ji-sheng-hua
- * @date 2022-04-09
- */
-public interface INewsCategoryService 
-{
-    /**
-     * 查询新闻分类
-     * 
-     * @param categoryId 新闻分类主键
-     * @return 新闻分类
-     */
-    public NewsCategory selectNewsCategoryByCategoryId(Long categoryId);
-
-    /**
-     * 查询新闻分类列表
-     * 
-     * @param newsCategory 新闻分类
-     * @return 新闻分类集合
-     */
-    public List<NewsCategory> selectNewsCategoryList(NewsCategory newsCategory);
-
-    /**
-     * 查询新闻分类简短列表
-     *
-     * @return 新闻分类集合
-     */
-    public List<IdAndName> selectNewsCategoryShortList();
-
-    /**
-     * 新增新闻分类
-     * 
-     * @param newsCategory 新闻分类
-     * @return 结果
-     */
-    public int insertNewsCategory(NewsCategory newsCategory);
-
-    /**
-     * 修改新闻分类
-     * 
-     * @param newsCategory 新闻分类
-     * @return 结果
-     */
-    public int updateNewsCategory(NewsCategory newsCategory);
-
-    /**
-     * 批量删除新闻分类
-     * 
-     * @param categoryIds 需要删除的新闻分类主键集合
-     * @return 结果
-     */
-    public AjaxResult deleteNewsCategoryByCategoryIds(Long[] categoryIds);
-
-    /**
-     * 删除新闻分类信息
-     * 
-     * @param categoryId 新闻分类主键
-     * @return 结果
-     */
-    public int deleteNewsCategoryByCategoryId(Long categoryId);
-}

+ 0 - 69
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/java/com/gyjiot/iot/service/INewsService.java

@@ -1,69 +0,0 @@
-package com.gyjiot.iot.service;
-
-import java.util.List;
-import com.gyjiot.iot.domain.News;
-import com.gyjiot.iot.model.CategoryNews;
-
-/**
- * 新闻资讯Service接口
- * 
- * @author ji-sheng-hua
- * @date 2022-04-09
- */
-public interface INewsService 
-{
-    /**
-     * 查询新闻资讯
-     * 
-     * @param newsId 新闻资讯主键
-     * @return 新闻资讯
-     */
-    public News selectNewsByNewsId(Long newsId);
-
-    /**
-     * 查询新闻资讯列表
-     * 
-     * @param news 新闻资讯
-     * @return 新闻资讯集合
-     */
-    public List<News> selectNewsList(News news);
-
-    /**
-     * 查询置顶新闻资讯列表
-     *
-     * @return 新闻资讯集合
-     */
-    public List<CategoryNews> selectTopNewsList();
-
-    /**
-     * 新增新闻资讯
-     * 
-     * @param news 新闻资讯
-     * @return 结果
-     */
-    public int insertNews(News news);
-
-    /**
-     * 修改新闻资讯
-     * 
-     * @param news 新闻资讯
-     * @return 结果
-     */
-    public int updateNews(News news);
-
-    /**
-     * 批量删除新闻资讯
-     * 
-     * @param newsIds 需要删除的新闻资讯主键集合
-     * @return 结果
-     */
-    public int deleteNewsByNewsIds(Long[] newsIds);
-
-    /**
-     * 删除新闻资讯信息
-     * 
-     * @param newsId 新闻资讯主键
-     * @return 结果
-     */
-    public int deleteNewsByNewsId(Long newsId);
-}

+ 0 - 117
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/java/com/gyjiot/iot/service/impl/NewsCategoryServiceImpl.java

@@ -1,117 +0,0 @@
-package com.gyjiot.iot.service.impl;
-
-import java.util.List;
-
-import com.gyjiot.common.core.domain.AjaxResult;
-import com.gyjiot.common.utils.DateUtils;
-import com.gyjiot.iot.model.IdAndName;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.gyjiot.iot.mapper.NewsCategoryMapper;
-import com.gyjiot.iot.domain.NewsCategory;
-import com.gyjiot.iot.service.INewsCategoryService;
-
-/**
- * 新闻分类Service业务层处理
- * 
- * @author ji-sheng-hua
- * @date 2022-04-09
- */
-@Service
-public class NewsCategoryServiceImpl implements INewsCategoryService 
-{
-    @Autowired
-    private NewsCategoryMapper newsCategoryMapper;
-
-    /**
-     * 查询新闻分类
-     * 
-     * @param categoryId 新闻分类主键
-     * @return 新闻分类
-     */
-    @Override
-    public NewsCategory selectNewsCategoryByCategoryId(Long categoryId)
-    {
-        return newsCategoryMapper.selectNewsCategoryByCategoryId(categoryId);
-    }
-
-    /**
-     * 查询新闻分类列表
-     * 
-     * @param newsCategory 新闻分类
-     * @return 新闻分类
-     */
-    @Override
-    public List<NewsCategory> selectNewsCategoryList(NewsCategory newsCategory)
-    {
-        return newsCategoryMapper.selectNewsCategoryList(newsCategory);
-    }
-
-    /**
-     * 查询新闻分类简短列表
-     *
-     * @return 新闻分类
-     */
-    @Override
-    public List<IdAndName> selectNewsCategoryShortList()
-    {
-        return newsCategoryMapper.selectNewsCategoryShortList();
-    }
-
-    /**
-     * 新增新闻分类
-     * 
-     * @param newsCategory 新闻分类
-     * @return 结果
-     */
-    @Override
-    public int insertNewsCategory(NewsCategory newsCategory)
-    {
-        newsCategory.setCreateTime(DateUtils.getNowDate());
-        return newsCategoryMapper.insertNewsCategory(newsCategory);
-    }
-
-    /**
-     * 修改新闻分类
-     * 
-     * @param newsCategory 新闻分类
-     * @return 结果
-     */
-    @Override
-    public int updateNewsCategory(NewsCategory newsCategory)
-    {
-        newsCategory.setUpdateTime(DateUtils.getNowDate());
-        return newsCategoryMapper.updateNewsCategory(newsCategory);
-    }
-
-    /**
-     * 批量删除新闻分类
-     * 
-     * @param categoryIds 需要删除的新闻分类主键
-     * @return 结果
-     */
-    @Override
-    public AjaxResult deleteNewsCategoryByCategoryIds(Long[] categoryIds)
-    {
-        int productCount=newsCategoryMapper.newsCountInCategorys(categoryIds);
-        if(productCount>0){
-            return AjaxResult.error("删除失败,请先删除对应分类下的新闻资讯");
-        }
-        if(newsCategoryMapper.deleteNewsCategoryByCategoryIds(categoryIds)>0){
-            return AjaxResult.success("删除成功");
-        }
-        return AjaxResult.error("删除失败");
-    }
-
-    /**
-     * 删除新闻分类信息
-     * 
-     * @param categoryId 新闻分类主键
-     * @return 结果
-     */
-    @Override
-    public int deleteNewsCategoryByCategoryId(Long categoryId)
-    {
-        return newsCategoryMapper.deleteNewsCategoryByCategoryId(categoryId);
-    }
-}

+ 0 - 131
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/java/com/gyjiot/iot/service/impl/NewsServiceImpl.java

@@ -1,131 +0,0 @@
-package com.gyjiot.iot.service.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import com.gyjiot.common.utils.DateUtils;
-import com.gyjiot.iot.mapper.NewsCategoryMapper;
-import com.gyjiot.iot.model.CategoryNews;
-import com.gyjiot.iot.model.IdAndName;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.gyjiot.iot.mapper.NewsMapper;
-import com.gyjiot.iot.domain.News;
-import com.gyjiot.iot.service.INewsService;
-
-/**
- * 新闻资讯Service业务层处理
- * 
- * @author ji-sheng-hua
- * @date 2022-04-09
- */
-@Service
-public class NewsServiceImpl implements INewsService 
-{
-    @Autowired
-    private NewsMapper newsMapper;
-
-    /**
-     * 查询新闻资讯
-     * 
-     * @param newsId 新闻资讯主键
-     * @return 新闻资讯
-     */
-    @Override
-    public News selectNewsByNewsId(Long newsId)
-    {
-        return newsMapper.selectNewsByNewsId(newsId);
-    }
-
-    /**
-     * 查询新闻资讯列表
-     * 
-     * @param news 新闻资讯
-     * @return 新闻资讯
-     */
-    @Override
-    public List<News> selectNewsList(News news)
-    {
-        return newsMapper.selectNewsList(news);
-    }
-
-    /**
-     * 查询置顶新闻资讯列表
-     *
-     * @return 新闻资讯
-     */
-    @Override
-    public List<CategoryNews> selectTopNewsList()
-    {
-        List<CategoryNews> categoryNewsList =new ArrayList<>();
-        List<News> newsList=newsMapper.selectTopNewsList();
-        for(int i=0;i<newsList.size();i++){
-            boolean isAdd=false;
-            for(int j=0;j<categoryNewsList.size();j++){
-                if(newsList.get(i).getCategoryId().longValue()==categoryNewsList.get(j).getCategoryId().longValue()){
-                    categoryNewsList.get(j).getNewsList().add(newsList.get(i));
-                    isAdd=true;
-                    break;
-                }
-            }
-            if(!isAdd) {
-                CategoryNews categoryNews = new CategoryNews();
-                categoryNews.setCategoryId(newsList.get(i).getCategoryId());
-                categoryNews.setCategoryName(newsList.get(i).getCategoryName());
-                categoryNews.getNewsList().add(newsList.get(i));
-                categoryNewsList.add(categoryNews);
-            }
-        }
-        return categoryNewsList;
-    }
-
-    /**
-     * 新增新闻资讯
-     * 
-     * @param news 新闻资讯
-     * @return 结果
-     */
-    @Override
-    public int insertNews(News news)
-    {
-        news.setCreateTime(DateUtils.getNowDate());
-        return newsMapper.insertNews(news);
-    }
-
-    /**
-     * 修改新闻资讯
-     * 
-     * @param news 新闻资讯
-     * @return 结果
-     */
-    @Override
-    public int updateNews(News news)
-    {
-        news.setUpdateTime(DateUtils.getNowDate());
-        return newsMapper.updateNews(news);
-    }
-
-    /**
-     * 批量删除新闻资讯
-     * 
-     * @param newsIds 需要删除的新闻资讯主键
-     * @return 结果
-     */
-    @Override
-    public int deleteNewsByNewsIds(Long[] newsIds)
-    {
-        return newsMapper.deleteNewsByNewsIds(newsIds);
-    }
-
-    /**
-     * 删除新闻资讯信息
-     * 
-     * @param newsId 新闻资讯主键
-     * @return 结果
-     */
-    @Override
-    public int deleteNewsByNewsId(Long newsId)
-    {
-        return newsMapper.deleteNewsByNewsId(newsId);
-    }
-}

+ 0 - 103
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/resources/mapper/iot/NewsCategoryMapper.xml

@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.gyjiot.iot.mapper.NewsCategoryMapper">
-    
-    <resultMap type="com.gyjiot.iot.domain.NewsCategory" id="NewsCategoryResult">
-        <result property="categoryId"    column="category_id"    />
-        <result property="categoryName"    column="category_name"    />
-        <result property="orderNum"    column="order_num"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
-    </resultMap>
-
-    <resultMap type="com.gyjiot.iot.model.IdAndName" id="CategoryShortResult">
-        <result property="id"    column="category_id"    />
-        <result property="name"    column="category_name"    />
-    </resultMap>
-
-    <sql id="selectNewsCategoryVo">
-        select category_id, category_name, order_num, del_flag, create_by, create_time, update_by, update_time, remark from news_category
-    </sql>
-
-    <select id="selectNewsCategoryList" parameterType="com.gyjiot.iot.domain.NewsCategory" resultMap="NewsCategoryResult">
-        <include refid="selectNewsCategoryVo"/>
-        <where>  
-            <if test="categoryName != null  and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
-        </where>
-        order by order_num
-    </select>
-
-    <select id="selectNewsCategoryShortList"  resultMap="CategoryShortResult">
-        select category_id, category_name
-        from news_category
-        order by order_num
-    </select>
-    
-    <select id="selectNewsCategoryByCategoryId" parameterType="Long" resultMap="NewsCategoryResult">
-        <include refid="selectNewsCategoryVo"/>
-        where category_id = #{categoryId}
-    </select>
-        
-    <insert id="insertNewsCategory" parameterType="com.gyjiot.iot.domain.NewsCategory" useGeneratedKeys="true" keyProperty="categoryId">
-        insert into news_category
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="categoryName != null and categoryName != ''">category_name,</if>
-            <if test="orderNum != null">order_num,</if>
-            <if test="delFlag != null">del_flag,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="remark != null">remark,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="categoryName != null and categoryName != ''">#{categoryName},</if>
-            <if test="orderNum != null">#{orderNum},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="remark != null">#{remark},</if>
-         </trim>
-    </insert>
-
-    <update id="updateNewsCategory" parameterType="com.gyjiot.iot.domain.NewsCategory">
-        update news_category
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
-            <if test="orderNum != null">order_num = #{orderNum},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="remark != null">remark = #{remark},</if>
-        </trim>
-        where category_id = #{categoryId}
-    </update>
-
-    <delete id="deleteNewsCategoryByCategoryId" parameterType="Long">
-        delete from news_category where category_id = #{categoryId}
-    </delete>
-
-    <delete id="deleteNewsCategoryByCategoryIds" parameterType="String">
-        delete from news_category where category_id in 
-        <foreach item="categoryId" collection="array" open="(" separator="," close=")">
-            #{categoryId}
-        </foreach>
-    </delete>
-
-    <select id="newsCountInCategorys" parameterType="String" resultType="int">
-        select count(*) from news where category_id in
-        <foreach item="categoryId" collection="array" open="(" separator="," close=")">
-            #{categoryId}
-        </foreach>
-    </select>
-</mapper>

+ 0 - 127
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/resources/mapper/iot/NewsMapper.xml

@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.gyjiot.iot.mapper.NewsMapper">
-    
-    <resultMap type="com.gyjiot.iot.domain.News" id="NewsResult">
-        <result property="newsId"    column="news_id"    />
-        <result property="title"    column="title"    />
-        <result property="content"    column="content"    />
-        <result property="imgUrl"    column="img_url"    />
-        <result property="isTop"    column="is_top"    />
-        <result property="isBanner"    column="is_banner"    />
-        <result property="categoryId"    column="category_id"    />
-        <result property="categoryName"    column="category_name"    />
-        <result property="status"    column="status"    />
-        <result property="author"    column="author"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
-    </resultMap>
-
-    <sql id="selectNewsVo">
-        select news_id, title, img_url, is_top, is_banner, category_id, category_name, status, author, del_flag, create_by, create_time, update_by, update_time, remark from news
-    </sql>
-
-    <select id="selectNewsList" parameterType="com.gyjiot.iot.domain.News" resultMap="NewsResult">
-        select news_id, title, img_url, is_top, is_banner, category_id, category_name, status, author,
-               create_by, create_time, update_by, update_time, remark
-        from news s
-        <where>
-            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
-            <if test="categoryId != null "> and category_id = #{categoryId}</if>
-            <if test="isTop != null "> and is_top = #{isTop}</if>
-            <if test="isBanner != null "> and is_banner = #{isBanner}</if>
-            <if test="categoryName != null  and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
-            <if test="status != null "> and status = #{status}</if>
-        </where>
-        order by create_time desc
-    </select>
-
-    <select id="selectTopNewsList" parameterType="com.gyjiot.iot.domain.News" resultMap="NewsResult">
-        select n.news_id, n.title, n.img_url, n.is_top, n.is_banner, n.category_id, c.category_name, n.status, n.author, n.create_time, n.remark
-        from news n left join news_category c on c.category_id=n.category_id
-        where n.is_top=1 and n.status=1
-        order by n.create_time desc
-    </select>
-    
-    <select id="selectNewsByNewsId" parameterType="Long" resultMap="NewsResult">
-        select news_id, title, content, img_url, is_top, is_banner, category_id, category_name, status, author, del_flag, create_by, create_time, update_by, update_time, remark from news
-        where news_id = #{newsId}
-    </select>
-        
-    <insert id="insertNews" parameterType="com.gyjiot.iot.domain.News" useGeneratedKeys="true" keyProperty="newsId">
-        insert into news
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">title,</if>
-            <if test="content != null and content != ''">content,</if>
-            <if test="imgUrl != null and imgUrl != ''">img_url,</if>
-            <if test="isTop != null">is_top,</if>
-            <if test="isBanner != null">is_banner,</if>
-            <if test="categoryId != null">category_id,</if>
-            <if test="categoryName != null and categoryName != ''">category_name,</if>
-            <if test="status != null">status,</if>
-            <if test="author != null and author != ''">author,</if>
-            <if test="delFlag != null">del_flag,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="remark != null">remark,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="content != null and content != ''">#{content},</if>
-            <if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
-            <if test="isTop != null">#{isTop},</if>
-            <if test="isBanner != null">#{isBanner},</if>
-            <if test="categoryId != null">#{categoryId},</if>
-            <if test="categoryName != null and categoryName != ''">#{categoryName},</if>
-            <if test="status != null">#{status},</if>
-            <if test="author != null and author != ''">#{author},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="remark != null">#{remark},</if>
-         </trim>
-    </insert>
-
-    <update id="updateNews" parameterType="com.gyjiot.iot.domain.News">
-        update news
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="content != null and content != ''">content = #{content},</if>
-            <if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
-            <if test="isTop != null">is_top = #{isTop},</if>
-            <if test="isBanner != null">is_banner = #{isBanner},</if>
-            <if test="categoryId != null">category_id = #{categoryId},</if>
-            <if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="author != null and author != ''">author = #{author},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="remark != null">remark = #{remark},</if>
-        </trim>
-        where news_id = #{newsId}
-    </update>
-
-    <delete id="deleteNewsByNewsId" parameterType="Long">
-        delete from news where news_id = #{newsId}
-    </delete>
-
-    <delete id="deleteNewsByNewsIds" parameterType="String">
-        delete from news where news_id in 
-        <foreach item="newsId" collection="array" open="(" separator="," close=")">
-            #{newsId}
-        </foreach>
-    </delete>
-</mapper>