All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.github.foxnic.web.system.controller.CodeExampleController Maven / Gradle / Ivy

There is a newer version: 1.7.1.RELEASE
Show newest version
package org.github.foxnic.web.system.controller;


import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.github.foxnic.api.error.ErrorDesc;
import com.github.foxnic.api.swagger.ApiParamSupport;
import com.github.foxnic.api.swagger.InDoc;
import com.github.foxnic.api.transter.Result;
import com.github.foxnic.dao.data.PagedList;
import com.github.foxnic.dao.data.SaveMode;
import com.github.foxnic.dao.entity.ReferCause;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.github.foxnic.web.domain.system.CodeExample;
import org.github.foxnic.web.domain.system.CodeExampleVO;
import org.github.foxnic.web.domain.system.meta.CodeExampleMeta;
import org.github.foxnic.web.domain.system.meta.CodeExampleVOMeta;
import org.github.foxnic.web.framework.sentinel.SentinelExceptionUtil;
import org.github.foxnic.web.framework.web.SuperController;
import org.github.foxnic.web.proxy.system.CodeExampleServiceProxy;
import org.github.foxnic.web.system.service.ICodeExampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 

* 代码生成示例主接口控制器 *

* @author 李方捷 , [email protected] * @since 2022-10-26 09:22:50 */ @InDoc @Api(tags = "代码生成示例主") @RestController("SysCodeExampleController") public class CodeExampleController extends SuperController { @Autowired private ICodeExampleService codeExampleService; /** * 添加代码生成示例主 */ @ApiOperation(value = "添加代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "ID" , required = true , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.NAME , value = "单行文本" , required = false , dataTypeClass=String.class , example = "ZZ"), @ApiImplicitParam(name = CodeExampleVOMeta.NOTES , value = "多行文本" , required = false , dataTypeClass=String.class , example = "XXX"), @ApiImplicitParam(name = CodeExampleVOMeta.IMAGE_ID , value = "图片上传" , required = false , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.FILE_IDS , value = "多文件上传" , required = false , dataTypeClass=String.class , example = "CC"), @ApiImplicitParam(name = CodeExampleVOMeta.AREA , value = "整数输入" , required = false , dataTypeClass=Integer.class , example = "10"), @ApiImplicitParam(name = CodeExampleVOMeta.WEIGHT , value = "小数输入" , required = false , dataTypeClass=Double.class , example = "12.0"), @ApiImplicitParam(name = CodeExampleVOMeta.VALID , value = "逻辑值" , required = false , dataTypeClass=Integer.class , example = "0"), @ApiImplicitParam(name = CodeExampleVOMeta.BUTTON_INPUT , value = "对话框" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_ENUM , value = "单选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_DICT , value = "单选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_ENUM , value = "复选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_DICT , value = "复选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_ENUM , value = "选择框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_DICT , value = "选择框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RESOURCE_ID , value = "选择框(查询)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.BIRTHDAY , value = "日期" , required = false , dataTypeClass=Date.class , example = "2021-08-23 12:00:00"), @ApiImplicitParam(name = CodeExampleVOMeta.WORK_TIME , value = "工作时间" , required = false , dataTypeClass=Date.class), }) @ApiParamSupport(ignoreDBTreatyProperties = true, ignoreDefaultVoProperties = true , ignorePrimaryKey = true) @ApiOperationSupport(order=1 , author="李方捷 , [email protected]") @SentinelResource(value = CodeExampleServiceProxy.INSERT , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.INSERT) public Result insert(CodeExampleVO codeExampleVO) { Result result=codeExampleService.insert(codeExampleVO,false); return result; } /** * 删除代码生成示例主 */ @ApiOperation(value = "删除代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "ID" , required = true , dataTypeClass=String.class , example = "1") }) @ApiOperationSupport(order=2 , author="李方捷 , [email protected]") @SentinelResource(value = CodeExampleServiceProxy.DELETE , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.DELETE) public Result deleteById(String id) { this.validator().asserts(id).require("缺少id值"); if(this.validator().failure()) { return this.validator().getFirstResult(); } // 引用校验 ReferCause cause = codeExampleService.hasRefers(id); // 判断是否可以删除 this.validator().asserts(cause.hasRefer()).requireEqual("不允许删除当前记录:"+cause.message(),false); if(this.validator().failure()) { return this.validator().getFirstResult(); } Result result=codeExampleService.deleteByIdLogical(id); return result; } /** * 批量删除代码生成示例主
* 联合主键时,请自行调整实现 */ @ApiOperation(value = "批量删除代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.IDS , value = "主键清单" , required = true , dataTypeClass=List.class , example = "[1,3,4]") }) @ApiOperationSupport(order=3 , author="李方捷 , [email protected]") @SentinelResource(value = CodeExampleServiceProxy.DELETE_BY_IDS , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.DELETE_BY_IDS) public Result deleteByIds(List ids) { // 参数校验 this.validator().asserts(ids).require("缺少ids参数"); if(this.validator().failure()) { return this.validator().getFirstResult(); } // 查询引用 Map causeMap = codeExampleService.hasRefers(ids); // 收集可以删除的ID值 List canDeleteIds = new ArrayList<>(); for (Map.Entry e : causeMap.entrySet()) { if (!e.getValue().hasRefer()) { canDeleteIds.add(e.getKey()); } } // 执行删除 if (canDeleteIds.isEmpty()) { // 如果没有一行可以被删除 return ErrorDesc.failure().message("无法删除您选中的数据行"); } else if (canDeleteIds.size() == ids.size()) { // 如果全部可以删除 Result result=codeExampleService.deleteByIdsLogical(canDeleteIds); return result; } else if (canDeleteIds.size()>0 && canDeleteIds.size() < ids.size()) { // 如果部分行可以删除 Result result=codeExampleService.deleteByIdsLogical(canDeleteIds); if (result.failure()) { return result; } else { return ErrorDesc.success().message("已删除 " + canDeleteIds.size() + " 行,但另有 " + (ids.size() - canDeleteIds.size()) + " 行数据无法删除").messageLevel4Confirm(); } } else { // 理论上,这个分支不存在 return ErrorDesc.success().message("数据删除未处理"); } } /** * 更新代码生成示例主 */ @ApiOperation(value = "更新代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "ID" , required = true , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.NAME , value = "单行文本" , required = false , dataTypeClass=String.class , example = "ZZ"), @ApiImplicitParam(name = CodeExampleVOMeta.NOTES , value = "多行文本" , required = false , dataTypeClass=String.class , example = "XXX"), @ApiImplicitParam(name = CodeExampleVOMeta.IMAGE_ID , value = "图片上传" , required = false , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.FILE_IDS , value = "多文件上传" , required = false , dataTypeClass=String.class , example = "CC"), @ApiImplicitParam(name = CodeExampleVOMeta.AREA , value = "整数输入" , required = false , dataTypeClass=Integer.class , example = "10"), @ApiImplicitParam(name = CodeExampleVOMeta.WEIGHT , value = "小数输入" , required = false , dataTypeClass=Double.class , example = "12.0"), @ApiImplicitParam(name = CodeExampleVOMeta.VALID , value = "逻辑值" , required = false , dataTypeClass=Integer.class , example = "0"), @ApiImplicitParam(name = CodeExampleVOMeta.BUTTON_INPUT , value = "对话框" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_ENUM , value = "单选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_DICT , value = "单选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_ENUM , value = "复选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_DICT , value = "复选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_ENUM , value = "选择框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_DICT , value = "选择框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RESOURCE_ID , value = "选择框(查询)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.BIRTHDAY , value = "日期" , required = false , dataTypeClass=Date.class , example = "2021-08-23 12:00:00"), @ApiImplicitParam(name = CodeExampleVOMeta.WORK_TIME , value = "工作时间" , required = false , dataTypeClass=Date.class), }) @ApiParamSupport(ignoreDBTreatyProperties = true, ignoreDefaultVoProperties = true) @ApiOperationSupport( order=4 , author="李方捷 , [email protected]" , ignoreParameters = { CodeExampleVOMeta.PAGE_INDEX , CodeExampleVOMeta.PAGE_SIZE , CodeExampleVOMeta.SEARCH_FIELD , CodeExampleVOMeta.FUZZY_FIELD , CodeExampleVOMeta.SEARCH_VALUE , CodeExampleVOMeta.DIRTY_FIELDS , CodeExampleVOMeta.SORT_FIELD , CodeExampleVOMeta.SORT_TYPE , CodeExampleVOMeta.IDS } ) @SentinelResource(value = CodeExampleServiceProxy.UPDATE , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.UPDATE) public Result update(CodeExampleVO codeExampleVO) { Result result=codeExampleService.update(codeExampleVO,SaveMode.DIRTY_OR_NOT_NULL_FIELDS,false); return result; } /** * 保存代码生成示例主 */ @ApiOperation(value = "保存代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "ID" , required = true , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.NAME , value = "单行文本" , required = false , dataTypeClass=String.class , example = "ZZ"), @ApiImplicitParam(name = CodeExampleVOMeta.NOTES , value = "多行文本" , required = false , dataTypeClass=String.class , example = "XXX"), @ApiImplicitParam(name = CodeExampleVOMeta.IMAGE_ID , value = "图片上传" , required = false , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.FILE_IDS , value = "多文件上传" , required = false , dataTypeClass=String.class , example = "CC"), @ApiImplicitParam(name = CodeExampleVOMeta.AREA , value = "整数输入" , required = false , dataTypeClass=Integer.class , example = "10"), @ApiImplicitParam(name = CodeExampleVOMeta.WEIGHT , value = "小数输入" , required = false , dataTypeClass=Double.class , example = "12.0"), @ApiImplicitParam(name = CodeExampleVOMeta.VALID , value = "逻辑值" , required = false , dataTypeClass=Integer.class , example = "0"), @ApiImplicitParam(name = CodeExampleVOMeta.BUTTON_INPUT , value = "对话框" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_ENUM , value = "单选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_DICT , value = "单选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_ENUM , value = "复选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_DICT , value = "复选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_ENUM , value = "选择框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_DICT , value = "选择框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RESOURCE_ID , value = "选择框(查询)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.BIRTHDAY , value = "日期" , required = false , dataTypeClass=Date.class , example = "2021-08-23 12:00:00"), @ApiImplicitParam(name = CodeExampleVOMeta.WORK_TIME , value = "工作时间" , required = false , dataTypeClass=Date.class), }) @ApiParamSupport(ignoreDBTreatyProperties = true, ignoreDefaultVoProperties = true) @ApiOperationSupport(order=5 , ignoreParameters = { CodeExampleVOMeta.PAGE_INDEX , CodeExampleVOMeta.PAGE_SIZE , CodeExampleVOMeta.SEARCH_FIELD , CodeExampleVOMeta.FUZZY_FIELD , CodeExampleVOMeta.SEARCH_VALUE , CodeExampleVOMeta.DIRTY_FIELDS , CodeExampleVOMeta.SORT_FIELD , CodeExampleVOMeta.SORT_TYPE , CodeExampleVOMeta.IDS } ) @SentinelResource(value = CodeExampleServiceProxy.SAVE , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.SAVE) public Result save(CodeExampleVO codeExampleVO) { Result result=codeExampleService.save(codeExampleVO,SaveMode.DIRTY_OR_NOT_NULL_FIELDS,false); return result; } /** * 获取代码生成示例主 */ @ApiOperation(value = "获取代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "主键" , required = true , dataTypeClass=String.class , example = "1"), }) @ApiOperationSupport(order=6 , author="李方捷 , [email protected]") @SentinelResource(value = CodeExampleServiceProxy.GET_BY_ID , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.GET_BY_ID) public Result getById(String id) { Result result=new Result<>(); CodeExample codeExample=codeExampleService.getById(id); // join 关联的对象 codeExampleService.dao().fill(codeExample) .with(CodeExampleMeta.RESOURZE) .with(CodeExampleMeta.ROLES) .execute(); result.success(true).data(codeExample); return result; } /** * 批量获取代码生成示例主
* 联合主键时,请自行调整实现 */ @ApiOperation(value = "批量获取代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.IDS , value = "主键清单" , required = true , dataTypeClass=List.class , example = "[1,3,4]") }) @ApiOperationSupport(order=3 , author="李方捷 , [email protected]") @SentinelResource(value = CodeExampleServiceProxy.GET_BY_IDS , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.GET_BY_IDS) public Result> getByIds(List ids) { Result> result=new Result<>(); List list=codeExampleService.queryListByIds(ids); result.success(true).data(list); return result; } /** * 查询代码生成示例主 */ @ApiOperation(value = "查询代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "ID" , required = true , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.NAME , value = "单行文本" , required = false , dataTypeClass=String.class , example = "ZZ"), @ApiImplicitParam(name = CodeExampleVOMeta.NOTES , value = "多行文本" , required = false , dataTypeClass=String.class , example = "XXX"), @ApiImplicitParam(name = CodeExampleVOMeta.IMAGE_ID , value = "图片上传" , required = false , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.FILE_IDS , value = "多文件上传" , required = false , dataTypeClass=String.class , example = "CC"), @ApiImplicitParam(name = CodeExampleVOMeta.AREA , value = "整数输入" , required = false , dataTypeClass=Integer.class , example = "10"), @ApiImplicitParam(name = CodeExampleVOMeta.WEIGHT , value = "小数输入" , required = false , dataTypeClass=Double.class , example = "12.0"), @ApiImplicitParam(name = CodeExampleVOMeta.VALID , value = "逻辑值" , required = false , dataTypeClass=Integer.class , example = "0"), @ApiImplicitParam(name = CodeExampleVOMeta.BUTTON_INPUT , value = "对话框" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_ENUM , value = "单选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_DICT , value = "单选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_ENUM , value = "复选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_DICT , value = "复选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_ENUM , value = "选择框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_DICT , value = "选择框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RESOURCE_ID , value = "选择框(查询)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.BIRTHDAY , value = "日期" , required = false , dataTypeClass=Date.class , example = "2021-08-23 12:00:00"), @ApiImplicitParam(name = CodeExampleVOMeta.WORK_TIME , value = "工作时间" , required = false , dataTypeClass=Date.class), }) @ApiOperationSupport(order=5 , author="李方捷 , [email protected]" , ignoreParameters = { CodeExampleVOMeta.PAGE_INDEX , CodeExampleVOMeta.PAGE_SIZE } ) @SentinelResource(value = CodeExampleServiceProxy.QUERY_LIST , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.QUERY_LIST) public Result> queryList(CodeExampleVO sample) { Result> result=new Result<>(); List list=codeExampleService.queryList(sample); result.success(true).data(list); return result; } /** * 分页查询代码生成示例主 */ @ApiOperation(value = "分页查询代码生成示例主") @ApiImplicitParams({ @ApiImplicitParam(name = CodeExampleVOMeta.ID , value = "ID" , required = true , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.NAME , value = "单行文本" , required = false , dataTypeClass=String.class , example = "ZZ"), @ApiImplicitParam(name = CodeExampleVOMeta.NOTES , value = "多行文本" , required = false , dataTypeClass=String.class , example = "XXX"), @ApiImplicitParam(name = CodeExampleVOMeta.IMAGE_ID , value = "图片上传" , required = false , dataTypeClass=String.class , example = "1"), @ApiImplicitParam(name = CodeExampleVOMeta.FILE_IDS , value = "多文件上传" , required = false , dataTypeClass=String.class , example = "CC"), @ApiImplicitParam(name = CodeExampleVOMeta.AREA , value = "整数输入" , required = false , dataTypeClass=Integer.class , example = "10"), @ApiImplicitParam(name = CodeExampleVOMeta.WEIGHT , value = "小数输入" , required = false , dataTypeClass=Double.class , example = "12.0"), @ApiImplicitParam(name = CodeExampleVOMeta.VALID , value = "逻辑值" , required = false , dataTypeClass=Integer.class , example = "0"), @ApiImplicitParam(name = CodeExampleVOMeta.BUTTON_INPUT , value = "对话框" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_ENUM , value = "单选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RADIO_DICT , value = "单选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_ENUM , value = "复选框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.CHECK_DICT , value = "复选框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_ENUM , value = "选择框(枚举)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.SELECT_DICT , value = "选择框(字典)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.RESOURCE_ID , value = "选择框(查询)" , required = false , dataTypeClass=String.class), @ApiImplicitParam(name = CodeExampleVOMeta.BIRTHDAY , value = "日期" , required = false , dataTypeClass=Date.class , example = "2021-08-23 12:00:00"), @ApiImplicitParam(name = CodeExampleVOMeta.WORK_TIME , value = "工作时间" , required = false , dataTypeClass=Date.class), }) @ApiOperationSupport(order=8 , author="李方捷 , [email protected]") @SentinelResource(value = CodeExampleServiceProxy.QUERY_PAGED_LIST , blockHandlerClass = { SentinelExceptionUtil.class } , blockHandler = SentinelExceptionUtil.HANDLER ) @PostMapping(CodeExampleServiceProxy.QUERY_PAGED_LIST) public Result> queryPagedList(CodeExampleVO sample) { Result> result=new Result<>(); PagedList list=codeExampleService.queryPagedList(sample,sample.getPageSize(),sample.getPageIndex()); // join 关联的对象 codeExampleService.dao().fill(list) .with(CodeExampleMeta.RESOURZE) .with(CodeExampleMeta.ROLES) .execute(); result.success(true).data(list); return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy