增加装修数据
@@ -0,0 +1,37 @@
|
||||
package com.mdd.admin.controller.decorate;
|
||||
|
||||
import com.mdd.admin.service.decorate.IDecorateDataService;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 装修数据管理
|
||||
*/
|
||||
@RestController("decorateDataController")
|
||||
@RequestMapping("api/decorate/data")
|
||||
public class DataController {
|
||||
|
||||
@Resource
|
||||
IDecorateDataService iDecorateDataService;
|
||||
|
||||
/**
|
||||
* 获取文章数据
|
||||
*
|
||||
* @author fzr
|
||||
* @param limit 条数
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/article")
|
||||
public Object article(@RequestParam(defaultValue = "10") Integer limit) {
|
||||
List<Map<String, Object>> list = iDecorateDataService.article(limit);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 页面装修管理
|
||||
*/
|
||||
@RestController
|
||||
@RestController("decoratePagesController")
|
||||
@RequestMapping("api/decorate/pages")
|
||||
public class PagesController {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 装修底部导航管理
|
||||
*/
|
||||
@RestController
|
||||
@RestController("decorateTabbarController")
|
||||
@RequestMapping("api/decorate/tabbar")
|
||||
public class TabbarController {
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mdd.admin.service.decorate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 装修数据服务接口类
|
||||
*/
|
||||
public interface IDecorateDataService {
|
||||
|
||||
/**
|
||||
* 获取文章数据
|
||||
*
|
||||
* @author fzr
|
||||
* @param limit 条数
|
||||
* @return List<Map<String, Object>>
|
||||
*/
|
||||
List<Map<String, Object>> article(Integer limit);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mdd.admin.service.decorate.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mdd.admin.service.decorate.IDecorateDataService;
|
||||
import com.mdd.common.entity.article.Article;
|
||||
import com.mdd.common.mapper.article.ArticleMapper;
|
||||
import com.mdd.common.utils.TimeUtil;
|
||||
import com.mdd.common.utils.UrlUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 装修数据服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class DecorateDataServiceImpl implements IDecorateDataService {
|
||||
|
||||
@Resource
|
||||
ArticleMapper articleMapper;
|
||||
|
||||
/**
|
||||
* 获取文章数据
|
||||
*
|
||||
* @author fzr
|
||||
* @param limit 条数
|
||||
* @return List<Map<String, Object>>
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> article(Integer limit) {
|
||||
List<Map<String, Object>> articleList = new LinkedList<>();
|
||||
List<Article> articles = articleMapper.selectList(new QueryWrapper<Article>()
|
||||
.eq("is_show", 1)
|
||||
.eq("is_delete", 0)
|
||||
.orderByDesc("id")
|
||||
.last("limit 20"));
|
||||
|
||||
for (Article article : articles) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("id", article.getId());
|
||||
map.put("title", article.getTitle());
|
||||
map.put("intro", article.getIntro());
|
||||
map.put("summary", article.getSummary());
|
||||
map.put("image", UrlUtil.toAbsoluteUrl(article.getImage()));
|
||||
map.put("author", article.getAuthor());
|
||||
map.put("visit", article.getVisit());
|
||||
map.put("content", article.getContent());
|
||||
map.put("createTime", TimeUtil.timestampToDate(article.getCreateTime()));
|
||||
articleList.add(map);
|
||||
}
|
||||
|
||||
return articleList;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 84 KiB |
BIN
server/like-admin/src/main/resources/static/backend_avatar.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.6 KiB |
BIN
server/like-admin/src/main/resources/static/user_about.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
server/like-admin/src/main/resources/static/user_collect.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
server/like-admin/src/main/resources/static/user_kefu.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
server/like-admin/src/main/resources/static/user_setting.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |