查询忙闲信息接口调整

This commit is contained in:
俞扬
2023-06-18 17:58:07 +08:00
parent a3c94a6543
commit 439684a85d
4 changed files with 46 additions and 17 deletions

View File

@@ -12,8 +12,10 @@ import lombok.Data;
@Data @Data
@ApiModel @ApiModel
public class GetFreeBusyListReq { public class GetFreeBusyListReq {
@ApiModelProperty("查询日期") @ApiModelProperty("开始时间")
private String queryDate; private String startDate;
@ApiModelProperty("结束时间")
private String endDate;
@ApiModelProperty("加盟商用户ID") @ApiModelProperty("加盟商用户ID")
private String partnerId; private String partnerId;
@ApiModelProperty("面试官ID(如果该字段传了,就查询该面试官的日程忙闲信息,否则查询加盟商对应的面试官的信息)") @ApiModelProperty("面试官ID(如果该字段传了,就查询该面试官的日程忙闲信息,否则查询加盟商对应的面试官的信息)")

View File

@@ -39,7 +39,8 @@ public class FeiShuServiceImpl implements FeiShuService {
@Override @Override
public GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request) throws ApiException { public GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request) throws ApiException {
GetFreeBusyListVO freeBusyListVO = new GetFreeBusyListVO(); GetFreeBusyListVO freeBusyListVO = new GetFreeBusyListVO();
String queryDate = request.getQueryDate();//查询日期 String startDate = request.getStartDate();//开始日期
String endDate = request.getEndDate();//结束日期
String partnerId = request.getPartnerId();//加盟商用户ID String partnerId = request.getPartnerId();//加盟商用户ID
String interviewerId = request.getInterviewerId();//面试官ID String interviewerId = request.getInterviewerId();//面试官ID
//如果加盟商用户ID为空且面试官ID为空返回错误信息 //如果加盟商用户ID为空且面试官ID为空返回错误信息
@@ -63,13 +64,9 @@ public class FeiShuServiceImpl implements FeiShuService {
DateTime startDateTime = null; DateTime startDateTime = null;
DateTime endDateTime = null; DateTime endDateTime = null;
//如果查询时间为空,取明天 if (!StringUtils.isEmpty(startDate)&&!StringUtils.isEmpty(endDate)) {
if (StringUtils.isEmpty(queryDate)) { startDateTime = DateUtil.beginOfDay(DateUtil.parse(startDate));
startDateTime = DateUtil.beginOfDay(DateUtil.tomorrow()); endDateTime = DateUtil.endOfDay(DateUtil.parse(endDate));
endDateTime = DateUtil.endOfDay(DateUtil.tomorrow());
} else {
startDateTime = DateUtil.beginOfDay(DateUtil.parse(queryDate));
endDateTime = DateUtil.endOfDay(DateUtil.parse(queryDate));
} }
if (startDateTime.isAfter(endDateTime)) { if (startDateTime.isAfter(endDateTime)) {
throw new ServiceException(ErrorCodeEnum.DATE_PARAMS_IS_ERROR); throw new ServiceException(ErrorCodeEnum.DATE_PARAMS_IS_ERROR);

View File

@@ -2,13 +2,10 @@ package com.cool.store.controller;
import com.cool.store.exception.ApiException; import com.cool.store.exception.ApiException;
import com.cool.store.request.GetFreeBusyListReq; import com.cool.store.request.GetFreeBusyListReq;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.FeiShuService; import com.cool.store.service.FeiShuService;
import com.cool.store.vo.interview.GetFreeBusyListVO; import com.cool.store.vo.interview.GetFreeBusyListVO;
import com.cool.store.vo.interview.InterviewVO; import io.swagger.annotations.Api;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -16,20 +13,19 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* @Author: young.yu * @Author: young.yu
* @Date: 2023-06-16 13:06 * @Date: 2023-06-16 13:06
* @Description: * @Description:
*/ */
@Api(tags = "飞书相关接口")
@RestController @RestController
@RequestMapping({"/feishu"}) @RequestMapping({"/feishu"})
public class FeiShuController { public class FeiShuController {
@Autowired @Autowired
private FeiShuService feiShuService; private FeiShuService feiShuService;
@PostMapping("/calendar/freebusy/list") @PostMapping("/interviewer/freebusy/list")
@ApiOperation("查询日程忙闲信息") @ApiOperation("查询日程忙闲信息")
public ResponseResult<GetFreeBusyListVO> getFreeBusyList(@RequestBody GetFreeBusyListReq request) throws ApiException { public ResponseResult<GetFreeBusyListVO> getFreeBusyList(@RequestBody GetFreeBusyListReq request) throws ApiException {
GetFreeBusyListVO getFreeBusyListVO= feiShuService.getFreeBusyList(request); GetFreeBusyListVO getFreeBusyListVO= feiShuService.getFreeBusyList(request);

View File

@@ -0,0 +1,34 @@
package com.cool.store.controller;
import com.cool.store.exception.ApiException;
import com.cool.store.request.GetFreeBusyListReq;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.FeiShuService;
import com.cool.store.vo.interview.GetFreeBusyListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: young.yu
* @Date: 2023-06-16 13:06
* @Description:
*/
@Api(tags = "飞书相关接口")
@RestController
@RequestMapping({"/feishu"})
public class FeiShuController {
@Autowired
private FeiShuService feiShuService;
@PostMapping("/interviewer/freebusy/list")
@ApiOperation("查询日程忙闲信息")
public ResponseResult<GetFreeBusyListVO> getFreeBusyList(@RequestBody GetFreeBusyListReq request) throws ApiException {
GetFreeBusyListVO getFreeBusyListVO= feiShuService.getFreeBusyList(request);
return ResponseResult.success(getFreeBusyListVO);
}
}