Compare commits

...

74 Commits

Author SHA1 Message Date
e45e84c53a revert :取消合并用户管理,因为那是旧的版本
revert Merge remote-tracking branch 'origin/personal/lsd/UserManagement'

# Conflicts:
#	src/main/java/org/cmh/backend/authentication/controller/AuthenticationController.java
#	src/main/java/org/cmh/backend/authentication/repository/UserRepository.java
#	src/main/java/org/cmh/backend/authentication/service/UserService.java
2024-07-05 16:34:34 +08:00
3c8eb52ac0 Merge remote-tracking branch 'origin/personal/lsd/UserManagement'
# Conflicts:
#	src/main/java/org/cmh/backend/authentication/controller/AuthenticationController.java
#	src/main/java/org/cmh/backend/authentication/repository/UserRepository.java
#	src/main/java/org/cmh/backend/authentication/service/UserService.java
2024-07-05 15:11:13 +08:00
05ed80d460 Merge branch 'personal/heshunme/news' 2024-07-05 15:07:21 +08:00
55e40288df Merge branch 'main' into personal/heshunme/auth-restart-1
# Conflicts:
#	src/main/java/org/cmh/backend/authentication/controller/UserController.java
#	src/main/resources/application.properties
2024-07-05 15:04:06 +08:00
33f811e6b7 GPT牛逼,搜索搞成了 2024-07-05 06:20:30 +08:00
9e03bb3873 能搜了,就是有点问题,范围太广,啥都搜到了 2024-07-05 06:11:11 +08:00
f104c89d08 初步添加了用户权限区别对待。 2024-07-05 02:21:59 +08:00
aa8ca4e274 solve conflict 2024-07-04 17:26:39 +08:00
d2e3443c40 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	src/main/java/org/cmh/backend/authentication/controller/UserController.java
2024-07-04 17:16:30 +08:00
2c12fc075f getNewsPage加了jwtVerify 2024-07-04 16:42:06 +08:00
ed0cde6968 添加了漏加的service中保存租户的逻辑 2024-07-04 16:41:36 +08:00
e66695cbff 为了适应前端的列表动态加载,添加了getNewsByRange及其相关内容。 2024-07-04 12:20:04 +08:00
9de8c77764 Merge branch 'main' into personal/heshunme/news 2024-07-04 00:36:19 +08:00
441c984108 全集修改上传文件大小上限,添加验证码路径支持 2024-07-04 00:35:54 +08:00
30344b2162 添加了图片上传的后端支持 2024-07-04 00:33:49 +08:00
431ef62c12 添加了getById的请求方法 2024-07-04 00:33:32 +08:00
9056250574 添加租户字段,在联系上外键之前暂且设为字符串 2024-07-04 00:33:06 +08:00
a15f407c13 全局修改上传文件大小上限 2024-07-04 00:31:58 +08:00
173b507361 删除了service中delete throw exception的message 2024-07-03 14:52:48 +08:00
fdb9dc6daf Merge branch 'main' into personal/heshunme/news 2024-07-03 14:50:24 +08:00
9d6ab53f5f 给HttpMessageNotReadableException和MissingServletRequestParameterException指定了全局错误处理器,现在当前端发送给后端的参数不对的时候也能正确返回401错误了 2024-07-03 14:50:03 +08:00
a58da98dd1 给@JwtVerify添加了校验字符串参数的用法,现在只要有任意一个字符串参数的内容是JWT就也能校验了。 2024-07-03 14:50:03 +08:00
a38fd92801 给HttpMessageNotReadableException和MissingServletRequestParameterException指定了全局错误处理器,现在当前端发送给后端的参数不对的时候也能正确返回401错误了 2024-07-03 14:49:28 +08:00
df34d7cb28 给@JwtVerify添加了校验字符串参数的用法,现在只要有任意一个字符串参数的内容是JWT就也能校验了。 2024-07-03 14:40:25 +08:00
a4713648a2 完成了delete,尝试@JwtVerify校验字符串参数的用法 2024-07-03 14:39:05 +08:00
e4a11a8a53 Merge branch 'main' into personal/heshunme/news 2024-07-03 14:14:06 +08:00
fc2c97b502 bugfix@JwtVerify 2024-07-03 14:13:20 +08:00
a532eaa89c 尝试@JwtVerify的新用法 2024-07-03 14:13:05 +08:00
c4f0b2348f bugfix@JwtVerify 2024-07-03 14:12:42 +08:00
3a7b6ee605 Merge branch 'main' into personal/heshunme/news 2024-07-03 13:58:57 +08:00
df6686fc19 升级了@JwtVerify的能力,现在被修饰的方法的任意一个参数是继承于JwtRequest的对象即可,不再强制为第一个参 2024-07-03 13:58:25 +08:00
a5aac1199d 升级了@JwtVerify的能力,现在被修饰的方法的任意一个参数是继承于JwtRequest的对象即可,不再强制为第一个参 2024-07-03 13:58:09 +08:00
6c36552c2f 重写了getNewsPage方法,取消了DTO,改用url参数 2024-07-03 13:53:16 +08:00
e6ba8c9a12 updateNews已完成 2024-07-03 13:48:10 +08:00
65f15eb9a9 createNews已完成 2024-07-03 13:41:01 +08:00
b4bdd2fc83 给news实体类添加自动生成时间戳 2024-07-03 13:17:41 +08:00
961a17efef 给news实体类添加约束 2024-07-03 13:08:55 +08:00
e56db8a92e Revert "根据warning修改为pagedModel"
This reverts commit 64d7ae8c59.
2024-07-03 13:02:40 +08:00
64d7ae8c59 根据warning修改为pagedModel 2024-07-03 13:02:32 +08:00
3579f93c0d 完成了/news/getNewsList全数据流程 2024-07-03 12:45:39 +08:00
f9a6a3c481 初步建立了NewsRepository 2024-07-03 11:06:54 +08:00
2505b63b88 Merge branch 'main' into personal/heshunme/news
# Conflicts:
#	src/main/java/org/cmh/backend/authentication/controller/UserController.java
2024-07-03 02:02:04 +08:00
6beeb110c2 删除了无用示例 2024-07-03 01:59:40 +08:00
97d2ba60f5 chat设计了newsController,待完善 2024-07-03 01:58:41 +08:00
df51dac024 创建了news实体类 2024-07-03 01:43:37 +08:00
af4a0f9684 添加验证码图片和图片路径 2024-07-02 22:30:20 +08:00
ae0417c77f 添加验证码支持 2024-07-02 22:29:49 +08:00
b7ede5652c 添加特权用户:superAdmin 2024-07-02 15:41:05 +08:00
fcd9534e65 Merge branch 'main' into personal/heshunme/auth-restart-1 2024-07-02 02:36:47 +08:00
3137c22313 Merge branch 'main' into personal/heshunme/auth-restart-1 2024-07-02 02:29:32 +08:00
1d29684689 添加全局ExceptionHandle以更优雅地处理JwtValidationException 2024-07-02 02:28:59 +08:00
ad14782702 适配JwtVerify注释 2024-07-02 02:25:42 +08:00
3641689cbb Merge branch 'main' into personal/heshunme/auth-restart-1
# Conflicts:
#	src/test/java/org/cmh/backend/Utils/JwtUtilTest.java
2024-07-02 02:07:55 +08:00
d69a979f10 尝试添加@JwtVerify修饰支持,简化Jwt验证流程 2024-07-02 02:07:22 +08:00
cc1d63e76c 微调了loginResponse DTO的字段名 2024-07-01 21:05:37 +08:00
9c46495d40 修改了注册的字段和数据传递逻辑 2024-07-01 20:38:08 +08:00
3fdded3c9c 添加发送验证码的controller逻辑。暂且写一个直接返回1234的吧。 2024-07-01 20:12:35 +08:00
c03b190aba 完成/changePassword,测试通过 2024-07-01 20:02:22 +08:00
cbe7ec9a24 创建dto软件包,对dto进行重构 2024-07-01 19:35:04 +08:00
58e456f3b3 添加了用户信息修改功能,测试通过 2024-07-01 19:20:41 +08:00
c863f1023b 为JWT添加了直接校验token是否有效而不需要提供username的功能。提高其鲁棒性 2024-07-01 18:39:08 +08:00
aa9e0d8804 /userProfile完成 2024-07-01 18:33:46 +08:00
0f13440ab0 Merge branch 'main' into personal/heshunme/auth-restart-1 2024-07-01 18:15:01 +08:00
b04ebb148a 添加/userProfile 2024-07-01 18:12:48 +08:00
0a33a40ce1 Revert "现在可以对作为类属性的JwtUtil使用@AutoWired修饰"
This reverts commit 17f19e0b94.
2024-07-01 17:48:25 +08:00
442eaf2479 添加jwt支持 2024-07-01 17:47:59 +08:00
57b75e4813 Merge branch 'main' into personal/heshunme/auth-restart-1 2024-07-01 17:46:07 +08:00
2848312363 实现login 2024-07-01 17:37:56 +08:00
4eb09c3bca 优化失败message展示逻辑 2024-07-01 17:27:44 +08:00
80ae2fb8d3 通过DTO规范化数据交换 2024-07-01 17:21:13 +08:00
feec889732 注册功能完成,Insomnia测试通过 2024-07-01 17:14:34 +08:00
94474d6c42 Merge branch 'main' into personal/heshunme/auth-restart-1 2024-07-01 16:51:33 +08:00
b173b37329 租户管理完成增和改 2024-06-30 15:40:23 +08:00
2ada18d2af 为了区分于服务器中现有的类,修改了User类名 2024-06-30 14:43:20 +08:00
128 changed files with 922 additions and 79 deletions

