공유데이터 비식별화 - 마스킹

This commit is contained in:
박성은 2024-06-11 11:33:51 +09:00
parent 3cd62e2b8d
commit 093d74bd21
5 changed files with 40 additions and 0 deletions

View File

@ -80,4 +80,6 @@ public interface ComtrlsdataMapper {
int deleteComtrlsData(Map<String, Object> param) throws Exception;
void deIdentificationMasking(ComtrlsColVO vo) throws Exception;
}

View File

@ -63,4 +63,5 @@ public interface ComtrlsdataService {
ComtrlsSrcdataDTO selectComtrlsSrcData(ComtrlsSrcdataVO vo) throws Exception;
void deIdentificationMasking(ComtrlsColVO vo) throws Exception;
}

View File

@ -75,4 +75,9 @@ public class ComtrlsdataServiceImpl extends EgovAbstractServiceImpl implements C
.data(dataList)
.build();
}
@Override
public void deIdentificationMasking(ComtrlsColVO vo) throws Exception{
comtrlsdataMapper.deIdentificationMasking(vo);
}
}

View File

@ -163,4 +163,23 @@ public class ComtrlsdataController {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage());
}
}
/**
* 공유데이터 비식별화 - 마스킹
*
* @param comtrlsColVO
* @return
* @throws Exception
*/
@GetMapping(value="/deIdendtify/masking.do")
public ResponseEntity<?> deIdendtifyMasking(ComtrlsColVO comtrlsColVO) {
try{
comtrlsdataService.deIdentificationMasking(comtrlsColVO);
return ResponseEntity.ok().build();
} catch(Exception e){
log.error("Exception", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage());
}
}
}

View File

@ -107,4 +107,17 @@
WHERE RLS_DATA_ID = #{rlsDataId}
</select>
<update id="deIdentificationMasking" parameterType="ComtrlsColVO" >
<bind name="path" value="'{' + rlsDataColNm + '}'" />
UPDATE comtrlsdata
SET rls_data_vl = jsonb_set(
rls_data_vl,
${path},
to_jsonb(
LEFT(rls_data_vl ->> #{rlsDataColNm}, 1) || REPEAT('*', LENGTH(rls_data_vl ->> #{rlsDataColNm}) - 1)
)
)
WHERE rls_data_id = #{rlsDataId}
</update>
</mapper>