← back to dong1512124123__YumiClass

Function bodies 261 total

All specs Real LLM only Function bodies
create method · java · L54-L65 (12 LOC)
src/main/java/com/yumi/yumiclass/service/StudentService.java
    public Student create(Student student, String rawPassword) {
        // 학번/아이디 중복 체크
        if (studentRepository.existsByStudentNumber(student.getStudentNumber())) {
            throw new IllegalArgumentException("이미 등록된 학번입니다: " + student.getStudentNumber());
        }
        if (studentRepository.existsByUsername(student.getUsername())) {
            throw new IllegalArgumentException("이미 사용 중인 아이디입니다: " + student.getUsername());
        }
        // 비밀번호 암호화
        student.setPassword(passwordEncoder.encode(rawPassword));
        return studentRepository.save(student);
    }
update method · java · L72-L96 (25 LOC)
src/main/java/com/yumi/yumiclass/service/StudentService.java
    public Student update(Long id, Student updated, String rawPassword) {
        Student existing = findById(id);
        // 학번 변경 시 중복 체크
        if (!existing.getStudentNumber().equals(updated.getStudentNumber())
                && studentRepository.existsByStudentNumber(updated.getStudentNumber())) {
            throw new IllegalArgumentException("이미 등록된 학번입니다: " + updated.getStudentNumber());
        }
        // 아이디 변경 시 중복 체크
        if (!existing.getUsername().equals(updated.getUsername())
                && studentRepository.existsByUsername(updated.getUsername())) {
            throw new IllegalArgumentException("이미 사용 중인 아이디입니다: " + updated.getUsername());
        }
        existing.setStudentNumber(updated.getStudentNumber());
        existing.setUsername(updated.getUsername());
        existing.setName(updated.getName());
        existing.setGrade(updated.getGrade());
        existing.setClassNum(updated.getClassNum());
        existing.setNumber(updated.getNumber());
    
delete method · java · L103-L106 (4 LOC)
src/main/java/com/yumi/yumiclass/service/StudentService.java
    public void delete(Long id) {
        Student student = findById(id);
        student.setEnabled(false);
    }
countAll method · java · L109-L111 (3 LOC)
src/main/java/com/yumi/yumiclass/service/StudentService.java
    public long countAll() {
        return studentRepository.count();
    }
YumiClassApplication class · java · L11-L17 (7 LOC)
src/main/java/com/yumi/yumiclass/YumiClassApplication.java
public class YumiClassApplication {

    public static void main(String[] args) {
        // Spring Boot 애플리케이션 시작
        SpringApplication.run(YumiClassApplication.class, args);
    }
}
main method · java · L13-L16 (4 LOC)
src/main/java/com/yumi/yumiclass/YumiClassApplication.java
    public static void main(String[] args) {
        // Spring Boot 애플리케이션 시작
        SpringApplication.run(YumiClassApplication.class, args);
    }
autoResize function · javascript · L24-L28 (5 LOC)
src/main/resources/static/js/chatbot.js
    function autoResize() {
        input.style.height = 'auto';
        const newHeight = Math.min(input.scrollHeight, 200);
        input.style.height = newHeight + 'px';
    }
If a scraper extracted this row, it came from Repobility (https://repobility.com)
toggleSendBtn function · javascript · L31-L35 (5 LOC)
src/main/resources/static/js/chatbot.js
    function toggleSendBtn() {
        const hasText = input.value.trim().length > 0;
        const hasFile = selectedFiles.files.length > 0;
        sendBtn.disabled = !(hasText || hasFile);
    }
getFileIcon function · javascript · L79-L87 (9 LOC)
src/main/resources/static/js/chatbot.js
    function getFileIcon(filename) {
        const ext = filename.split('.').pop().toLowerCase();
        if (['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'].includes(ext)) {
            return 'bi-image';
        }
        if (ext === 'pdf') return 'bi-file-earmark-pdf';
        if (['xlsx', 'xls', 'csv'].includes(ext)) return 'bi-file-earmark-excel';
        return 'bi-file-earmark';
    }
renderAttachments function · javascript · L90-L120 (31 LOC)
src/main/resources/static/js/chatbot.js
    function renderAttachments() {
        attachmentList.innerHTML = '';
        const files = selectedFiles.files;
        for (let i = 0; i < files.length; i++) {
            const file = files[i];
            const chip = document.createElement('div');
            chip.className = 'attachment-chip';
            chip.innerHTML =
                '<i class="bi ' + getFileIcon(file.name) + '"></i>' +
                '<span class="filename" title="' + file.name + '">' + file.name + '</span>' +
                '<button type="button" class="remove-chip" data-idx="' + i + '" title="삭제">' +
                '<i class="bi bi-x"></i></button>';
            attachmentList.appendChild(chip);
        }
        // 삭제 버튼 이벤트 바인딩
        attachmentList.querySelectorAll('.remove-chip').forEach(function(btn) {
            btn.addEventListener('click', function() {
                const idx = parseInt(btn.getAttribute('data-idx'), 10);
                // DataTransfer 재구성 (해당 인덱스 제외)
                con
toggleSidebar function · javascript · L9-L20 (12 LOC)
src/main/resources/static/js/sidebar.js
function toggleSidebar() {
    if (window.innerWidth <= 991) {
        // 모바일: 슬라이드 토글
        document.querySelector('.sidebar').classList.toggle('mobile-open');
        document.querySelector('.sidebar-overlay').classList.toggle('show');
    } else {
        // 데스크톱: 축소 토글
        document.body.classList.toggle('sidebar-collapsed');
        localStorage.setItem('sidebarCollapsed',
            document.body.classList.contains('sidebar-collapsed') ? '1' : '0');
    }
}
‹ prevpage 6 / 6