标签管理
This commit is contained in:
@ -181,7 +181,8 @@ public class SqBookmarkController extends BaseController
|
||||
public AjaxResult add(@RequestBody SqBookmark sqBookmark)
|
||||
{
|
||||
sqBookmark.setUserid(getAuthUser().getUserId());
|
||||
return toAjax(sqBookmarkService.insertSqBookmark(sqBookmark));
|
||||
int i = sqBookmarkService.insertSqBookmark(sqBookmark);
|
||||
return new AjaxResult(200,(i>0&&i!=999)?"success":"repetition");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,6 +37,40 @@ public class SqTagController extends BaseController
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有的书签TAG 并且翻页
|
||||
*/
|
||||
@GetMapping("/listByUser")
|
||||
public TableDataInfo listByUser()
|
||||
{
|
||||
startPage();
|
||||
List<SqTag> list = sqTagService.selectSqTagList(new SqTag(getAuthUser().getUserId()));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模糊查书签TAG
|
||||
*/
|
||||
@GetMapping("/listByUserLike")
|
||||
public TableDataInfo listByUserLike()
|
||||
{
|
||||
startPage();
|
||||
List<SqTag> list = sqTagService.selectSqTagList(new SqTag(getAuthUser().getUserId()));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 以下是系统管理员的操作
|
||||
|
||||
|
||||
/**
|
||||
* 查询书签_标签列表
|
||||
|
@ -174,16 +174,6 @@ public class SqBookmarkTest extends BaseSpringBootTest{
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private HttpSession getLoginSession() throws Exception{
|
||||
// mock request get login session
|
||||
// url = /xxx/xxx/{username}/{password}
|
||||
MvcResult result = this.mockMvc
|
||||
.perform((MockMvcRequestBuilders.post("/login")))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andReturn();
|
||||
return result.getRequest().getSession();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -15,8 +15,12 @@ import org.junit.Test;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.omg.PortableServer.THREAD_POLICY_ID;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.web.servlet.MvcResult;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -38,10 +42,19 @@ public class SqMenuTest extends BaseSpringBootTest{
|
||||
SqBookmarkMapper sqBookmarkMapper;
|
||||
@Autowired
|
||||
SqlSessionTemplate sqlSessionTemplate;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void addMenuUplinkSeries() {
|
||||
|
||||
|
||||
List<com.ruoyi.bookmark.domain.SqMenu> sqMenus = sqMenuMapper.selectbymenuUplinkSeries();
|
||||
if (null!=sqMenus&&!sqMenus.isEmpty()) {
|
||||
for (com.ruoyi.bookmark.domain.SqMenu s:sqMenus) {
|
||||
@ -88,6 +101,11 @@ public class SqMenuTest extends BaseSpringBootTest{
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test67(){
|
||||
iSqBookmarkService.bookmarkDeleteRepetition(1L);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化是否有下级目录 subordinate 0无下级 1有下级
|
||||
|
Reference in New Issue
Block a user