diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/test/controller/MongdbApplicationTests.java b/ruoyi-admin/src/main/java/com/ruoyi/web/test/controller/MongdbApplicationTests.java index 2250bb13a..7ae5007ca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/test/controller/MongdbApplicationTests.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/test/controller/MongdbApplicationTests.java @@ -5,7 +5,7 @@ import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.note.domain.NoteContentMgDb; import com.ruoyi.note.service.INoteRepositoryService; -import org.bson.types.ObjectId; +//import org.bson.types.ObjectId; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -36,43 +36,43 @@ public class MongdbApplicationTests extends BaseSpringBootTest{ /** * 查询所有信息 */ - @Test - public void findAll() { - List all = noteRepositoryService.findAll(); - System.out.println(all.size()); - } +// @Test +// public void findAll() { +// List all = noteRepositoryService.findAll(); +// System.out.println(all.size()); +// } /** * 新增信息 */ - @Test - public void save() { - NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); - noteContentMgDb.setId(15108230363503104L); - noteContentMgDb.setNoteContent("宋人头"); - noteRepositoryService.save(noteContentMgDb); - } +// @Test +// public void save() { +// NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); +// noteContentMgDb.setId(15108230363503104L); +// noteContentMgDb.setNoteContent("宋人头"); +// noteRepositoryService.save(noteContentMgDb); +// } /** * 修改信息 */ - @Test - public void update() { - NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); -// noteContentMgDb.setId(2L); - noteContentMgDb.setNoteContent("吴很帅"); - noteRepositoryService.update(noteContentMgDb); - } +// @Test +// public void update() { +// NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); +//// noteContentMgDb.setId(2L); +// noteContentMgDb.setNoteContent("吴很帅"); +// noteRepositoryService.update(noteContentMgDb); +// } /** * 删除信息 */ - @Test - public void delete() { - noteRepositoryService.delete(3); - } - +// @Test +// public void delete() { +// noteRepositoryService.delete(3); +// } +// @@ -102,37 +102,37 @@ public class MongdbApplicationTests extends BaseSpringBootTest{ * @param * @return */ - @Test - public void redisToMgDB(){ - //模糊查询 获取所有的key - Collection listNote= redisCache.keys(Constants.NM_NOTE_CONTENT+"*"); - for(String str:listNote){ - //文章UUID - String mgDbContentUUID=str.replace(Constants.NM_NOTE_CONTENT,""); - System.out.println("str:"+str); - //文章 - String redisContent= redisCache.getCacheObject(str).toString(); - //查询mongoDb 存在就修改 不存在就新增 - List listMgDbContent = noteRepositoryService.findById(mgDbContentUUID); - if (listMgDbContent!=null&&!listMgDbContent.isEmpty()){ - //修改 - NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); - noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); - noteContentMgDb.setNoteContent(redisContent); - noteRepositoryService.update(noteContentMgDb); - }else { - //新增 - NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); - noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); - noteContentMgDb.setNoteContent(redisContent); - noteRepositoryService.save(noteContentMgDb); - } - //删除对应缓存 - //redisCache.deleteObject(str); - } - - - } +// @Test +// public void redisToMgDB(){ +// //模糊查询 获取所有的key +// Collection listNote= redisCache.keys(Constants.NM_NOTE_CONTENT+"*"); +// for(String str:listNote){ +// //文章UUID +// String mgDbContentUUID=str.replace(Constants.NM_NOTE_CONTENT,""); +// System.out.println("str:"+str); +// //文章 +// String redisContent= redisCache.getCacheObject(str).toString(); +// //查询mongoDb 存在就修改 不存在就新增 +// List listMgDbContent = noteRepositoryService.findById(mgDbContentUUID); +// if (listMgDbContent!=null&&!listMgDbContent.isEmpty()){ +// //修改 +// NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); +// noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); +// noteContentMgDb.setNoteContent(redisContent); +// noteRepositoryService.update(noteContentMgDb); +// }else { +// //新增 +// NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); +// noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); +// noteContentMgDb.setNoteContent(redisContent); +// noteRepositoryService.save(noteContentMgDb); +// } +// //删除对应缓存 +// //redisCache.deleteObject(str); +// } +// +// +// } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 4a444ea15..869692ebe 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -58,9 +58,9 @@ spring: #mongodb - data: - mongodb: - uri: mongodb://localhost:27017/ChangQuYun +# data: +# mongodb: +# uri: mongodb://localhost:27017/ChangQuYun #设置了密码 # spring.data.mongodb.uri=mongodb://admin:123456@192.168.56.128:27017/admin #格式: mongodb://账号:密码@ip:端口/数据库?认证数据库 diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 4547b25ee..38cbddc5b 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -161,12 +161,12 @@ lombok 1.18.12 - - - org.springframework.boot - spring-boot-starter-data-mongodb - 2.3.4.RELEASE - + + + + + + diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/domain/NoteContentMgDb.java b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NoteContentMgDb.java index d99beaf34..c8c01c152 100644 --- a/ruoyi-note/src/main/java/com/ruoyi/note/domain/NoteContentMgDb.java +++ b/ruoyi-note/src/main/java/com/ruoyi/note/domain/NoteContentMgDb.java @@ -1,6 +1,6 @@ package com.ruoyi.note.domain; -import org.springframework.data.mongodb.core.mapping.Document; +//import org.springframework.data.mongodb.core.mapping.Document; import javax.persistence.Id; import java.io.Serializable; @@ -10,7 +10,7 @@ import java.io.Serializable; * @Date: 2020/10/08 19:07 * 功能描述: */ -@Document(collection = "NoteContent") +//@Document(collection = "NoteContent") public class NoteContentMgDb implements Serializable { @Id diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/INoteRepositoryService.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/INoteRepositoryService.java index 43d444c68..4f754061a 100644 --- a/ruoyi-note/src/main/java/com/ruoyi/note/service/INoteRepositoryService.java +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/INoteRepositoryService.java @@ -1,10 +1,10 @@ package com.ruoyi.note.service; -import com.mongodb.client.MongoCollection; -import com.mongodb.client.model.Filters; +//import com.mongodb.client.MongoCollection; +//import com.mongodb.client.model.Filters; import com.ruoyi.note.domain.NoteContentMgDb; import com.sun.corba.se.spi.ior.ObjectId; -import org.springframework.data.mongodb.core.mapping.Document; +//import org.springframework.data.mongodb.core.mapping.Document; import java.util.List; @@ -15,14 +15,14 @@ import java.util.List; */ public interface INoteRepositoryService { - void save(NoteContentMgDb noteContentMgDb); - - void update(NoteContentMgDb noteContentMgDb); - - List findAll(); - - void delete(Integer id); - - //根据id查询 - List findById(String id); +// void save(NoteContentMgDb noteContentMgDb); +// +// void update(NoteContentMgDb noteContentMgDb); +// +// List findAll(); +// +// void delete(Integer id); +// +// //根据id查询 +// List findById(String id); } diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java index 542e76b1e..c6e3cfc7a 100644 --- a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NmNoteServiceImpl.java @@ -6,10 +6,10 @@ import java.util.Map; import cn.hutool.core.date.DateUtil; import com.github.wujun234.uid.UidGenerator; -import com.mongodb.BasicDBObject; -import com.mongodb.DBObject; -import com.mongodb.client.MongoCollection; -import com.mongodb.client.MongoCursor; +//import com.mongodb.BasicDBObject; +//import com.mongodb.DBObject; +//import com.mongodb.client.MongoCollection; +//import com.mongodb.client.MongoCursor; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; @@ -18,7 +18,7 @@ import com.ruoyi.note.domain.NoteContentMgDb; import com.ruoyi.note.service.INmNoteContentService; import com.ruoyi.note.service.INoteRepositoryService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.mongodb.core.mapping.Document; +//import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.stereotype.Service; import com.ruoyi.note.mapper.NmNoteMapper; import com.ruoyi.note.domain.NmNote; @@ -167,31 +167,31 @@ public class NmNoteServiceImpl implements INmNoteService { */ @Override public void redisToMongonDB() { - //模糊查询 获取所有的key - Collection listNote= redisCache.keys(Constants.NM_NOTE_CONTENT+"*"); - for(String str:listNote){ - //文章UUID - String mgDbContentUUID=str.replace(Constants.NM_NOTE_CONTENT,""); - //文章 - String redisContent= redisCache.getCacheObject(str).toString(); - //查询mongoDb 存在就修改 不存在就新增 - List listMgDbContent = noteRepositoryService.findById(mgDbContentUUID); - if (listMgDbContent!=null&&!listMgDbContent.isEmpty()){ - //修改 - NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); - noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); - noteContentMgDb.setNoteContent(redisContent); - noteRepositoryService.update(noteContentMgDb); - }else { - //新增 - NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); - noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); - noteContentMgDb.setNoteContent(redisContent); - noteRepositoryService.save(noteContentMgDb); - } - //删除对应缓存 - redisCache.deleteObject(str); - } +// //模糊查询 获取所有的key +// Collection listNote= redisCache.keys(Constants.NM_NOTE_CONTENT+"*"); +// for(String str:listNote){ +// //文章UUID +// String mgDbContentUUID=str.replace(Constants.NM_NOTE_CONTENT,""); +// //文章 +// String redisContent= redisCache.getCacheObject(str).toString(); +// //查询mongoDb 存在就修改 不存在就新增 +// List listMgDbContent = noteRepositoryService.findById(mgDbContentUUID); +// if (listMgDbContent!=null&&!listMgDbContent.isEmpty()){ +// //修改 +// NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); +// noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); +// noteContentMgDb.setNoteContent(redisContent); +// noteRepositoryService.update(noteContentMgDb); +// }else { +// //新增 +// NoteContentMgDb noteContentMgDb = new NoteContentMgDb(); +// noteContentMgDb.setId(Long.valueOf(mgDbContentUUID)); +// noteContentMgDb.setNoteContent(redisContent); +// noteRepositoryService.save(noteContentMgDb); +// } +// //删除对应缓存 +// redisCache.deleteObject(str); +// } } diff --git a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NoteRepositoryServiceImpl.java b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NoteRepositoryServiceImpl.java index a8c8b2b3b..5f9c18793 100644 --- a/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NoteRepositoryServiceImpl.java +++ b/ruoyi-note/src/main/java/com/ruoyi/note/service/impl/NoteRepositoryServiceImpl.java @@ -1,18 +1,18 @@ package com.ruoyi.note.service.impl; -import com.mongodb.client.MongoCollection; -import com.mongodb.client.model.Filters; +//import com.mongodb.client.MongoCollection; +//import com.mongodb.client.model.Filters; import com.ruoyi.note.domain.NoteContentMgDb; import com.ruoyi.note.service.INoteRepositoryService; -import org.bson.types.ObjectId; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.mapping.Document; -import org.springframework.data.mongodb.core.query.Criteria; -import org.springframework.data.mongodb.core.query.Query; -import org.springframework.data.mongodb.core.query.Update; +//import org.bson.types.ObjectId; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.data.mongodb.core.MongoTemplate; +//import org.springframework.data.mongodb.core.mapping.Document; +//import org.springframework.data.mongodb.core.query.Criteria; +//import org.springframework.data.mongodb.core.query.Query; +//import org.springframework.data.mongodb.core.query.Update; import org.springframework.stereotype.Service; import java.util.List; @@ -25,64 +25,64 @@ import java.util.List; @Service public class NoteRepositoryServiceImpl implements INoteRepositoryService { - @Autowired - private MongoTemplate mongoTemplate; - - - - /** - * 新增信息 - * @param student - */ - @Override - public void save(NoteContentMgDb student) { - mongoTemplate.save(student); - } - - /** - * 修改信息 - * @param noteContentMgDb - */ - @Override - public void update(NoteContentMgDb noteContentMgDb) { - //修改的条件 - Query query = new Query(Criteria.where("id").is(noteContentMgDb.getId())); - - //修改的内容 - Update update = new Update(); - update.set("name", noteContentMgDb.getNoteContent()); - - mongoTemplate.updateFirst(query,update, NoteContentMgDb.class); - } - - /** - * 查询所有信息 - * @return - */ - @Override - public List findAll() { - return mongoTemplate.findAll(NoteContentMgDb.class); - } - - /** - * 根据id查询所有信息 - * @param id - */ - @Override - public void delete(Integer id) { - NoteContentMgDb byId = mongoTemplate.findById(1, NoteContentMgDb.class); - mongoTemplate.remove(byId); - } - - - - @Override - public List findById(String id) { - //修改的条件 - Query query = new Query(Criteria.where("_id").is(Long.valueOf(id))); - //修改的内容 - return mongoTemplate.find(query, NoteContentMgDb.class); - } +// @Autowired +// private MongoTemplate mongoTemplate; +// +// +// +// /** +// * 新增信息 +// * @param student +// */ +// @Override +// public void save(NoteContentMgDb student) { +// mongoTemplate.save(student); +// } +// +// /** +// * 修改信息 +// * @param noteContentMgDb +// */ +// @Override +// public void update(NoteContentMgDb noteContentMgDb) { +// //修改的条件 +// Query query = new Query(Criteria.where("id").is(noteContentMgDb.getId())); +// +// //修改的内容 +// Update update = new Update(); +// update.set("name", noteContentMgDb.getNoteContent()); +// +// mongoTemplate.updateFirst(query,update, NoteContentMgDb.class); +// } +// +// /** +// * 查询所有信息 +// * @return +// */ +// @Override +// public List findAll() { +// return mongoTemplate.findAll(NoteContentMgDb.class); +// } +// +// /** +// * 根据id查询所有信息 +// * @param id +// */ +// @Override +// public void delete(Integer id) { +// NoteContentMgDb byId = mongoTemplate.findById(1, NoteContentMgDb.class); +// mongoTemplate.remove(byId); +// } +// +// +// +// @Override +// public List findById(String id) { +// //修改的条件 +// Query query = new Query(Criteria.where("_id").is(Long.valueOf(id))); +// //修改的内容 +// return mongoTemplate.find(query, NoteContentMgDb.class); +// } } diff --git a/ruoyi-ui/src/assets/styles/base.css b/ruoyi-ui/src/assets/styles/base.css index 98e43bedb..1e08a2e9c 100644 --- a/ruoyi-ui/src/assets/styles/base.css +++ b/ruoyi-ui/src/assets/styles/base.css @@ -8,6 +8,7 @@ font-size: 22px!important; } + } @@ -20,6 +21,11 @@ .sousouright-icon{ margin-right: 18px; } + + /*个人中心的导航点击*/ + .head-tag-button{ + width: 60%!important; + } } /* >>> md*/ @@ -43,6 +49,11 @@ /* ipad >>> xs*/ @media screen and (max-width: 768px) { + /*个人中心的导航点击*/ + .head-tag-button{ + width: 95%!important; + } + .transition-box{ display: none; } diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 160d40bd1..81d0aeaf2 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -63,23 +63,62 @@ export const constantRoutes = [ children:[ { path: '/bkindex', - component: resolve => require(['../views/system/user/profile/bkindex.vue'], resolve), + component: resolve => require(['../views/bookmark/bkuser/tool/bkindex.vue'], resolve), hidden: true, meta:{ title: '个人中心',icon:'user', requireAuth: true,//加该字段,表示进入这个路由是需要登录的true }, - } - , + }, { path: '/importHtml', name: 'importHtml', - component: resolve => require(['../views/bookmark/common/ImportHtml.vue'], resolve), + component: resolve => require(['../views/bookmark/bkuser/tool/ImportHtml.vue'], resolve), hidden: true, meta:{ title: '导入书签',icon:'user', requireAuth: true,//加该字段,表示进入这个路由是需要登录的true }, + }, + { + path: '/issueLog', + name: 'issueLog', + component: resolve => require(['../views/bookmark/bkuser/tool/issueLog.vue'], resolve), + hidden: true, + meta:{ + title: '更新日志',icon:'user', + requireAuth: true,//加该字段,表示进入这个路由是需要登录的true + }, + }, + { + path: '/aboutUs', + name: 'aboutUs', + component: resolve => require(['../views/bookmark/bkuser/tool/aboutUs.vue'], resolve), + hidden: true, + meta:{ + title: '导入书签',icon:'user', + requireAuth: true,//加该字段,表示进入这个路由是需要登录的true + }, + }, + { + path: '/exportHtml', + name: 'exportHtml', + component: resolve => require(['../views/bookmark/bkuser/tool/exportHtml.vue'], resolve), + hidden: true, + meta:{ + title: '备份导出',icon:'user', + requireAuth: true,//加该字段,表示进入这个路由是需要登录的true + }, + }, + { + path: '/userSettings', + name: 'userSettings', + component: resolve => require(['../views/bookmark/bkuser/tool/userSettings.vue'], resolve), + hidden: true, + meta:{ + title: '用户系统设置',icon:'user', + requireAuth: true,//加该字段,表示进入这个路由是需要登录的true + }, } ] diff --git a/ruoyi-ui/src/views/bookmark/bkuser/index.vue b/ruoyi-ui/src/views/bookmark/bkuser/index.vue index 49e884784..1cce69caf 100644 --- a/ruoyi-ui/src/views/bookmark/bkuser/index.vue +++ b/ruoyi-ui/src/views/bookmark/bkuser/index.vue @@ -4,7 +4,7 @@
- +
@@ -17,15 +17,14 @@
- - - - - - + + + + + + + +
@@ -43,25 +42,79 @@ + diff --git a/ruoyi-ui/src/views/system/user/profile/bkindex.vue b/ruoyi-ui/src/views/bookmark/bkuser/tool/bkindex.vue similarity index 68% rename from ruoyi-ui/src/views/system/user/profile/bkindex.vue rename to ruoyi-ui/src/views/bookmark/bkuser/tool/bkindex.vue index b1042de29..149d8a0be 100644 --- a/ruoyi-ui/src/views/system/user/profile/bkindex.vue +++ b/ruoyi-ui/src/views/bookmark/bkuser/tool/bkindex.vue @@ -16,25 +16,33 @@
{{ user.userName }}
  • - 手机号码 + 绑定手机
    {{ user.phonenumber }}
  • - 用户邮箱 + 绑定邮箱
    {{ user.email }}
  • - 所属部门 -
    {{ user.dept.deptName }} / {{ postGroup }}
    -
  • -
  • - 所属角色 + 身份角色
    {{ roleGroup }}
  • - 创建日期 + 注册日期
    {{ user.createTime }}
  • + + + + + + + + + + + +
    @@ -59,9 +67,9 @@ + diff --git a/ruoyi-ui/src/views/bookmark/bkuser/tool/issueLog.vue b/ruoyi-ui/src/views/bookmark/bkuser/tool/issueLog.vue new file mode 100644 index 000000000..ab3d3b5c9 --- /dev/null +++ b/ruoyi-ui/src/views/bookmark/bkuser/tool/issueLog.vue @@ -0,0 +1,67 @@ + + + diff --git a/ruoyi-ui/src/views/bookmark/bkuser/tool/userSettings.vue b/ruoyi-ui/src/views/bookmark/bkuser/tool/userSettings.vue new file mode 100644 index 000000000..7ba2a34a7 --- /dev/null +++ b/ruoyi-ui/src/views/bookmark/bkuser/tool/userSettings.vue @@ -0,0 +1,33 @@ + + + diff --git a/ruoyi-ui/src/views/bookmark/bookmark/index.vue b/ruoyi-ui/src/views/bookmark/bookmark/index.vue index 70daf563f..128433e88 100644 --- a/ruoyi-ui/src/views/bookmark/bookmark/index.vue +++ b/ruoyi-ui/src/views/bookmark/bookmark/index.vue @@ -37,6 +37,7 @@
    + @@ -225,6 +226,7 @@