🌎πŸͺβ­οΈ3μ°¨ νŒ€ ν”„λ‘œμ νŠΈ WORLD κΈ°μˆ μ„œ

μ†‘μ±„μ˜Β·2023λ…„ 9μ›” 1일
0

title: 🌎πŸͺβ­οΈ3μ°¨ νŒ€ ν”„λ‘œμ νŠΈ WORLD κΈ°μˆ μ„œ
keywords:

  • IT
  • νŒ€ν”„λ‘œμ νŠΈ
  • JAVA
  • ν’€μŠ€νƒ

🌎πŸͺβ­οΈ3μ°¨ νŒ€ ν”„λ‘œμ νŠΈ WORLD κΈ°μˆ μ„œ

'WORLD' λŠ” κ²Œμž„ μ‹œλ¦¬μ–Όλ„˜λ²„(μ ‘μ†μ½”λ“œ) 판맀 μ‡Όν•‘λͺ° μ‚¬μ΄νŠΈμž…λ‹ˆλ‹€.

κ²Œμž„ ꡬ맀 , 리뷰 , 문의 , μ΅œμ‹ κ²Œμž„ μΆœμ‹œμ •λ³΄ν™•μΈ λ“± 컨텐츠 이용이 κ°€λŠ₯ν•©λ‹ˆλ‹€

ν”„λ‘œμ νŠΈ μ‚°μΆœλ¬Ό

youtubemf2Gez0mPcyoutube mf2Ge_z0mPc

μ§„ν–‰ κΈ°κ°„: 2023.08.01 ~ 2023.08.30






λͺ©μ°¨


πŸ”— 배포 링크

https://www.world.gh5.site

πŸ”— ν”„λ‘œμ νŠΈ μ €μž₯μ†Œ

νŒ€ 이름GitHub Repository
WorldGitHub Url

🀝 νŒ€ κ·œμΉ™

브랜치 μ „λž΅

  • upstreamμ—λŠ” main 브랜치만 쑴재
  • 브랜치λͺ…: μž‘μ—…λͺ…/μž‘μ—…μžμ΄λ‹ˆμ…œ
    • ex: adminorder/otj
  • μ½”λ“œλ¦¬λ·° λ°›κ³  승인 λ°›μœΌλ©΄ origin:main에 merge

### ν˜‘μ—… 툴 Trello ![](https://i.postimg.cc/x806CZmC/2023-08-16-12-08-04.png)

πŸ“‚ 폴더 ꡬ쑰

πŸ“¦world
  β”œβ”€β”€ πŸ“„μŠ€νƒ€μΌ.css
  β”œβ”€β”€ πŸ“„template.html
  β”œβ”€β”€ πŸ“„test.java
  β”œβ”€β”€ πŸ“„test.java
  β”œβ”€β”€ πŸ“‚admin
  β”œβ”€β”€ πŸ“‚calenbar
  β”œβ”€β”€ πŸ“‚email
  β”œβ”€β”€ πŸ“‚file
  β”œβ”€β”€ πŸ“‚mypage
  └── πŸ“‚notice
  └── πŸ“‚order
  └── πŸ“‚product
  └── πŸ“‚qna
  └── πŸ“‚qnaAnswer
  └── πŸ“‚review
  └── πŸ“‚user

πŸ› οΈ 기술 μŠ€νƒ

κ°œλ°œλ„κ΅¬

- SpringBoot
- JAVA
- MariaDB
- HTML
- CSS
- JS
- Ajax
- Bootstrap
-Tailwind css
- CentOS
- jQuery
- NAVER Cloud

κ°œλ°œν™˜κ²½

- IntelliJ IDEA
- DBeaver
- Termius
- GitHub-Action CI/CD

πŸ“– μ„œλΉ„μŠ€ μ†Œκ°œ

κΈ°λŠ₯ κ΅¬ν˜„

  • νšŒμ› κ°€μž…
  • μƒν’ˆμƒμ„Έ
  • μƒν’ˆκ΅¬λ§€
  • μƒν’ˆλͺ©λ‘
  • κ΄€λ¦¬μžνŽ˜μ΄μ§€
  • λ§ˆμ΄νŽ˜μ΄μ§€

