iT邦幫忙

2021 iThome 鐵人賽

DAY 11
0

挑戰目標: MockNative Camp


今天來看一下在各種頁面中是否有遺漏教師的欄位
https://ithelp.ithome.com.tw/upload/images/20210926/20140358chz4jMLId3.png
https://ithelp.ithome.com.tw/upload/images/20210926/20140358NDILEHnBV3.png
https://ithelp.ithome.com.tw/upload/images/20210926/20140358MwGsMrhE31.png
這邊整理一下遺漏的欄位

  • 課堂狀態 / classStatus
  • 介紹影片 / introductionVideo
  • 用戶評價 / rating
  • 上次登入 / lastLogin
  • 上課次數 / classCount
  • 預約次數 / reservationCount
  • 預約取消率 / reservationCancelCount
  • 自我介紹 / selfIntroduction
  • 員工介紹 / employeeIntroduction
  • 教學年資 / teachingYears
  • 相簿 / picList
  • 徽章 / badge
  • 特色 / characteristic
  • 興趣愛好 / hobby

整理完後更新Teachers model
Teachers.java

package com.mock.nativecamp.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

@Document(collection = "Teachers")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Teachers {
    @Id
    private String userId;
    private String name;
    private String email;
    private String password;
    private String status;
    private String timezone;
    private String birthday;
    private String country;
    private String nationality;
    private String referrerEmail;
    private String classStatus;
    private String introductionVideo;
    private String rating;
    private String lastLogin;
    private Integer classCount;
    private Integer reservationCount;
    private Integer reservationCancelCount;
    private String selfIntroduction;
    private String employeeIntroduction;
    private String teachingYears;
    private List<String> picList;
    private List<String> badge;
    private List<String> characteristic;
    private List<String> hobby;
}

先將教師註冊的介面先寫好,明天再來寫邏輯
TeachersController.java

package com.mock.nativecamp.service;

import com.mock.nativecamp.payload.teacher.SignupReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class TeachersServer {
    public Object signupTeacher(SignupReq signupReq) {

        return new ResponseEntity(HttpStatus.ACCEPTED);
    }
}

TeachersServer.java

package com.mock.nativecamp.service;

import com.mock.nativecamp.payload.teacher.SignupReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class TeachersServer {
    public Object signupTeacher(SignupReq signupReq) {

        return new ResponseEntity(HttpStatus.ACCEPTED);
    }
}

在payload.teacher 建立SignupReq
SignupReq.java

package com.mock.nativecamp.payload.teacher;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;

@Data
@AllArgsConstructor()
public class SignupReq {
    @NonNull
    private String firstName;
    private String middleName;
    @NonNull
    private String lastName;
    @NonNull
    private String email;
    @NonNull
    private String password;
    @NonNull
    private String birthday;
    private String referrerEmail;
    @NonNull
    private String country;
    @NonNull
    private String nationality;
}

上一篇
[Day 10]怎麼每天都像在趕末班電車R(後端篇)
下一篇
[Day 12]我也好想成為時間管理大師(後端篇)
系列文
關於我快30歲的後端工程師,想轉職成全端工程師,在前端世界中尋求機會的那件事(後端篇)18
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言