增加装修数据

This commit is contained in:
TinyAnts 2022-09-14 10:40:07 +08:00
parent 4113967539
commit 1596c077c4
19 changed files with 142 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -14,7 +14,7 @@ import java.util.Map;
/**
* 页面装修管理
*/
@RestController
@RestController("decoratePagesController")
@RequestMapping("api/decorate/pages")
public class PagesController {

View File

@ -12,7 +12,7 @@ import java.util.Map;
/**
* 装修底部导航管理
*/
@RestController
@RestController("decorateTabbarController")
@RequestMapping("api/decorate/tabbar")
public class TabbarController {

View File

@ -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);
}

View File

@ -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;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -267,6 +267,28 @@ CREATE TABLE `la_notice_setting` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息通知设置表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for la_official_reply
-- ----------------------------
DROP TABLE IF EXISTS `la_official_reply`;
CREATE TABLE `la_official_reply` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '规则名',
`keyword` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '关键词',
`reply_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复类型: [1=关注回复 2=关键字回复, 3=默认回复]',
`matching_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '匹配方式: [1=全匹配, 2=模糊匹配]',
`content_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '内容类型: [1=文本]',
`status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '启动状态: [1=启动, 0=关闭]',
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '回复内容',
`sort` int(11) UNSIGNED NOT NULL DEFAULT 50 COMMENT '排序编号',
`is_delete` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除',
`create_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '公众号的回复表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for la_system_auth_admin
-- ----------------------------
@ -499,7 +521,7 @@ SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
BEGIN;
INSERT INTO `la_system_auth_dept` VALUES (1, 0, '默认部门', '康明', '18327647788', 10, 0, 0, 1649841995, 1660190949, 0);
INSERT INTO `la_system_auth_admin` VALUES (1, 1, 0, 'admin', 'admin', '7fac2474740becfaf1ecbdd6cc8fb076', '/api/static/backend_avatar.jpg', '0', '5Xar0', 0, 1, 0, 0, '127.0.0.1', 1660641347, 1642321599, 1660287325, 0);
INSERT INTO `la_system_auth_admin` VALUES (1, 1, 0, 'admin', 'admin', '7fac2474740becfaf1ecbdd6cc8fb076', '/api/static/backend_avatar.png', '0', '5Xar0', 0, 1, 0, 0, '127.0.0.1', 1660641347, 1642321599, 1660287325, 0);
COMMIT;
BEGIN;
@ -542,6 +564,7 @@ INSERT INTO `la_system_config` VALUES (60, 'oa_channel', 'url', '', 1660620367,
INSERT INTO `la_system_config` VALUES (61, 'oa_channel', 'token', '', 1660620367, 1662551337);
INSERT INTO `la_system_config` VALUES (62, 'oa_channel', 'encodingAesKey', '', 1660620367, 1662551337);
INSERT INTO `la_system_config` VALUES (63, 'oa_channel', 'encryptionType', '1', 1660620367, 1662551337);
INSERT INTO `la_system_config` VALUES (64, 'oa_channel', 'menus', '[]', 1631255140, 1663118712);
INSERT INTO `la_system_config` VALUES (70, 'login', 'loginWay', '1,2', 1660620367, 1662538771);
INSERT INTO `la_system_config` VALUES (71, 'login', 'forceBindMobile', '1', 1660620367, 1662538771);
INSERT INTO `la_system_config` VALUES (72, 'login', 'openAgreement', '1', 1660620367, 1662538771);
@ -565,7 +588,7 @@ COMMIT;
BEGIN;
INSERT INTO `la_decorate_page` VALUES (1, 1, '商城首页', '[{\"title\":\"搜索\",\"name\":\"search\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"首页轮播图\",\"name\":\"banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"\",\"link\":{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"导航菜单\",\"name\":\"nav\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"导航\",\"link\":{}}]},\"styles\":{}}]', 1661757188, 1662686916);
INSERT INTO `la_decorate_page` VALUES (2, 2, '个人中心', '[{\"title\":\"用户信息\",\"name\":\"user-info\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"我的服务\",\"name\":\"my-service\",\"content\":{\"style\":1,\"title\":\"我的服务\",\"data\":[{\"image\":\"\",\"name\":\"我的收藏\",\"link\":{}},{\"image\":\"\",\"name\":\"个人设置\",\"link\":{}},{\"image\":\"\",\"name\":\"联系客服\",\"link\":{}}]},\"styles\":{}},{\"title\":\"个人中心广告图\",\"name\":\"user-banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"\",\"link\":{}}]},\"styles\":{}}]', 1661757188, 1662688732);
INSERT INTO `la_decorate_page` VALUES (2, 2, '个人中心', '[{\"title\":\"用户信息\",\"name\":\"user-info\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"我的服务\",\"name\":\"my-service\",\"content\":{\"style\":1,\"title\":\"服务中心\",\"data\":[{\"image\":\"/api/static/user_collect.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"/api/static/user_setting.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"/api/static/user_kefu.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"个人中心广告图\",\"name\":\"user-banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"\",\"link\":{}}]},\"styles\":{}}]', 1661757188, 1661757188);
INSERT INTO `la_decorate_page` VALUES (3, 3, '客服设置', '[{\"title\":\"客服设置\",\"name\":\"customer-service\",\"content\":{\"title\":\"添加客服二维码\",\"time\":\"早上 9:00 - 22:00\",\"mobile\":\"13800138000\",\"qrcode\":\"\"},\"styles\":{}}]', 1661757188, 1662689155);
COMMIT;