|
|
@ -27,6 +27,7 @@ import com.epmet.dto.form.demand.*; |
|
|
|
import com.epmet.dto.result.demand.DemandRecResultDTO; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.service.*; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
@ -42,6 +43,7 @@ import java.util.List; |
|
|
|
* @author generator generator@elink-cn.com |
|
|
|
* @since v1.0.0 2021-11-19 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@RestController |
|
|
|
@RequestMapping("userdemand") |
|
|
|
public class IcUserDemandRecController { |
|
|
@ -94,6 +96,7 @@ public class IcUserDemandRecController { |
|
|
|
@PostMapping("add") |
|
|
|
public Result<DemandRecId> add(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ |
|
|
|
fromDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
fromDTO.setCurrentUserId(tokenDto.getUserId()); |
|
|
|
ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.AddUserShowGroup.class); |
|
|
|
return new Result<DemandRecId>().ok(icUserDemandRecService.add(fromDTO)); |
|
|
|
} |
|
|
@ -109,6 +112,7 @@ public class IcUserDemandRecController { |
|
|
|
@PostMapping("update") |
|
|
|
public Result<DemandRecId> update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ |
|
|
|
fromDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
fromDTO.setCurrentUserId(tokenDto.getUserId()); |
|
|
|
ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.UpdateInternalGroup.class,DemandAddFromDTO.AddUserShowGroup.class); |
|
|
|
return new Result<DemandRecId>().ok(icUserDemandRecService.update(fromDTO)); |
|
|
|
} |
|
|
|