View File

@ -0,0 +1,65 @@
package org.cmh.backend.NewsManagement.controller;
import org.cmh.backend.NewsManagement.dto.UploadFileResponse;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@RestController
@CrossOrigin // 如果前端和后端不在同一个域名或端口下需要启用跨域
public class FileController {
private static final String UPLOAD_DIR = "uploads/";
@PostMapping("/news/uploadPic")
public ResponseEntity<UploadFileResponse> uploadFile(@RequestParam("file") MultipartFile file) {
if (file.isEmpty()) {
return new ResponseEntity<>(new UploadFileResponse("文件不能为空", null), HttpStatus.BAD_REQUEST);
}
try {
// 确保上传目录存在
Path uploadDirPath = Paths.get(UPLOAD_DIR);
if (!Files.exists(uploadDirPath)) {
Files.createDirectories(uploadDirPath);
}
// 生成文件路径
byte[] bytes = file.getBytes();
Path path = Paths.get(UPLOAD_DIR + file.getOriginalFilename());
Files.write(path, bytes);
// 返回成功信息
return new ResponseEntity<>(new UploadFileResponse("文件上传成功", "/api/news/files/" + file.getOriginalFilename()), HttpStatus.OK);
} catch (IOException e) {
return new ResponseEntity<>(new UploadFileResponse("文件上传失败", null), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@GetMapping("/news/files/{filename}")
public ResponseEntity<Resource> getFile(@PathVariable String filename) {
try {
Path filePath = Paths.get(UPLOAD_DIR).resolve(filename).normalize();
Resource resource = new UrlResource(filePath.toUri());
if (resource.exists() && resource.isReadable()) {
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
.body(resource);
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
} catch (Exception e) {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}

View File

@ -0,0 +1,104 @@
package org.cmh.backend.NewsManagement.controller;
import jakarta.persistence.EntityNotFoundException;
import org.cmh.backend.NewsManagement.dto.GetNewsListResponse;
import org.cmh.backend.NewsManagement.dto.MessageResponse;
import org.cmh.backend.NewsManagement.dto.NewsRequest;
import org.cmh.backend.NewsManagement.dto.SearchNewsRequest;
import org.cmh.backend.NewsManagement.model.News;
import org.cmh.backend.NewsManagement.service.NewsService;
import org.cmh.backend.Utils.JwtUtil;
import org.cmh.backend.Utils.JwtVerify;
import org.cmh.backend.authentication.model.UserHS;
import org.cmh.backend.authentication.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/news")
public class NewsController {
@Autowired
private NewsService newsService;
@Autowired
private UserService userService;
@GetMapping
@JwtVerify
public ResponseEntity<GetNewsListResponse> getNewsByRange(@RequestParam Integer start, @RequestParam Integer end, @RequestParam String token) {
String username = JwtUtil.extractUsername(token);
UserHS user = userService.getUserByUsername(username);
// TODO:完善用户权限
if (user.getSuperAdmin()) {
} else {
}
if (start >= end) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
long newsCount = newsService.getNewsCount();
return new ResponseEntity<>(new GetNewsListResponse(newsCount, newsService.getNewsByRange(start, end, user)), HttpStatus.OK);
}
@PostMapping("/search")
@JwtVerify
public ResponseEntity<GetNewsListResponse> searchNews(@RequestBody SearchNewsRequest request) {
List<News> newsList = newsService.searchNews(request);
long newsCount = newsList.size();
return new ResponseEntity<>(new GetNewsListResponse(newsCount, newsList), HttpStatus.OK);
}
@GetMapping("/{id}")
@JwtVerify
public ResponseEntity<News> getNewsPage(@PathVariable Long id, @RequestParam String token) {
try {
return new ResponseEntity<>(newsService.getNewsById(id), HttpStatus.OK);
} catch (EntityNotFoundException e) {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
}
@PostMapping
@JwtVerify
public ResponseEntity<MessageResponse> createNews(@RequestBody NewsRequest request) {
try {
newsService.createNews(request);
} catch (DataIntegrityViolationException e) {
return new ResponseEntity<>(new MessageResponse("创建失败,文章已存在或缺少字段"), HttpStatus.BAD_REQUEST);
} catch (Exception e) {
return new ResponseEntity<>(new MessageResponse("创建失败:" + e.getMessage()), HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(new MessageResponse("创建成功"), HttpStatus.CREATED);
}
@PutMapping("/{id}")
@JwtVerify
public ResponseEntity<MessageResponse> updateNews(@PathVariable Long id, @RequestBody NewsRequest request) {
try {
newsService.updateNews(id, request);
} catch (DataIntegrityViolationException e) {
return new ResponseEntity<>(new MessageResponse("修改失败,新标题已存在或缺少字段"), HttpStatus.BAD_REQUEST);
} catch (Exception e) {
return new ResponseEntity<>(new MessageResponse("创建失败:" + e.getMessage()), HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(new MessageResponse("修改成功"), HttpStatus.OK);
}
@DeleteMapping("/{id}")
@JwtVerify
public ResponseEntity<MessageResponse> deleteNews(@PathVariable Long id, @RequestParam String token) {
try {
newsService.deleteNews(id);
} catch (EntityNotFoundException e) {
return new ResponseEntity<>(new MessageResponse("删除失败,文章不存在"), HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(new MessageResponse("删除成功"), HttpStatus.OK);
}
}

View File

@ -0,0 +1,17 @@
package org.cmh.backend.NewsManagement.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import org.cmh.backend.NewsManagement.model.News;
import java.util.List;
@Getter
@Setter
@AllArgsConstructor
public class GetNewsListResponse {
Long newsCount;
List<News> newsList;
}

View File

@ -0,0 +1,12 @@
package org.cmh.backend.NewsManagement.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class MessageResponse {
String message;
}

View File

@ -0,0 +1,16 @@
package org.cmh.backend.NewsManagement.dto;
import lombok.Getter;
import lombok.Setter;
import org.cmh.backend.Utils.JwtRequest;
@Getter
@Setter
public class NewsRequest extends JwtRequest {
private String title;
private String summary;
private String content;
private String imagePath;
private String author;
private String tenant;
}

View File

@ -0,0 +1,15 @@
package org.cmh.backend.NewsManagement.dto;
import lombok.Getter;
import lombok.Setter;
import org.cmh.backend.Utils.JwtRequest;
@Getter
@Setter
public class SearchNewsRequest extends JwtRequest {
private String author;
private String title;
private String imagePath;
private String summary;
private String sortBy;
}

View File

@ -0,0 +1,16 @@
package org.cmh.backend.NewsManagement.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class UploadFileResponse extends MessageResponse {
private String url;
public UploadFileResponse(String message, String url) {
super(message);
this.url = url;
}
}

View File

@ -0,0 +1,36 @@
package org.cmh.backend.NewsManagement.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import java.time.LocalDateTime;
@Setter
@Getter
@Entity
public class News {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, unique = true)
private String title;
@Column(nullable = false)
private String summary;
@Column(nullable = false)
private String content;
private String imagePath;
@Column(nullable = false)
private String author;
@CreationTimestamp
private LocalDateTime createdAt;
// TODO:添加外键绑定
private String tenant;
}

View File

@ -0,0 +1,23 @@
package org.cmh.backend.NewsManagement.repository;
import org.cmh.backend.NewsManagement.model.News;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface NewsRepository extends JpaRepository<News, Long> {
Page<News> findAllByOrderByIdDesc(Pageable pageable);
Page<News> findByTenantOrderByIdDesc(String tenant, Pageable pageable);
List<News> findByTitleContainingOrSummaryContainingOrAuthorContainingOrImagePathContainingAndTenantEquals(
String title,
String summary,
String author,
String imagePath,
String tenant);
List<News> findByTitleContainingOrSummaryContainingOrAuthorContainingOrImagePathContaining(String title, String summary, String author, String imagePath);
}

View File

@ -0,0 +1,175 @@
package org.cmh.backend.NewsManagement.service;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityNotFoundException;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import org.cmh.backend.NewsManagement.dto.NewsRequest;
import org.cmh.backend.NewsManagement.dto.SearchNewsRequest;
import org.cmh.backend.NewsManagement.model.News;
import org.cmh.backend.NewsManagement.repository.NewsRepository;
import org.cmh.backend.Utils.JwtUtil;
import org.cmh.backend.authentication.model.UserHS;
import org.cmh.backend.authentication.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class NewsService {
@Autowired
private NewsRepository newsRepository;
@Autowired
private UserService userService;
@PersistenceContext
private EntityManager entityManager;
public List<News> getNewsByRange(int start, int end, UserHS user) {
if (start < 0 || end <= start) {
throw new IllegalArgumentException("Invalid start or end range");
}
int pageSize = end - start; // 计算每页的大小
int startPageNumber = start / pageSize; // 计算起始页码
int endPageNumber = (end - 1) / pageSize; // 计算结束页码
List<News> result = new ArrayList<>();
for (int pageNumber = startPageNumber; pageNumber <= endPageNumber; pageNumber++) {
Pageable pageable = PageRequest.of(pageNumber, pageSize);
Page<News> newsPage = null;
if (user.getSuperAdmin()) {
newsPage = newsRepository.findAllByOrderByIdDesc(pageable);
} else {
newsPage = newsRepository.findByTenantOrderByIdDesc(user.getUsername(), pageable);
}
if (newsPage.hasContent()) {
result.addAll(newsPage.getContent());
} else {
break; // 如果没有更多内容提前退出
}
}
int startIndex = start % pageSize;
int endIndex = startIndex + (end - start);
if (endIndex > result.size()) {
endIndex = result.size();
}
return result.subList(startIndex, endIndex);
}
public void createNews(NewsRequest request) {
News news = new News();
news.setTitle(request.getTitle());
news.setSummary(request.getSummary());
news.setContent(request.getContent());
news.setAuthor(request.getAuthor());
news.setImagePath(request.getImagePath());
news.setTenant(request.getTenant());
newsRepository.save(news);
}
public void updateNews(Long id, NewsRequest request) {
News news = newsRepository.findById(id).orElse(null);
if (news != null) {
news.setTitle(request.getTitle());
news.setSummary(request.getSummary());
news.setContent(request.getContent());
news.setAuthor(request.getAuthor());
news.setImagePath(request.getImagePath());
news.setTenant(request.getTenant());
newsRepository.save(news);
}
}
public void deleteNews(Long id) {
if (!newsRepository.existsById(id)) {
throw new EntityNotFoundException();
}
newsRepository.deleteById(id);
}
public News getNewsById(Long id) {
if (!newsRepository.existsById(id)) {
throw new EntityNotFoundException();
}
return newsRepository.findById(id).orElse(null);
}
public long getNewsCount() {
return newsRepository.count();
}
// TODO:完善用户权限
// public List<News> searchNews(SearchNewsRequest request) {
// String username = JwtUtil.extractUsername(request.getToken());
// UserHS user = userService.getUserByUsername(username);
// if (user.getSuperAdmin()) {
// return newsRepository.findByTitleContainingOrSummaryContainingOrAuthorContainingOrImagePathContaining(
// request.getTitle(),
// request.getSummary(),
// request.getAuthor(),
// request.getImagePath()
// );
// }
// return newsRepository.findByTitleContainingOrSummaryContainingOrAuthorContainingOrImagePathContainingAndTenantEquals(
// request.getTitle(),
// request.getSummary(),
// request.getAuthor(),
// request.getImagePath(),
// user.getUsername()
// );
// }
public List<News> searchNews(SearchNewsRequest request) {
String username = JwtUtil.extractUsername(request.getToken());
UserHS user = userService.getUserByUsername(username);
// Create a list to hold predicates
List<Predicate> predicates = new ArrayList<>();
// Create the query
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<News> criteriaQuery = criteriaBuilder.createQuery(News.class);
Root<News> root = criteriaQuery.from(News.class);
// Build the query conditionally based on non-empty fields
if (!request.getTitle().isEmpty()) {
predicates.add(criteriaBuilder.like(root.get("title"), "%" + request.getTitle() + "%"));
}
if (!request.getSummary().isEmpty()) {
predicates.add(criteriaBuilder.like(root.get("summary"), "%" + request.getSummary() + "%"));
}
if (!request.getAuthor().isEmpty()) {
predicates.add(criteriaBuilder.like(root.get("author"), "%" + request.getAuthor() + "%"));
}
if (!request.getImagePath().isEmpty()) {
predicates.add(criteriaBuilder.like(root.get("imagePath"), "%" + request.getImagePath() + "%"));
}
if (user.getSuperAdmin()) {
// Combine predicates with OR
criteriaQuery.where(criteriaBuilder.or(predicates.toArray(new Predicate[0])));
} else {
// Combine predicates with OR and add tenant condition
Predicate tenantPredicate = criteriaBuilder.equal(root.get("tenant"), user.getUsername());
predicates.add(tenantPredicate);
criteriaQuery.where(criteriaBuilder.and(predicates.toArray(new Predicate[0])));
}
// Execute the query
return entityManager.createQuery(criteriaQuery).getResultList();
}
}

View File

@ -2,9 +2,15 @@ package org.cmh.backend.Utils;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@ControllerAdvice @ControllerAdvice
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
@ -12,4 +18,17 @@ public class GlobalExceptionHandler {
public ResponseEntity<Object> handleJwtInvalidException(JwtValidationException ex) { public ResponseEntity<Object> handleJwtInvalidException(JwtValidationException ex) {
return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
} }
@ExceptionHandler(MissingServletRequestParameterException.class)
public ResponseEntity<Map<String, String>> handleMissingServletRequestParameterException(MissingServletRequestParameterException ex) {
HashMap<String, String> response = new HashMap<>();
response.put("error", ex.getMessage());
response.put("stackTrace", Arrays.toString(ex.getStackTrace()));
return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(HttpMessageNotReadableException.class)
public ResponseEntity<String> handleHttpMessageNotReadableException(HttpMessageNotReadableException ex) {
return new ResponseEntity<>(ex.getMessage(), HttpStatus.BAD_REQUEST);
}
} }

View File

@ -1,5 +1,6 @@
package org.cmh.backend.Utils; package org.cmh.backend.Utils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -7,14 +8,26 @@ import org.springframework.stereotype.Component;
@Aspect @Aspect
@Component @Component
public class JwtVerifyAspect { public class JwtVerifyAspect {
@Before("@annotation(JwtVerify) && args(request,..)") @Before("@annotation(JwtVerify)&&args(..)")
public void verifyJwtToken(Object request) throws JwtValidationException { public void verifyJwtToken(JoinPoint joinPoint) throws JwtValidationException {
if (request instanceof JwtRequest) { Object[] args = joinPoint.getArgs();
String token = ((JwtRequest) request).getToken(); for (Object arg : args) {
if (arg instanceof JwtRequest jwtRequest) {
String token = jwtRequest.getToken();
if (!JwtUtil.isTokenValid(token)) { if (!JwtUtil.isTokenValid(token)) {
throw new JwtValidationException("JWT token is invalid"); throw new JwtValidationException("请求未正确携带身份令牌");
}
return; // 只接受第一个 JwtRequest 对象收到后不再校验其他参数
}
// JWTRequest对象优先否则再检查其他字符串参数
if (arg instanceof String token){
if (JwtUtil.isTokenValid(token)){
// 验证成功就直接退出
return;
} }
} }
} }
throw new JwtValidationException("请求未正确携带身份令牌");
}
} }

View File

@ -1,13 +1,109 @@
package org.cmh.backend.authentication.controller; package org.cmh.backend.authentication.controller;
import org.springframework.web.bind.annotation.GetMapping; import org.cmh.backend.Utils.JwtUtil;
import org.springframework.web.bind.annotation.RestController; import org.cmh.backend.Utils.JwtVerify;
import org.cmh.backend.authentication.dto.*;
import org.cmh.backend.authentication.model.UserHS;
import org.cmh.backend.authentication.service.UserService;
import org.cmh.backend.authentication.service.VerificationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController @RestController
class AuthenticationController { class AuthenticationController {
@Autowired
private UserService userService;
@Autowired
private VerificationCodeService verificationCodeService;
@GetMapping("/hello") @GetMapping("/hello")
public String hello() { public String hello() {
return "Hello SpringBoot!"; return "Hello SpringBoot!";
} }
@PostMapping("/register")
public ResponseEntity<RegisterResponse> register(@RequestBody RegisterRequest request) {
try {
boolean isRegistered = userService.registerUser(request);
if (isRegistered) {
return new ResponseEntity<>(new RegisterResponse("注册成功"), HttpStatus.OK);
} else {
return new ResponseEntity<>(new RegisterResponse("注册失败:用户已存在"), HttpStatus.BAD_REQUEST);
}
} catch (IllegalArgumentException e) {
return new ResponseEntity<>(new RegisterResponse("注册失败:输入格式有误"), HttpStatus.BAD_REQUEST);
} catch (Exception e) {
return new ResponseEntity<>(new RegisterResponse("注册失败:服务器错误"), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@PostMapping("/login")
public ResponseEntity<LoginResponse> login(@RequestBody LoginRequest loginRequest) {
boolean isValidUser = userService.loginUser(loginRequest.getUsername(), loginRequest.getPassword());
if (isValidUser) {
return new ResponseEntity<>(new LoginResponse("登录成功", JwtUtil.generateToken(loginRequest.getUsername())), HttpStatus.OK);
} else {
return new ResponseEntity<>(new LoginResponse("用户名或密码错误", null), HttpStatus.UNAUTHORIZED);
}
}
@GetMapping("/userProfile")
public ResponseEntity<UserProfileResponse> getUserProfile(@RequestParam String token) {
if (JwtUtil.isTokenValid(token)) {
UserHS user = userService.getUserByUsername(JwtUtil.extractUsername(token));
if (user != null) {
UserProfileResponse response = new UserProfileResponse(
user.getUsername(),
user.getNickname(),
user.getGender(),
user.getPhoneNumber(),
user.getEmail(),
user.getDepartment(),
user.getRole(),
user.getCreatedAt()
);
if (user.getSuperAdmin()) {
response.setDepartment("超级管理员");
response.setRole("超级管理员");
}
return new ResponseEntity<>(response, HttpStatus.OK);
}
}
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
@PostMapping("/manageUserProfile")
@JwtVerify
public ResponseEntity<Object> manageUserProfile(@RequestBody ManageUserProfileRequest userProfileRequest) {
String username = JwtUtil.extractUsername(userProfileRequest.getToken());
boolean succeeded = userService.updateUserProfile(username, userProfileRequest);
if (succeeded) {
return new ResponseEntity<>(HttpStatus.OK);
}
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
@PostMapping("/changePassword")
@JwtVerify
public ResponseEntity<Object> changePassword(@RequestBody ChangePasswordRequest changePasswordRequest) {
if (userService.changePassword(JwtUtil.extractUsername(changePasswordRequest.getToken()), changePasswordRequest)) {
return new ResponseEntity<>(HttpStatus.OK);
}
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
@GetMapping("/getVerificationCode")
public ResponseEntity<VerificationCodeResponse> getVerificationCode() {
return new ResponseEntity<>(verificationCodeService.provideVerificationCode(), HttpStatus.OK);
}
} }

View File

@ -1,23 +0,0 @@
package org.cmh.backend.authentication.controller;
import org.cmh.backend.authentication.model.User;
import org.cmh.backend.authentication.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/users")
public class UserController {
@Autowired
private UserService userService;
@GetMapping("/{username}")
public ResponseEntity<User> getUser(@PathVariable String username) {
User user = userService.getUserByUsername(username);
return ResponseEntity.ok(user);
}
}

View File

@ -0,0 +1,12 @@
package org.cmh.backend.authentication.dto;
import lombok.Getter;
import lombok.Setter;
import org.cmh.backend.Utils.JwtRequest;
@Getter
@Setter
public class ChangePasswordRequest extends JwtRequest {
private String currentPassword;
private String newPassword;
}

View File

@ -0,0 +1,12 @@
package org.cmh.backend.authentication.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class LoginRequest {
private String username;
private String password;
private String verificationCode;
}

View File

@ -0,0 +1,13 @@
package org.cmh.backend.authentication.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class LoginResponse {
private String message;
private String token;
}

View File

@ -0,0 +1,16 @@
package org.cmh.backend.authentication.dto;
import lombok.Getter;
import lombok.Setter;
import org.cmh.backend.Utils.JwtRequest;
@Getter
@Setter
public class ManageUserProfileRequest extends JwtRequest {
private String nickname;
private String gender;
private String phoneNumber;
private String email;
private String department;
private String role;
}

View File

@ -0,0 +1,13 @@
package org.cmh.backend.authentication.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class RegisterRequest {
private String username;
private String password;
private String phoneNumber;
private String verificationCode;
}

View File

@ -0,0 +1,12 @@
package org.cmh.backend.authentication.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class RegisterResponse {
private String message;
}

View File

@ -0,0 +1,21 @@
package org.cmh.backend.authentication.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
@AllArgsConstructor
public class UserProfileResponse {
private String username;
private String nickname;
private String gender;
private String phoneNumber;
private String email;
private String department;
private String role;
private LocalDateTime createdAt;
}

View File

@ -0,0 +1,13 @@
package org.cmh.backend.authentication.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class VerificationCodeResponse {
private String code;
private String path;
}

View File

@ -1,39 +0,0 @@
package org.cmh.backend.authentication.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
private String password;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

View File

@ -0,0 +1,29 @@
package org.cmh.backend.authentication.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
@Entity
public class UserHS {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
private String password;
private String nickname;
private String gender;
private String phoneNumber;
private String email;
private String department;
private String role;
private LocalDateTime createdAt;
private Boolean superAdmin = false;
}

View File

@ -1,8 +1,8 @@
package org.cmh.backend.authentication.repository; package org.cmh.backend.authentication.repository;
import org.cmh.backend.authentication.model.User; import org.cmh.backend.authentication.model.UserHS;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository<User, Long> { public interface UserRepository extends JpaRepository<UserHS, Long> {
User findByUsername(String username); UserHS findByUsername(String username);
} }

View File

@ -1,16 +1,117 @@
package org.cmh.backend.authentication.service; package org.cmh.backend.authentication.service;
import org.cmh.backend.authentication.model.User; import org.cmh.backend.authentication.dto.ChangePasswordRequest;
import org.cmh.backend.authentication.dto.ManageUserProfileRequest;
import org.cmh.backend.authentication.dto.RegisterRequest;
import org.cmh.backend.authentication.model.UserHS;
import org.cmh.backend.authentication.repository.UserRepository; import org.cmh.backend.authentication.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.regex.Pattern;
@Service @Service
public class UserService { public class UserService {
@Autowired @Autowired
private UserRepository userRepository; private UserRepository userRepository;
public User getUserByUsername(String username) { private final PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
public UserHS getUserByUsername(String username) {
return userRepository.findByUsername(username); return userRepository.findByUsername(username);
} }
public boolean registerUser(RegisterRequest request) {
String username = request.getUsername();
String password = request.getPassword();
String phoneNumber = request.getPhoneNumber();
// 验证用户名是否已存在
if (userRepository.findByUsername(username) != null) {
return false; // 用户已存在
}
// 验证输入格式
if (!isValidUsername(username) || !isValidPassword(password) || !isValidContactInfo(phoneNumber)) {
throw new IllegalArgumentException();
}
// 加密密码
String encodedPassword = passwordEncoder.encode(password);
// 创建新用户
UserHS newUser = new UserHS();
newUser.setUsername(username);
newUser.setPassword(encodedPassword);
newUser.setPhoneNumber(phoneNumber);
newUser.setCreatedAt(LocalDateTime.now());
userRepository.save(newUser);
return true;
}
public boolean loginUser(String username, String password) {
UserHS user = userRepository.findByUsername(username);
return user != null && passwordEncoder.matches(password, user.getPassword());
}
public boolean updateUserProfile(String username, ManageUserProfileRequest request) {
UserHS user = userRepository.findByUsername(username);
if (user != null) {
user.setNickname(request.getNickname());
user.setGender(request.getGender());
user.setPhoneNumber(request.getPhoneNumber());
user.setEmail(request.getEmail());
user.setDepartment(request.getDepartment());
user.setRole(request.getRole());
try {
userRepository.save(user);
} catch (Exception e) {
return false;
}
return true;
} else {
return false;
}
}
public boolean changePassword(String username, ChangePasswordRequest request) {
UserHS user = userRepository.findByUsername(username);
if (user != null) {
if (passwordEncoder.matches(request.getCurrentPassword(), user.getPassword())) {
if (isValidPassword(request.getNewPassword())) {
String encodedPassword = passwordEncoder.encode(request.getNewPassword());
user.setPassword(encodedPassword);
try {
userRepository.save(user);
} catch (Exception e) {
return false;
}
return true;
}
}
}
return false;
}
// 验证用户名格式
private boolean isValidUsername(String username) {
return username != null && username.length() >= 3 && username.length() <= 20;
}
// 验证密码格式
private boolean isValidPassword(String password) {
return password != null && password.length() >= 4;
}
// 验证联系方式格式假设为电话号码
private boolean isValidContactInfo(String contactInfo) {
String regex = "^\\+?[0-9. ()-]{7,25}$"; // 电话号码验证
return contactInfo != null && Pattern.matches(regex, contactInfo);
}
} }

View File

@ -0,0 +1,51 @@
package org.cmh.backend.authentication.service;
import jakarta.annotation.PostConstruct;
import lombok.Getter;
import org.cmh.backend.authentication.dto.VerificationCodeResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Stream;
@Service
public class VerificationCodeService {
@Value("${verification.code.images.path}")
private String verificationCodeImagesPath;
@Getter
private List<String> verificationCodeList = new ArrayList<>();
@PostConstruct
public void init() {
loadVerificationCodeImages();
}
private void loadVerificationCodeImages() {
try (Stream<Path> paths = Files.list(Paths.get(verificationCodeImagesPath))) {
paths.filter(path -> path.toString().endsWith(".png"))
.forEach(path -> verificationCodeList.add(path.getFileName().toString()));
} catch (IOException e) {
e.printStackTrace();
}
}
public VerificationCodeResponse provideVerificationCode() {
if (verificationCodeList.isEmpty()) {
return null;
}
Random random = new Random();
int code = random.nextInt(random.nextInt(verificationCodeList.size()));
String selectedCode = verificationCodeList.get(code);
return new VerificationCodeResponse(selectedCode.split("\\.")[0], "/verificationCodeImages/" + selectedCode);
}
}

View File

@ -20,5 +20,10 @@ spring.datasource.hikari.connection-timeout=30000
server.servlet.encoding.enabled=true server.servlet.encoding.enabled=true
server.servlet.encoding.force=true server.servlet.encoding.force=true
server.servlet.encoding.charset=utf-8 server.servlet.encoding.charset=utf-8
# verificationCode
verification.code.images.path=src/main/resources/static/verificationCodeImages
# set the max size of a single file
spring.servlet.multipart.max-file-size=50MB
# set the max size of the total request
spring.servlet.multipart.max-request-size=50MB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Some files were not shown because too many files have changed in this diff Show More