feat: 开发中...
This commit is contained in:
@@ -18,10 +18,8 @@ public class DevSecurityConfig {
|
||||
.anyRequest().permitAll())
|
||||
.cors().and()
|
||||
.csrf().disable()
|
||||
.formLogin()
|
||||
.and()
|
||||
.httpBasic()
|
||||
.and()
|
||||
.formLogin().and()
|
||||
.httpBasic().and()
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@@ -21,10 +21,8 @@ public class SecurityConfig {
|
||||
.anyRequest().authenticated())
|
||||
.cors().and()
|
||||
.csrf().disable()
|
||||
.formLogin()
|
||||
.and()
|
||||
.httpBasic()
|
||||
.and()
|
||||
.formLogin().and()
|
||||
.httpBasic().and()
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@@ -2,12 +2,13 @@ package cn.hamster3.application.blog.controller;
|
||||
|
||||
import cn.hamster3.application.blog.vo.ResponseVO;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Tag(name = "附件接口", description = "附件相关接口")
|
||||
@Tag(name = "AttachController", description = "附件相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/attach")
|
||||
@RequestMapping(value = "/api/v1/attach",produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class AttachController {
|
||||
@PostMapping("/")
|
||||
public ResponseVO<Void> createAttach(@RequestBody MultipartFile file) {
|
||||
|
@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "博文接口", description = "博文相关接口")
|
||||
@Tag(name = "BlogController", description = "博文相关接口")
|
||||
@RestController
|
||||
@RequestMapping(value = "/api/v1/blog", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class BlogController {
|
||||
|
@@ -14,7 +14,7 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "网站设置接口", description = "网站设置相关接口")
|
||||
@Tag(name = "SettingController", description = "网站设置相关接口")
|
||||
@RestController
|
||||
@RequestMapping(value = "/api/v1/settings", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class SettingController {
|
||||
|
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Tag(name = "用户接口", description = "用户相关接口")
|
||||
@Tag(name = "UserController", description = "用户相关接口")
|
||||
@RestController
|
||||
@RequestMapping(value = "/api/v1/user", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class UserController {
|
||||
@@ -41,7 +41,7 @@ public class UserController {
|
||||
|
||||
@PostMapping("/")
|
||||
@Operation(summary = "注册用户")
|
||||
public ResponseVO<UserInfoResponseVO> createUser(@RequestBody @Valid UserCreateRequireVO requireVO) {
|
||||
public ResponseVO<UserInfoResponseVO> register(@RequestBody @Valid UserCreateRequireVO requireVO) {
|
||||
return userService.createUser(requireVO);
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ public class SettingEntity {
|
||||
@Column(name = "id", nullable = false, updatable = false, length = 64)
|
||||
@NotBlank(message = "网站设置 ID 不能为空!")
|
||||
@Length(message = "网站设置 ID 长度不能超过 64 字符!", max = 64)
|
||||
@Pattern(message = "网站设置 ID 只能包含字母、数字和下划线!", regexp = "[a-zA-Z0-9-_]+")
|
||||
@Pattern(message = "网站设置 ID 只能包含字母、数字、点、横线和下划线!", regexp = "[a-zA-Z0-9-_.]+")
|
||||
private String id;
|
||||
|
||||
@Setter
|
||||
|
@@ -15,6 +15,7 @@ public interface SettingRepository extends JpaRepository<SettingEntity, String>,
|
||||
|
||||
SettingEntity findByIdIgnoreCase(String id);
|
||||
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
boolean existsByIdIgnoreCase(String id);
|
||||
|
||||
@Transactional
|
||||
|
Reference in New Issue
Block a user