查询忙闲信息接口调整
This commit is contained in:
@@ -12,8 +12,10 @@ import lombok.Data;
|
||||
@Data
|
||||
@ApiModel
|
||||
public class GetFreeBusyListReq {
|
||||
@ApiModelProperty("查询日期")
|
||||
private String queryDate;
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startDate;
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endDate;
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerId;
|
||||
@ApiModelProperty("面试官ID(如果该字段传了,就查询该面试官的日程忙闲信息,否则查询加盟商对应的面试官的信息)")
|
||||
|
||||
@@ -39,7 +39,8 @@ public class FeiShuServiceImpl implements FeiShuService {
|
||||
@Override
|
||||
public GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request) throws ApiException {
|
||||
GetFreeBusyListVO freeBusyListVO = new GetFreeBusyListVO();
|
||||
String queryDate = request.getQueryDate();//查询日期
|
||||
String startDate = request.getStartDate();//开始日期
|
||||
String endDate = request.getEndDate();//结束日期
|
||||
String partnerId = request.getPartnerId();//加盟商用户ID
|
||||
String interviewerId = request.getInterviewerId();//面试官ID
|
||||
//如果加盟商用户ID为空且面试官ID为空,返回错误信息
|
||||
@@ -63,13 +64,9 @@ public class FeiShuServiceImpl implements FeiShuService {
|
||||
DateTime startDateTime = null;
|
||||
DateTime endDateTime = null;
|
||||
|
||||
//如果查询时间为空,取明天
|
||||
if (StringUtils.isEmpty(queryDate)) {
|
||||
startDateTime = DateUtil.beginOfDay(DateUtil.tomorrow());
|
||||
endDateTime = DateUtil.endOfDay(DateUtil.tomorrow());
|
||||
} else {
|
||||
startDateTime = DateUtil.beginOfDay(DateUtil.parse(queryDate));
|
||||
endDateTime = DateUtil.endOfDay(DateUtil.parse(queryDate));
|
||||
if (!StringUtils.isEmpty(startDate)&&!StringUtils.isEmpty(endDate)) {
|
||||
startDateTime = DateUtil.beginOfDay(DateUtil.parse(startDate));
|
||||
endDateTime = DateUtil.endOfDay(DateUtil.parse(endDate));
|
||||
}
|
||||
if (startDateTime.isAfter(endDateTime)) {
|
||||
throw new ServiceException(ErrorCodeEnum.DATE_PARAMS_IS_ERROR);
|
||||
|
||||
@@ -2,13 +2,10 @@ package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.GetFreeBusyListReq;
|
||||
import com.cool.store.request.GetInterviewListReq;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.FeiShuService;
|
||||
import com.cool.store.vo.interview.GetFreeBusyListVO;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-16 13:06
|
||||
* @Description:
|
||||
*/
|
||||
@Api(tags = "飞书相关接口")
|
||||
@RestController
|
||||
@RequestMapping({"/feishu"})
|
||||
public class FeiShuController {
|
||||
|
||||
@Autowired
|
||||
private FeiShuService feiShuService;
|
||||
@PostMapping("/calendar/freebusy/list")
|
||||
@PostMapping("/interviewer/freebusy/list")
|
||||
@ApiOperation("查询日程忙闲信息")
|
||||
public ResponseResult<GetFreeBusyListVO> getFreeBusyList(@RequestBody GetFreeBusyListReq request) throws ApiException {
|
||||
GetFreeBusyListVO getFreeBusyListVO= feiShuService.getFreeBusyList(request);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user