용어집 수정

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

View File

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

View File

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

View File

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