mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 01:25:28 +08:00
h5 动态表单,支持多租户
This commit is contained in:
parent
28efb62743
commit
78fb873d71
@ -1,34 +1,23 @@
|
|||||||
package com.luban.api.controller;
|
package com.luban.api.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.dromara.md.form.api.constant.BaseConstant;
|
import com.dromara.md.form.api.constant.BaseConstant;
|
||||||
import com.dromara.md.form.utils.TenantHelper;
|
import com.dromara.md.form.utils.TenantHelper;
|
||||||
import com.luban.api.convert.WorkConvert;
|
import com.luban.api.dto.H5ProjectContentDTO;
|
||||||
import com.luban.api.dto.WorkCreateDTO;
|
|
||||||
import com.luban.api.dto.WorkQueryDTO;
|
|
||||||
import com.luban.api.dto.WorkUpdateDTO;
|
|
||||||
import com.luban.api.dto.query.H5ProjectQueryDTO;
|
import com.luban.api.dto.query.H5ProjectQueryDTO;
|
||||||
import com.luban.api.entity.H5Project;
|
import com.luban.api.entity.H5Project;
|
||||||
import com.luban.api.entity.Work;
|
|
||||||
import com.luban.api.service.H5ProjectService;
|
import com.luban.api.service.H5ProjectService;
|
||||||
import com.luban.api.service.WorkService;
|
import com.luban.api.service.WorkService;
|
||||||
import com.luban.api.vo.WorkVO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -61,5 +50,34 @@ public class WorkController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建H5项目
|
||||||
|
*
|
||||||
|
* @param request 包含H5项目信息和内容的请求
|
||||||
|
* @return 项目ID
|
||||||
|
*/
|
||||||
|
@Operation(summary = "创建作品:草稿状态")
|
||||||
|
@PostMapping("create")
|
||||||
|
public Long create(@RequestBody H5ProjectController.CreateH5ProjectRequest request) {
|
||||||
|
H5Project h5Project = new H5Project();
|
||||||
|
h5Project.setType(request.getType());
|
||||||
|
h5Project.setTitle(request.getTitle());
|
||||||
|
h5Project.setDescription(request.getDescription());
|
||||||
|
h5Project.setPreviewWidth(request.getPreviewWidth());
|
||||||
|
h5Project.setPreviewHeight(request.getPreviewHeight());
|
||||||
|
h5Project.setContent("{}");
|
||||||
|
h5Project.setStatus(1);
|
||||||
|
h5Project.setCreatedBy(LoginHelper.getUserId());
|
||||||
|
|
||||||
|
H5ProjectContentDTO contentDTO = new H5ProjectContentDTO();
|
||||||
|
contentDTO.setVersion("1");
|
||||||
|
boolean success = h5ProjectService.saveH5ProjectWithContent(h5Project, contentDTO, Collections.singletonList(5L));
|
||||||
|
if (success) {
|
||||||
|
return h5Project.getId();
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("创建项目失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,10 +57,7 @@ tenant:
|
|||||||
enable: true
|
enable: true
|
||||||
# 排除表
|
# 排除表
|
||||||
excludes:
|
excludes:
|
||||||
- sys_menu
|
- h5_group
|
||||||
- sys_tenant
|
|
||||||
- sys_tenant_package
|
|
||||||
- sys_saas_user_role
|
|
||||||
|
|
||||||
# MyBatisPlus配置
|
# MyBatisPlus配置
|
||||||
# https://baomidou.com/config/
|
# https://baomidou.com/config/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user