ResetPassword 관련 추가

This commit is contained in:
Suh
2024-01-17 10:25:14 +09:00
parent 17a6e5bafb
commit d51668f3ec
7 changed files with 156 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ public class AuthAspect {
String[] list = targetController.split("\\.");
String packageName = list[3];
if(packageName.equals("login")) {
if(packageName.equals("login") || packageName.equals("resetpassword")) {
return joinPoint.proceed();
}

View File

@@ -0,0 +1,36 @@
package com.no1.wms.resetpassword;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/resetpassword")
public class ResetPasswordController {
@Autowired
ResetPasswordService resetPasswordService;
@PostMapping("/insert")
@ResponseBody
public String insert(ResetPasswordDto dto, Gson gson){
resetPasswordService.insert(dto);
return gson.toJson("s");
}
@PostMapping("/delete")
@ResponseBody
public String delete(ResetPasswordDto dto, Gson gson){
resetPasswordService.delete(dto);
return gson.toJson("s");
}
}

View File

@@ -0,0 +1,27 @@
package com.no1.wms.resetpassword;
import com.no1.wms.account.AccountDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Alias("ResetPasswordDto")
public class ResetPasswordDto {
String id;
String accountId;
String note;
@DateTimeFormat(pattern = "yyyy-MM-dd")
Date date;
AccountDto accountDto;
String employeeNumber;
}

View File

@@ -0,0 +1,15 @@
package com.no1.wms.resetpassword;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Repository
@Mapper
public interface ResetPasswordMapper {
void insert(ResetPasswordDto dto);
void delete(ResetPasswordDto dto);
}

View File

@@ -0,0 +1,19 @@
package com.no1.wms.resetpassword;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ResetPasswordService {
@Autowired
ResetPasswordMapper mapper;
void insert(ResetPasswordDto dto){
mapper.insert(dto);
}
void delete(ResetPasswordDto dto){
mapper.delete(dto);
}
}