ERD

νŽ˜μ΄μ§€

νšŒμ›κ°€μž…
νšŒμ›κ°€μž…
μƒν’ˆμƒμ„Έ
μƒν’ˆμƒμ„Έ
μƒν’ˆκ΅¬λ§€
μƒν’ˆκ΅¬λ§€
μƒν’ˆλͺ©λ‘
μƒν’ˆλͺ©λ‘
κ΄€λ¦¬μžνŽ˜μ΄μ§€
κ΄€λ¦¬μžνŽ˜μ΄μ§€
λ§ˆμ΄νŽ˜μ΄μ§€*
λ§ˆμ΄νŽ˜μ΄μ§€

πŸ‘‘ κ΅¬ν˜„λ―Έλ¦¬λ³΄κΈ°

κ΅¬ν˜„μ‚¬ν•­


πŸ“Œ νšŒμ›κ°€μž…

  1. 이메일
  • λ‚΄μš©
    1) μ„€λͺ…

    @GetMapping("/mailCheck")
    @ResponseBody
    public int processMailCheck(@RequestParam("email") String email) throws Exception {
        int mailKey = (int) ((Math.random() * (99999 - 10000 + 1)) + 10000);
    
        String to = email;
        String title = "ν™˜μ˜ν•©λ‹ˆλ‹€! WORLD μž…λ‹ˆλ‹€. νšŒμ›κ°€μž…μ‹œ ν•„μš”ν•œ 인증번호 μž…λ‹ˆλ‹€.";
        String content = "[인증번호] " + mailKey + " μž…λ‹ˆλ‹€. <br/> 인증번호 ν™•μΈλž€μ— κΈ°μž…ν•΄μ£Όμ„Έμš”.";
        try {
            MimeMessage mail = mailSender.createMimeMessage();
            MimeMessageHelper mailHelper = new MimeMessageHelper(mail, true, "UTF-8");
    
            mailHelper.setTo(to);
            mailHelper.setSubject(title);
            mailHelper.setText(content, true);
    
            mailSender.send(mail);
    
        } catch (Exception e) {
            throw new DataNotFoundException("error");
        }
        return mailKey;
    }
  1. λ‹‰λ„€μž„ 쀑볡 확인
  • λ‚΄μš©
    1) μ„€λͺ…

    ```js
    	$.ajax({
      url: '/user/checkDuplicate',
      type: 'GET',
      dataType: 'JSON',
      data: {
        nickname: nickname
      },
      success: function(response) {
        if (!response) {
          isNicknameDuplicate = false;
        }
    
        if (isNicknameDuplicate) {
          $('#nicknameCheckResult')
            .text('이미 μ‚¬μš© 쀑인 λ‹‰λ„€μž„μž…λ‹ˆλ‹€.')
            .css('color', 'red')
            .css('margin-left', '40px');
        } else {
          $('#nicknameCheckResult')
            .text('μ‚¬μš© κ°€λŠ₯ν•œ λ‹‰λ„€μž„μž…λ‹ˆλ‹€.')
            .css('margin-left', '70px')
            .css('color', 'white');
        }
      },
      error: function(xhr, status, error) {
        console.error('μœ μ € μ‚­μ œ 였λ₯˜:', error);
      }
    });

    }

    ```

