挑戰目標: MockNative Camp
今天來看一下在各種頁面中是否有遺漏教師的欄位
這邊整理一下遺漏的欄位
整理完後更新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;
}