|
@@ -4,6 +4,8 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
|
|
import com.tourism.common.core.annotation.MyRequestBody;
|
|
|
import com.tourism.common.core.constant.ErrorCodeEnum;
|
|
|
import com.tourism.common.core.object.*;
|
|
|
+import com.tourism.common.core.util.MyCommonUtil;
|
|
|
+import com.tourism.common.core.validator.UpdateGroup;
|
|
|
import com.tourism.webadmin.app.website.dto.TourismBookProjectDto;
|
|
|
import com.tourism.webadmin.app.website.dto.TourismProjectToWebDto;
|
|
|
import com.tourism.webadmin.app.website.service.TourismProjectToWebService;
|
|
@@ -15,6 +17,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
import jakarta.validation.Valid;
|
|
|
import jakarta.validation.constraints.NotNull;
|
|
|
+import jakarta.validation.groups.Default;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -90,6 +93,10 @@ public class TourismProjectToWebController {
|
|
|
*/
|
|
|
@PostMapping("/bookProject")
|
|
|
public ResponseResult<Integer> bookProject(HttpServletRequest request,@MyRequestBody TourismBookProjectDto tourBookInfoDto) {
|
|
|
+ String errorMessage = MyCommonUtil.getModelValidationError(tourBookInfoDto, Default.class, UpdateGroup.class);
|
|
|
+ if (errorMessage != null) {
|
|
|
+ return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
|
|
+ }
|
|
|
Boolean state = tourismProjectToWebService.bookProject(request, tourBookInfoDto);
|
|
|
if(!state){
|
|
|
return ResponseResult.success(2);
|