fix&patch: 补丁info-edit,对代码规整修改
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
This commit is contained in:
parent
de99fe1dc5
commit
df143738db
@ -3,7 +3,6 @@ package com.jsl.oa.config.redis;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
|
@ -1,13 +1,10 @@
|
||||
package com.jsl.oa.controllers;
|
||||
|
||||
import com.jsl.oa.common.constant.BusinessConstants;
|
||||
import com.jsl.oa.services.MessageService;
|
||||
import com.jsl.oa.services.impl.MessageServiceImpl;
|
||||
import com.jsl.oa.utils.BaseResponse;
|
||||
import com.jsl.oa.utils.ErrorCode;
|
||||
import com.jsl.oa.utils.JwtUtil;
|
||||
import com.jsl.oa.utils.ResultUtil;
|
||||
import com.jsl.oa.utils.redis.TokenRedisUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@ -36,10 +33,10 @@ public class MessageController {
|
||||
private final MessageService messageService;
|
||||
|
||||
@DeleteMapping("/message/delete")
|
||||
public BaseResponse messageDelete(@RequestParam Long id, HttpServletRequest request){
|
||||
if(id == null){
|
||||
public BaseResponse messageDelete(@RequestParam Long id, HttpServletRequest request) {
|
||||
if (id == null) {
|
||||
return ResultUtil.error(ErrorCode.PARAMETER_ERROR);
|
||||
} else return messageService.messageDelete(id,request);
|
||||
} else return messageService.messageDelete(id, request);
|
||||
}
|
||||
|
||||
@GetMapping("/message/get")
|
||||
@ -47,28 +44,28 @@ public class MessageController {
|
||||
@RequestParam(defaultValue = "10") Long pageSize,
|
||||
HttpServletRequest request,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
|
||||
@DateTimeFormat (pattern = "yyyy-MM-dd") LocalDate end) {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end) {
|
||||
log.info("请求接口[GET]:/message/get");
|
||||
String token = request.getHeader("Authorization").replace("Bearer ", "");
|
||||
Long uid = JwtUtil.getUserId(token);
|
||||
if(uid == null){
|
||||
return ResultUtil.error(ErrorCode.USER_NOT_EXIST);
|
||||
} else return messageService.messageGet(begin,end,page,pageSize,uid);
|
||||
if (uid == null) {
|
||||
return ResultUtil.error(ErrorCode.USER_NOT_EXIST);
|
||||
} else return messageService.messageGet(begin, end, page, pageSize, uid);
|
||||
}
|
||||
|
||||
@GetMapping("/message/get/all")
|
||||
public BaseResponse messageGetAll(@RequestParam(defaultValue = "1") Long page,
|
||||
@RequestParam(defaultValue = "10") Long pageSize,
|
||||
HttpServletRequest request,
|
||||
@RequestParam(defaultValue = "10") Long pageSize,
|
||||
HttpServletRequest request,
|
||||
@RequestParam Long uid,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
|
||||
@DateTimeFormat (pattern = "yyyy-MM-dd") LocalDate end) {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end) {
|
||||
log.info("请求接口[GET]:/message/get/all");
|
||||
String token = request.getHeader("Authorization").replace("Bearer ", "");
|
||||
Long LoginId = JwtUtil.getUserId(token);
|
||||
if(LoginId == null){
|
||||
if (LoginId == null) {
|
||||
return ResultUtil.error(ErrorCode.USER_NOT_EXIST);
|
||||
} else return messageService.messageGetAll(request,begin,end,page,pageSize,LoginId,uid);
|
||||
} else return messageService.messageGetAll(request, begin, end, page, pageSize, LoginId, uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,9 +2,7 @@ package com.jsl.oa.controllers;
|
||||
|
||||
|
||||
import com.jsl.oa.model.voData.NewsAddVO;
|
||||
import com.jsl.oa.model.voData.PermissionEditVO;
|
||||
import com.jsl.oa.services.NewsService;
|
||||
import com.jsl.oa.services.RoleService;
|
||||
import com.jsl.oa.utils.BaseResponse;
|
||||
import com.jsl.oa.utils.ErrorCode;
|
||||
import com.jsl.oa.utils.Processing;
|
||||
@ -37,14 +35,14 @@ public class NewsController {
|
||||
private final NewsService newsService;
|
||||
|
||||
@PostMapping("/news/add")
|
||||
public BaseResponse newsAdd(@RequestBody @Validated NewsAddVO newsAddVO, BindingResult bindingResult, HttpServletRequest request){
|
||||
public BaseResponse newsAdd(@RequestBody @Validated NewsAddVO newsAddVO, BindingResult bindingResult, HttpServletRequest request) {
|
||||
log.info("请求接口[POST]: /news/add");
|
||||
// 判断是否有参数错误
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultUtil.error(ErrorCode.REQUEST_BODY_ERROR, Processing.getValidatedErrorList(bindingResult));
|
||||
}
|
||||
|
||||
return newsService.newsAdd(newsAddVO,request);
|
||||
return newsService.newsAdd(newsAddVO, request);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.jsl.oa.dao;
|
||||
|
||||
import com.jsl.oa.mapper.NewsMapper;
|
||||
import com.jsl.oa.model.doData.NewsDO;
|
||||
import com.jsl.oa.model.voData.NewsAddVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -15,13 +14,13 @@ public class NewsDAO {
|
||||
|
||||
private final NewsMapper newsMapper;
|
||||
|
||||
public void addNews(NewsDO newsVO,Long uid){
|
||||
public void addNews(NewsDO newsVO, Long uid) {
|
||||
log.info("\t> 执行 DAO 层 NewsDAO.addNews 方法");
|
||||
log.info("\t\t> 从 MySQL 获取数据");
|
||||
// 添加新闻数据
|
||||
newsMapper.addNews(newsVO);
|
||||
// 添加作者
|
||||
newsMapper.addNewsUser(uid,newsVO.getId());
|
||||
newsMapper.addNewsUser(uid, newsVO.getId());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.jsl.oa.mapper;
|
||||
|
||||
import com.jsl.oa.model.doData.MessageDO;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
@ -24,6 +23,7 @@ public interface MessageMapper {
|
||||
@Select("select count(*) from organize_oa.oa_message where uid = #{uid}")
|
||||
Long count(Long uid);
|
||||
|
||||
@Select("select * from organize_oa.oa_message where uid = #{uid}") //and created_at between #{begin} and #{end} limit #{start},#{pageSize}")
|
||||
List<MessageDO> page(LocalDate begin,LocalDate end,Long uid, Long start, Long pageSize);
|
||||
@Select("select * from organize_oa.oa_message where uid = #{uid}")
|
||||
//and created_at between #{begin} and #{end} limit #{start},#{pageSize}")
|
||||
List<MessageDO> page(LocalDate begin, LocalDate end, Long uid, Long start, Long pageSize);
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import com.jsl.oa.model.doData.ProjectCuttingDO;
|
||||
import com.jsl.oa.model.doData.ProjectDO;
|
||||
import com.jsl.oa.model.doData.ProjectUserDO;
|
||||
import com.jsl.oa.model.voData.ProjectInfoVO;
|
||||
import com.jsl.oa.utils.BaseResponse;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
@ -61,8 +60,8 @@ public interface ProjectMapper {
|
||||
ProjectCuttingDO getProjectCuttingById(Long id);
|
||||
|
||||
@Select("SELECT * FROM organize_oa.oa_project_user WHERE pid = #{pid} AND uid = #{uid}")
|
||||
ProjectUserDO getProjectUserByPidAndUid(Long pid,Long uid);
|
||||
ProjectUserDO getProjectUserByPidAndUid(Long pid, Long uid);
|
||||
|
||||
@Update("UPDATE organize_oa.oa_project_user SET uid = #{uid} , updated_at = CURRENT_TIMESTAMP WHERE id = #{id}")
|
||||
boolean updateUserForProjectUser(Long uid,Long id);
|
||||
boolean updateUserForProjectUser(Long uid, Long id);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.jsl.oa.model.voData;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
|
@ -1,11 +1,9 @@
|
||||
package com.jsl.oa.model.voData;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Value;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
|
||||
@Data
|
||||
|
@ -5,7 +5,6 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
public class ProjectCuttingEditVO {
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.jsl.oa.model.voData;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
@ -3,9 +3,7 @@ package com.jsl.oa.model.voData;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.jsl.oa.services;
|
||||
|
||||
import com.jsl.oa.model.doData.info.ProjectShowDO;
|
||||
import com.jsl.oa.model.voData.ProjectCuttingAddVO;
|
||||
import com.jsl.oa.model.voData.ProjectCuttingEditVO;
|
||||
import com.jsl.oa.model.voData.ProjectInfoVO;
|
||||
@ -10,13 +9,13 @@ import com.jsl.oa.utils.BaseResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public interface ProjectService {
|
||||
BaseResponse projectAdd(HttpServletRequest request,ProjectInfoVO projectAdd);
|
||||
BaseResponse projectAdd(HttpServletRequest request, ProjectInfoVO projectAdd);
|
||||
|
||||
BaseResponse projectEdit(HttpServletRequest request,ProjectInfoVO projectEdit);
|
||||
BaseResponse projectEdit(HttpServletRequest request, ProjectInfoVO projectEdit);
|
||||
|
||||
BaseResponse projectGetUserInCutting(Long uid);
|
||||
|
||||
BaseResponse projectAddUserForCutting(HttpServletRequest request,Long uid, Long pid);
|
||||
BaseResponse projectAddUserForCutting(HttpServletRequest request, Long uid, Long pid);
|
||||
|
||||
BaseResponse getHeader(Integer id);
|
||||
|
||||
@ -30,7 +29,7 @@ public interface ProjectService {
|
||||
|
||||
BaseResponse getByName(String name);
|
||||
|
||||
BaseResponse projectDelete(HttpServletRequest request,Long id);
|
||||
BaseResponse projectDelete(HttpServletRequest request, Long id);
|
||||
|
||||
BaseResponse addProjectCutting(HttpServletRequest request, ProjectCuttingAddVO projectCuttingAddVO);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user