测试
This commit is contained in:
parent
94e1fa4cb8
commit
93d236bb80
|
@ -37,7 +37,7 @@ public class ProjectController {
|
|||
}
|
||||
|
||||
@GetMapping("/project/header")
|
||||
public BaseResponse projectGetByName(@RequestParam(required = false) String name) {
|
||||
public BaseResponse projectGetByName(@RequestParam String name) {
|
||||
log.info("请求接口[GET]: /project/header");
|
||||
return projectService.getByName(name);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.jsl.oa.model.doData.info.CarouselDO;
|
|||
import com.jsl.oa.model.doData.info.ProjectShowDO;
|
||||
import com.jsl.oa.model.voData.ProjectInfoVO;
|
||||
import com.jsl.oa.utils.BaseResponse;
|
||||
import com.jsl.oa.utils.ErrorCode;
|
||||
import com.jsl.oa.utils.ResultUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -95,6 +97,9 @@ public class ProjectDAO {
|
|||
}
|
||||
|
||||
public BaseResponse getByName(String name) {
|
||||
return projectMapper.getByName(name);
|
||||
if(projectMapper.getByName(name)!=null){
|
||||
return ResultUtil.success(projectMapper.getByName(name));
|
||||
}else return ResultUtil.error(ErrorCode.PROJECT_NOT_EXIST);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,5 +45,5 @@ public interface ProjectMapper {
|
|||
List<ProjectDO> get();
|
||||
|
||||
@Select("select * from organize_oa.oa_project where name=#{name}")
|
||||
BaseResponse getByName(String name);
|
||||
ProjectDO getByName(String name);
|
||||
}
|
||||
|
|
|
@ -171,6 +171,7 @@ public class ProjectServiceImpl implements ProjectService {
|
|||
|
||||
@Override
|
||||
public BaseResponse getByName(String name) {
|
||||
|
||||
return projectDAO.getByName(name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user