|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrBase.block; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.aop.SsoAop; | 
|---|
|  |  |  | import com.dy.common.mybatis.envm.Deleted; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponse; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoBa.BaBlock; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoBa.BaBlock; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Operation; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Parameter; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Content; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.responses.ApiResponse; | 
|---|
|  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(path = "all") | 
|---|
|  |  |  | @SsoAop("-1") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<QueryResultVo<List<BaBlock>>> all(){ | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | QueryResultVo<List<BaBlock>> res = this.sv.selectAll() ; | 
|---|
|  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) | 
|---|
|  |  |  | @SsoAop("-1") | 
|---|
|  |  |  | public BaseResponse<QueryResultVo<List<BaBlock>>> some(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<QueryResultVo<List<BaBlock>>> some(@RequestBody QueryVo vo){ | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | QueryResultVo<List<BaBlock>> res = this.sv.selectSome(vo) ; | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(res); | 
|---|
|  |  |  | 
|---|
|  |  |  | schema = @Schema(implementation = BaBlock.class))} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE) | 
|---|
|  |  |  | @SsoAop("-1") | 
|---|
|  |  |  | public BaseResponse<BaBlock> one(@Parameter(description = "实体id", required = true) Long id){ | 
|---|
|  |  |  | //@GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE) | 
|---|
|  |  |  | @GetMapping(path = "one") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<BaBlock> one(Long id){ | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) | 
|---|
|  |  |  | @SsoAop("-1")//@SsoAop(power = "-1") | 
|---|
|  |  |  | public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaBlock po, @Parameter(hidden = true) BindingResult bindingResult){ | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> save(@RequestBody @Valid BaBlock po, BindingResult bindingResult){ | 
|---|
|  |  |  | if(bindingResult != null && bindingResult.hasErrors()){ | 
|---|
|  |  |  | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | po.id = null ; | 
|---|
|  |  |  | po.deleted = Deleted.NO; | 
|---|
|  |  |  | int count; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | count = this.sv.save(po); | 
|---|
|  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) | 
|---|
|  |  |  | @SsoAop("-1")//@SsoAop(power = "-1") | 
|---|
|  |  |  | public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaBlock po, @Parameter(hidden = true) BindingResult bindingResult){ | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> update(@RequestBody @Valid BaBlock po, BindingResult bindingResult){ | 
|---|
|  |  |  | if(bindingResult != null && bindingResult.hasErrors()){ | 
|---|
|  |  |  | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | schema = @Schema(implementation = Boolean.class))} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE) | 
|---|
|  |  |  | @SsoAop("-1")//@SsoAop(power = "-1") | 
|---|
|  |  |  | public BaseResponse<Boolean> delete(@Parameter(description = "实体id", required = true) Long id){ | 
|---|
|  |  |  | //@GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE) | 
|---|
|  |  |  | @GetMapping(path = "delete") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> delete(Long id){ | 
|---|
|  |  |  | if(id == null){ | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("id不能为空") ; | 
|---|
|  |  |  | } | 
|---|