refactor: 重构整体代码
This commit is contained in:
commit
949efbbe0c
|
@ -4,16 +4,12 @@ import cn.bunny.dao.pojo.result.Result;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ResponseUtil {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ResponseUtil.class);
|
||||
|
||||
public static void out(HttpServletResponse response, Result<Object> result) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
|
@ -23,8 +19,8 @@ public class ResponseUtil {
|
|||
response.setStatus(HttpStatus.OK.value());
|
||||
try {
|
||||
mapper.writeValue(response.getWriter(), result);
|
||||
} catch (IOException exception) {
|
||||
log.error(exception.getMessage());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
<artifactId>dao</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>model</name>
|
||||
<url>https://maven.apache.org</url>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Map;
|
|||
*/
|
||||
@Tag(name = "邮件模板", description = "邮件模板相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/emailTemplate")
|
||||
@RequestMapping("admin/emailTemplate")
|
||||
public class EmailTemplateController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Map;
|
|||
*/
|
||||
@Tag(name = "邮箱用户发送配置", description = "邮箱用户发送配置相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/emailUsers")
|
||||
@RequestMapping("admin/emailUsers")
|
||||
public class EmailUsersController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.Set;
|
|||
*/
|
||||
@Tag(name = "系统文件表", description = "系统文件相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/files")
|
||||
@RequestMapping("admin/files")
|
||||
public class FilesController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
|
||||
@Tag(name = "用户信息", description = "用户信息相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/user")
|
||||
@RequestMapping("/admin/user")
|
||||
public class UserController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.List;
|
|||
*/
|
||||
@Tag(name = "用户登录日志", description = "用户登录日志相关接口")
|
||||
@RestController
|
||||
@RequestMapping("api/userLoginLog")
|
||||
@RequestMapping("admin/userLoginLog")
|
||||
public class UserLoginLogController {
|
||||
|
||||
@Autowired
|
||||
|
|
Loading…
Reference in New Issue