Skip to content

Commit

Permalink
Next login credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
JongwoongSeon committed Aug 24, 2024
1 parent e926d84 commit 837b590
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/content/dev_back/DevBackApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
@SpringBootApplication
public class DevBackApplication {

public static void main(String[] args) {
SpringApplication.run(DevBackApplication.class, args);
public static void main(String[] args) {SpringApplication.run(DevBackApplication.class, args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.web.bind.annotation.*;
import com.content.dev_back.services.contentServices;
import com.content.dev_back.controller.dto.JoinRequest;
import com.content.dev_back.controller.dao.LoginDao;

@RequiredArgsConstructor
@RestController
Expand All @@ -21,14 +22,8 @@ public String getHello(){
@PostMapping("/join")
public String join(@RequestBody JoinRequest joinRequest){

// String id = joinRequest.getId();
// String name = joinRequest.getName();
// String phoneNumber = joinRequest.getPhoneNumber();

String result = contentServices.join(joinRequest);
// if (result == null) {
// return "Check Data";
// }else

if("success".equalsIgnoreCase(result)){
System.out.println("인풋 = " + result);
return "success";
Expand All @@ -38,4 +33,7 @@ public String join(@RequestBody JoinRequest joinRequest){
}
}


// @GetMapping("/login/test")
// public String join(@RequestBody LoginDao loginDao){
//
// }
25 changes: 25 additions & 0 deletions src/main/java/com/content/dev_back/controller/dao/LoginDao.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.content.dev_back.controller.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import com.content.dev_back.repository.contentRepo;

import javax.sql.DataSource;


@Repository
public class LoginDao {
private JdbcTemplate jdbcTemplate;

// @Autowired
public void setDataSource(DataSource dataSource){
this.jdbcTemplate = new JdbcTemplate(dataSource);
}

public long checkUser(String email, String passwd){
String checksql = "SELECT email,passwd FROM login;";

System.out.println(checksql);
return 0;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ spring:
defer-datasource-initialization: true
sql:
init:
# data-locations: classpath:logintest.sql
data-locations: classpath:logintest.sql
schema-locations: classpath:member/schema.sql
mode: always

0 comments on commit 837b590

Please sign in to comment.