Commit 4de540efa203ccc245361f73c855873886c21ba4

Authored by 颜惠青
2 parents b510b00d 426d2510

Merge branch 'dev' of http://gitlab1.renniting.cn/JCSS/urbanops into dev

urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/problemtype/AppProblemTypeController.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.app.problemtype;
  2 +
  3 +import com.zteits.urbanops.framework.common.pojo.CommonResult;
  4 +import com.zteits.urbanops.framework.common.util.object.BeanUtils;
  5 +import com.zteits.urbanops.module.garden.controller.admin.problemtype.vo.ProblemTypeRespVO;
  6 +import com.zteits.urbanops.module.garden.dal.dataobject.problemtype.GardenProblemTypeDO;
  7 +import com.zteits.urbanops.module.garden.service.problemtype.GardenProblemTypeService;
  8 +import io.swagger.v3.oas.annotations.Operation;
  9 +import io.swagger.v3.oas.annotations.tags.Tag;
  10 +import jakarta.annotation.Resource;
  11 +import org.springframework.validation.annotation.Validated;
  12 +import org.springframework.web.bind.annotation.GetMapping;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import java.util.List;
  18 +
  19 +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
  20 +
  21 +@Tag(name = "APP - 问题类型")
  22 +@RestController
  23 +@RequestMapping("/app/problem-type")
  24 +@Validated
  25 +public class AppProblemTypeController {
  26 +
  27 + @Resource
  28 + private GardenProblemTypeService gardenProblemTypeService;
  29 +
  30 + @GetMapping("/list-by-parent")
  31 + @Operation(summary = "根据父级编码和层级查询子类型列表(级联下拉用)")
  32 + public CommonResult<List<ProblemTypeRespVO>> getProblemTypeListByParent(
  33 + @RequestParam(value = "parentCode", required = false) String parentCode,
  34 + @RequestParam("level") Integer level) {
  35 + List<GardenProblemTypeDO> list = gardenProblemTypeService.getProblemTypeByParentCode(parentCode, level);
  36 + return success(BeanUtils.toBean(list, ProblemTypeRespVO.class));
  37 + }
  38 +}