πŸ“Œ κ΄€λ¦¬μžνŽ˜μ΄μ§€ 맀좜

  • 컨트둀러
	@PostMapping("/")
    public String adminMainSearsh(Model model, @Valid AdminSearchForm adminSearchForm, BindingResult bindingResult) {
        if (bindingResult.hasErrors()) {
            return "redirect:/ad/order";
        }
        LocalDateTime start = adminSearchForm.getStart();
        LocalDateTime end = adminSearchForm.getEnd();
        List<ProductOrder> list = this.orderService.getOrdersBetweenDates(start,end);

        int num=list.size();
        int totalPrice=1;
        for (ProductOrder order : list) {
            Product product = order.getProduct();
            if (product != null) {
                totalPrice += product.getPrice();
            }
        }
        DecimalFormat decimalFormat = new DecimalFormat("#,###");
        String formattedAllPrice = decimalFormat.format(totalPrice);

        LocalDate todayLocalDate = LocalDate.now();

        int priceM1 = this.adminService.requestMonthPrice(YearMonth.now());
        int priceM2 = this.adminService.requestMonthPrice(this.adminService.MonthMinus(1));
        int priceM3 = this.adminService.requestMonthPrice(this.adminService.MonthMinus(2));
        int priceM4 = this.adminService.requestMonthPrice(this.adminService.MonthMinus(3));
        int priceM5 = this.adminService.requestMonthPrice(this.adminService.MonthMinus(4));
        String month1 = YearMonth.now().toString();
        String month2 = this.adminService.MonthMinus(1).toString();
        String month3 = this.adminService.MonthMinus(2).toString();
        String month4 = this.adminService.MonthMinus(3).toString();
        String month5 = this.adminService.MonthMinus(4).toString();

        model.addAttribute("month1",month1);
        model.addAttribute("month2",month2);
        model.addAttribute("month3",month3);
        model.addAttribute("month4",month4);
        model.addAttribute("month5",month5);
        model.addAttribute("priceM1",priceM1);
        model.addAttribute("priceM2",priceM2);
        model.addAttribute("priceM3",priceM3);
        model.addAttribute("priceM4",priceM4);
        model.addAttribute("priceM5",priceM5);
        model.addAttribute("listSize",num);
        model.addAttribute("allPrice",formattedAllPrice);
        return "admin/admin_main";
    }
  • ν…œν”Œλ¦Ώ
<!DOCTYPE html>
<html lang="en">
<head>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/172203/font-awesome.min.css">
  <link rel="stylesheet" href="/layout/admin.css"/>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.1.0/chart.min.js"></script>
</head>

<body>
<nav class="navbar navbar-default no-margin">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header fixed-brand">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" id="menu-toggle">
      <span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>
    </button>
    <a class="navbar-brand" th:href="@{/}"><img class="rogoimg" src="https://i.postimg.cc/qRMyWWkr/image.png"/></a>
  </div>
  <!-- navbar-header-->
  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav">

    </ul>
  </div>
  <!-- bs-example-navbar-collapse-1 -->
</nav>
<div id="wrapper">
  <!-- Sidebar -->
  <div id="sidebar-wrapper">
    <ul class="sidebar-nav nav-pills nav-stacked" id="menu">
      <li>
        <a th:href="@{/admin/}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-cloud-download fa-stack-1x "></i></span>맀좜</a>
      </li>
      <li>
        <a th:href="@{/admin/order}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-cart-plus fa-stack-1x "></i></span>μ£Όλ¬Έ 관리</a>
      </li>
      <li>
        <a th:href="@{/admin/product}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-cart-plus fa-stack-1x "></i></span>μƒν’ˆ 관리</a>
      </li>
      <li>
        <a th:href="@{/admin/user}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-wrench fa-stack-1x "></i></span>νšŒμ› 관리</a>
      </li>
      <li>
        <a th:href="@{/admin/review}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-server fa-stack-1x "></i></span>리뷰 관리</a>
      </li>
      <li>
        <a th:href="@{/admin/qna}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-server fa-stack-1x "></i></span>λ¬Έμ˜μ‚¬ν•­ 관리</a>
      </li>
      <li>
        <a th:href="@{/admin/notice}"><span class="fa-stack fa-lg pull-left"><i class="fa fa-server fa-stack-1x "></i></span>곡지사항 관리</a>
      </li>
    </ul>
  </div>
  <!-- /#sidebar-wrapper -->
  <!-- Page Content -->
  <div id="page-content-wrapper">
    <div class="container-fluid xyz">
      <div class="row">
        <div class="col-lg-12">
          <h1>맀좜</h1>

          <div class="date_content">
            <div class="date_title"><p>기간별 쑰회. </p></div>
            <form th:action="@{/ad}" th:object="${adminSearchForm}" method="POST" class="date_form">
              <div class="birthday">
                <p>μ‘°νšŒκΈ°κ°„ :</p>
                <input type="datetime-local" th:field="*{start}">
                <p>~</p>
                <input type="datetime-local" th:field="*{end}">
                <button type="submit" class="date_btn"> μ‘°νšŒν•˜κΈ° </button>
              </div>
            </form>
            <div class="date_data"><div>
              <p >κΈ°κ°„ λ‚΄ 판맀 건 수 :</p>
              <p th:text="${listSize}">10(νƒ€μž„λ¦¬ν”„)</p>
              <p> 건</p>
            </div>
              <div>
                <p>κΈ°κ°„ λ‚΄ 총 맀좜 :</p>
                <p th:text="${allPrice}"></p>
                <p>won</p>
              </div>
            </div>
          </div>

          <div class="date_content">
            <div class="date_title"><p>맀좜 동ν–₯ </p></div>
            <canvas id="myChart"></canvas>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
