|
@@ -0,0 +1,82 @@
|
|
|
+package com.fjhx.tenant.controller.dict;
|
|
|
+
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fjhx.tenant.entity.dict.dto.DictTenantTypeDto;
|
|
|
+import com.fjhx.tenant.entity.dict.dto.DictTenantTypeSelectDto;
|
|
|
+import com.fjhx.tenant.entity.dict.vo.DictTenantTypeVo;
|
|
|
+import com.fjhx.tenant.service.dict.DictTenantTypeService;
|
|
|
+import com.ruoyi.common.annotation.TenantIgnore;
|
|
|
+import com.ruoyi.common.constant.BaseSourceConstant;
|
|
|
+import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
+import com.ruoyi.common.exception.ServiceException;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+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;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 租户字典 前端控制器 带租户过滤版本
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author
|
|
|
+ * @since 2023-03-30
|
|
|
+ */
|
|
|
+@DS(BaseSourceConstant.BASE)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/dictTenantType1")
|
|
|
+public class DictTenantTypeController1 {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DictTenantTypeService dictTenantTypeService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 租户字典分页
|
|
|
+ */
|
|
|
+ @PostMapping("/page")
|
|
|
+ public Page<DictTenantTypeVo> page(@RequestBody DictTenantTypeSelectDto dto) {
|
|
|
+ return dictTenantTypeService.getPage(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 租户字典明细
|
|
|
+ */
|
|
|
+ @PostMapping("/detail")
|
|
|
+ public DictTenantTypeVo detail(@RequestBody BaseSelectDto dto) {
|
|
|
+ return dictTenantTypeService.detail(dto.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 租户字典新增
|
|
|
+ */
|
|
|
+ @PostMapping("/add")
|
|
|
+ public void add(@Validated @RequestBody DictTenantTypeDto dictTenantTypeDto) {
|
|
|
+ String tenantId = dictTenantTypeDto.getTenantId();
|
|
|
+ if (StrUtil.isBlank(tenantId)) {
|
|
|
+ throw new ServiceException("租户id不能为空");
|
|
|
+ }
|
|
|
+ dictTenantTypeService.add(dictTenantTypeDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 租户字典编辑
|
|
|
+ */
|
|
|
+ @PostMapping("/edit")
|
|
|
+ public void edit(@RequestBody DictTenantTypeDto dictTenantTypeDto) {
|
|
|
+ dictTenantTypeService.edit(dictTenantTypeDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 租户字典删除
|
|
|
+ */
|
|
|
+ @PostMapping("/delete")
|
|
|
+ public void delete(@RequestBody BaseSelectDto dto) {
|
|
|
+ dictTenantTypeService.delete(dto.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+}
|