페이징 없앰
This commit is contained in:
parent
36f2559232
commit
d5f9e7242f
@ -14,7 +14,9 @@
|
||||
*************************************************************/
|
||||
package io.company.localhost.controller.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -54,10 +56,17 @@ public class worddictController {
|
||||
@Member
|
||||
@ParameterCheck
|
||||
@GetMapping("getWordList")
|
||||
public ApiResponse<PageInfo<MapDto>> getWordList(@ReqMap MapDto map) {
|
||||
PageInfo<MapDto> WordList = worddictyservice.getWordList(map);
|
||||
return ApiResponse.ok(WordList);
|
||||
public ApiResponse<MapDto> getWordList(@ReqMap MapDto map) {
|
||||
int total = worddictyservice.getTotal(map);
|
||||
List<MapDto> wordList = worddictyservice.getWordList(map);
|
||||
|
||||
MapDto OutData = new MapDto();
|
||||
OutData.put("total", total);
|
||||
OutData.put("data", wordList);
|
||||
|
||||
return ApiResponse.ok(OutData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 용어집 카테고리 목록
|
||||
* @param
|
||||
@ -105,6 +114,7 @@ public class worddictController {
|
||||
|
||||
//userId
|
||||
Long userId = AuthUtil.getUser().getId();
|
||||
String content = map.getString("content"); // content 추출
|
||||
//map.put("userId", userId);
|
||||
/////////로그인 미개발 ->임시
|
||||
map.put("userId", 1);
|
||||
@ -131,6 +141,4 @@ public class worddictController {
|
||||
|
||||
return ApiResponse.ok(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -31,6 +31,8 @@ public interface worddictyMapper {
|
||||
|
||||
MapDto getWordDetail(MapDto map);
|
||||
|
||||
int getTotal(MapDto map);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
package io.company.localhost.service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@ -31,10 +33,9 @@ public class worddictyService {
|
||||
|
||||
private final worddictyMapper worddictymapper;
|
||||
|
||||
public PageInfo<MapDto> getWordList(MapDto map) {
|
||||
int page = map.getString("page") != null ? Integer.parseInt(map.getString("page")) : 1;
|
||||
PageHelper.startPage(page, 10);
|
||||
return PageUtil.redefineNavigation(new PageInfo<>(worddictymapper.getWordList(map),10));
|
||||
public List<MapDto> getWordList(MapDto map) {
|
||||
|
||||
return (worddictymapper.getWordList(map));
|
||||
}
|
||||
|
||||
public Long insertWord(MapDto map) {
|
||||
@ -49,6 +50,10 @@ public class worddictyService {
|
||||
return worddictymapper.getWordDetail(map);
|
||||
}
|
||||
|
||||
public int getTotal(MapDto map) {
|
||||
return worddictymapper.getTotal(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,18 +1,7 @@
|
||||
<?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="io.company.localhost.mapper.worddictyMapper">
|
||||
<select id="getWordList" parameterType="map" resultType="Map">
|
||||
select
|
||||
w.*
|
||||
,c.CMNCODNAM category
|
||||
from
|
||||
worddicty w
|
||||
left join
|
||||
commoncod c
|
||||
on
|
||||
w.WRDDICCAT = c.CMNCODVAL
|
||||
where
|
||||
1=1
|
||||
<sql id="searchConditions">
|
||||
<!-- 검색어 조건 -->
|
||||
<if test="searchKeyword != null and searchKeyword != ''">
|
||||
and (w.WRDDICTTL like CONCAT('%', #{searchKeyword}, '%')
|
||||
@ -149,8 +138,27 @@
|
||||
<if test="category != null and category != ''">
|
||||
and w.WRDDICCAT = #{category}
|
||||
</if>
|
||||
</sql>
|
||||
<select id="getWordList" parameterType="map" resultType="Map">
|
||||
select
|
||||
w.*
|
||||
,c.CMNCODNAM category
|
||||
from
|
||||
worddicty w
|
||||
left join
|
||||
commoncod c
|
||||
on
|
||||
w.WRDDICCAT = c.CMNCODVAL
|
||||
where
|
||||
1=1
|
||||
<include refid="searchConditions"/>
|
||||
order by w.WRDDICRDT desc
|
||||
</select>
|
||||
<select id="getTotal" parameterType="map" >
|
||||
select count(*) from worddicty w
|
||||
where 1=1
|
||||
<include refid="searchConditions"/>
|
||||
</select>
|
||||
<insert id="insertWord" parameterType="map">
|
||||
insert into worddicty
|
||||
(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user