package com.epmet.controller; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.IcResiCollectFormDTO; import com.epmet.service.IcResiCollectService; 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 generator generator@elink-cn.com * @since v1.0.0 2022-03-18 */ @RestController @RequestMapping("icresicollect") public class IcResiCollectController { @Autowired private IcResiCollectService icResiCollectService; /** * 居民信息采集_提交 * * @param formDTO * @return */ @NoRepeatSubmit @PostMapping("save") public Result save(@RequestBody IcResiCollectFormDTO formDTO) { //效验数据 ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.AddUserInternalGroup.class); // 内部:internal;外部:external if ("internal".equals(formDTO.getOrigin())) { ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.InternalShowGroup.class); } else if ("external".equals(formDTO.getOrigin())) { ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.ExternalShowGroup.class); } icResiCollectService.save(formDTO); return new Result(); } }