fix: 디비 연결 문자열 수정
This commit is contained in:
parent
3f51ef0e27
commit
c593c2e691
@ -1,6 +1,8 @@
|
|||||||
package com.interplug.qcast.biz.login;
|
package com.interplug.qcast.biz.login;
|
||||||
|
|
||||||
import com.interplug.qcast.biz.login.dto.LoginUser;
|
import com.interplug.qcast.biz.login.dto.LoginUser;
|
||||||
|
import com.interplug.qcast.biz.login.dto.UserResponse;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -8,8 +10,10 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/login")
|
@RequestMapping("/api/login")
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class LoginController {
|
public class LoginController {
|
||||||
@Autowired private LoginService loginService;
|
// @Autowired private LoginService loginService;
|
||||||
|
private final LoginService loginService;
|
||||||
|
|
||||||
@PostMapping("/v1.0/login")
|
@PostMapping("/v1.0/login")
|
||||||
public void login(@RequestBody LoginUser loginUser) {
|
public void login(@RequestBody LoginUser loginUser) {
|
||||||
@ -20,4 +24,9 @@ public class LoginController {
|
|||||||
log.debug("isLogin : " + loginService.getLogin(loginUser));
|
log.debug("isLogin : " + loginService.getLogin(loginUser));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/v1.0/user")
|
||||||
|
public UserResponse getUser(@RequestBody LoginUser loginUser) {
|
||||||
|
return loginService.getUser(loginUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package com.interplug.qcast.biz.login;
|
package com.interplug.qcast.biz.login;
|
||||||
|
|
||||||
import com.interplug.qcast.biz.login.dto.LoginUser;
|
import com.interplug.qcast.biz.login.dto.LoginUser;
|
||||||
|
import com.interplug.qcast.biz.login.dto.UserResponse;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
interface LoginMapper {
|
interface LoginMapper {
|
||||||
public boolean getLogin(LoginUser loginUser);
|
public boolean getLogin(LoginUser loginUser);
|
||||||
|
public UserResponse getUser(LoginUser loginUser);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,24 @@
|
|||||||
package com.interplug.qcast.biz.login;
|
package com.interplug.qcast.biz.login;
|
||||||
|
|
||||||
import com.interplug.qcast.biz.login.dto.LoginUser;
|
import com.interplug.qcast.biz.login.dto.LoginUser;
|
||||||
|
import com.interplug.qcast.biz.login.dto.UserResponse;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class LoginService {
|
public class LoginService {
|
||||||
@Autowired LoginMapper loginMapper;
|
// @Autowired LoginMapper loginMapper;
|
||||||
|
private final LoginMapper loginMapper;
|
||||||
|
|
||||||
public boolean getLogin(LoginUser loginUser) {
|
public boolean getLogin(LoginUser loginUser) {
|
||||||
return loginMapper.getLogin(loginUser);
|
return loginMapper.getLogin(loginUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserResponse getUser(LoginUser loginUser) {
|
||||||
|
return loginMapper.getUser(loginUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.interplug.qcast.biz.login.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserResponse {
|
||||||
|
private String userId;
|
||||||
|
private String saleStoreId;
|
||||||
|
private String name;
|
||||||
|
private String mail;
|
||||||
|
private String tel;
|
||||||
|
}
|
||||||
@ -14,17 +14,17 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
jdbc-url: jdbc:log4jdbc:sqlserver://localhost:1433;databaseName=qcastdb;encrypt=true;trustServerCertificate=true
|
jdbc-url: jdbc:log4jdbc:sqlserver://mssql.devgrr.kr:1433;databaseName=qcast;encrypt=true;trustServerCertificate=true
|
||||||
username: qcast
|
username: qcast
|
||||||
password: ENC(rg8lFosEDRzKrg3WQjFrrbUDlzLnbsMa)
|
password: ENC(MIICho4m0EXUeb/QCdYfDr7qNn0B3K0y)
|
||||||
maximum-pool-size: 4
|
maximum-pool-size: 4
|
||||||
pool-name: Master-HikariPool
|
pool-name: Master-HikariPool
|
||||||
# connection-test-query: SELECT 1
|
# connection-test-query: SELECT 1
|
||||||
read:
|
read:
|
||||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
jdbc-url: jdbc:log4jdbc:sqlserver://localhost:1433;databaseName=qcastdb;encrypt=true;trustServerCertificate=true
|
jdbc-url: jdbc:log4jdbc:sqlserver://mssql.devgrr.kr:1433;databaseName=qcast;encrypt=true;trustServerCertificate=true
|
||||||
username: qcast
|
username: qcast
|
||||||
password: ENC(rg8lFosEDRzKrg3WQjFrrbUDlzLnbsMa)
|
password: ENC(MIICho4m0EXUeb/QCdYfDr7qNn0B3K0y)
|
||||||
maximum-pool-size: 4
|
maximum-pool-size: 4
|
||||||
pool-name: Read-HikariPool
|
pool-name: Read-HikariPool
|
||||||
# connection-test-query: SELECT 2
|
# connection-test-query: SELECT 2
|
||||||
|
|||||||
@ -6,8 +6,17 @@
|
|||||||
resultType="boolean">
|
resultType="boolean">
|
||||||
/* sqlid : com.interplug.qcast.login.findByLoginId */
|
/* sqlid : com.interplug.qcast.login.findByLoginId */
|
||||||
select 1
|
select 1
|
||||||
from login_user
|
from M_USER
|
||||||
where login_id = #{username}
|
where USER_ID = #{username}
|
||||||
and login_pwd = #{password}
|
and PASSWORD = #{password}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUser" parameterType="com.interplug.qcast.biz.login.dto.LoginUser"
|
||||||
|
resultType="com.interplug.qcast.biz.login.dto.UserResponse">
|
||||||
|
/* sqlid : com.interplug.qcast.login.findByLoginId */
|
||||||
|
select USER_ID, SALE_STORE_ID, NAME, MAIL, TEL
|
||||||
|
from M_USER
|
||||||
|
where USER_ID = #{username}
|
||||||
|
and PASSWORD = #{password}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test;
|
|||||||
class JasyptConfigTest {
|
class JasyptConfigTest {
|
||||||
@Test
|
@Test
|
||||||
void test() {
|
void test() {
|
||||||
log.info(JasyptConfig.encrypt("qcast1234!"));
|
// log.info(JasyptConfig.encrypt("qcast1234!"));
|
||||||
|
log.info(JasyptConfig.encrypt("Qwertqaz12345"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user