용어집 수정

This commit is contained in:
khj0414 2025-02-07 14:01:57 +09:00
parent 019300e662
commit 275fe94c5a
4 changed files with 16 additions and 18 deletions

View File

@ -53,8 +53,8 @@ public class worddictController {
@ParameterCheck
@GetMapping("getWordList")
public ApiResponse<MapDto> getWordList(@ReqMap MapDto map) {
int total = worddictyservice.getTotal(map);
int total = worddictyservice.getTotal(map);
List<MapDto> wordList = worddictyservice.getWordList(map);
MapDto OutData = new MapDto();
@ -109,10 +109,8 @@ public class worddictController {
public ApiResponse<Long> insertWord(@AuthenticationPrincipal MemberVo memberVo,@ReqMap MapDto map) {
//userId
//Long userId = AuthUtil.getUser().getId();
//map.put("userId", userId);
/////////로그인 미개발 ->임시
map.put("userId", 1);
Long userId = AuthUtil.getUser().getId();
map.put("userId", userId);
Long result = worddictyservice.insertWord(map);
return ApiResponse.ok(result);
@ -129,9 +127,7 @@ public class worddictController {
//userId
Long userId = AuthUtil.getUser().getId();
//map.put("userId", userId);
////////로그인 미개발 ->임시
map.put("userId", 1);
map.put("userId", userId);
Long result = worddictyservice.updateWord(map);
return ApiResponse.ok(result);

View File

@ -24,7 +24,7 @@ import io.company.localhost.common.dto.MapDto;
@Mapper
public interface worddictyMapper {
List<MapDto> getWordList(Map<String, Object> map);
List<MapDto> getWordList(MapDto map);
Long insertWord(MapDto map);

View File

@ -32,19 +32,19 @@ public class worddictyService {
private final worddictyMapper worddictymapper;
public List<Map<String, Object>> getWordList(Map<String, Object> map) {
public List<MapDto> getWordList(MapDto map) {
List<MapDto> wordList = worddictymapper.getWordList(map);
List<Map<String, Object>> processedList = new ArrayList<>();
List<MapDto> processedList = new ArrayList<>();
//데이터 가공
for (Map<String, Object> dto : wordList) {
Map<String, Object> author = new HashMap<>();
// 데이터 가공
for (MapDto dto : wordList) {
MapDto author = new MapDto();
author.put("profileImage", dto.remove("REGPRF"));
author.put("name", dto.remove("REGNAME"));
author.put("color", dto.remove("REGCOLOR"));
author.put("createdAt", dto.remove("REGRDT"));
Map<String, Object> lastEditor = new HashMap<>();
MapDto lastEditor = new MapDto();
lastEditor.put("profileImage", dto.remove("UPDPRF"));
lastEditor.put("name", dto.remove("UPDNAME"));
lastEditor.put("color", dto.remove("UPDCOLOR"));
@ -53,7 +53,9 @@ public class worddictyService {
dto.put("author", author);
dto.put("lastEditor", lastEditor);
processedList.add(dto);
MapDto processedDto = new MapDto();
processedDto.putAll(dto);
processedList.add(processedDto);
}
return processedList;
}

View File

@ -139,7 +139,7 @@
and w.WRDDICCAT = #{category}
</if>
</sql>
<select id="getWordList" parameterType="map" resultType="Map">
<select id="getWordList" parameterType="map" resultType="io.company.localhost.common.dto.MapDto">
select
w.WRDDICSEQ,
w.WRDDICCAT,