<!-- jQuery -->

<script>
    var ctx = document.getElementById('myChart').getContext('2d');
    var priceM1 = [[${priceM1}]];
    var priceM2 = [[${priceM2}]];
    var priceM3 = [[${priceM3}]];
    var priceM4 = [[${priceM4}]];
    var priceM5 = [[${priceM5}]];
    var month1 = '[[${month1}]]';
    var month2 = '[[${month2}]]';
    var month3 = '[[${month3}]]';
    var month4 = '[[${month4}]]';
    var month5 = '[[${month5}]]';

    console.log(month4.toString())
    var chart = new Chart(ctx, {
        type: 'bar',
        data: {
            labels: [month5, month4, month3, month2, month1],
            datasets: [{
                label: '맀좜 (λ‹¨μœ„ : 원)',
                backgroundColor: 'rgb(255, 99, 132)',
                borderColor: 'rgb(255, 99, 132)',
                data: [priceM5, priceM4, priceM3, priceM2, priceM1]
            }]
        },
    });
</script>
</body>



</html>

πŸ‘¨β€πŸ‘¨β€πŸ‘§β€πŸ‘¦ 업무뢄담

νŒ€μž₯-μ˜€νƒμ£Ό (λ©”μΈν”„λ‘ νŠΈμ—”λ“œ & λ°±μ—”λ“œ & 기획 & λ””μžμΈ)

## ν”„λ‘ νŠΈμ—”λ“œ 메인

##λ°±μ—”λ“œ

##전체 νŽ˜μ΄μ§€ 디버깅 및 λ°±μ—”λ“œ,ν”„λ‘ νŠΈμ—”λ“œ λ―ΈλΉ„ μˆ˜μ •&μΆ”κ°€

##UI/UX (카카였였븐) , μš”κ΅¬μ‚¬ν•­ μ •μ˜μ„œ 기획

##ν”„λ‘œμ νŠΈ κΈ°μˆ μ„œ μž‘μ„±

##λ¬Έμ„œμž‘μ„±

νŒ€μ›-μ˜€κΈΈν™˜ (λ°±μ—”λ“œ & ν”„λ‘ νŠΈμ—”λ“œ & κΉƒ(μ €μž₯μ†Œ) 관리)

##ν”„λ‘ νŠΈμ—”λ“œ μ„œλΈŒ

##λ°±μ—”λ“œ

##ν”„λ‘œμ νŠΈ 배포(GitHub-Action)

##μ €μž₯μ†Œ (GitHub)관리

νŒ€μ›-μ†‘μ±„μ˜ (λ°±μ—”λ“œ & ν”„λ‘ νŠΈμ—”λ“œ)

##ν”„λ‘ νŠΈμ—”λ“œ μ„œλΈŒ

##λ°±μ—”λ“œ

##λ°œν‘œμžλ£Œ (PPT) μž‘μ„±

νŒ€μ›-μ„œλΉˆ (λ°±μ—”λ“œ & ν”„λ‘ νŠΈμ—”λ“œ)

##ν”„λ‘ νŠΈμ—”λ“œ μ„œλΈŒ

##λ°±μ—”λ“œ

##λ°œν‘œ

πŸ™†πŸΌβ€β™€οΈλ‹¨μœ„μ—…λ¬΄ν‘œ

κ°μ‚¬ν•©λ‹ˆλ‹€πŸ™†πŸΌβ€β™€οΈ

0개의 λŒ“κΈ€