【无标题】rest
作者:互联网
@RestController public class FieldTemplateController{ @Getter(AccessLevel.NONE) protected FieldTemplateCommon fieldTemplateCommon; @Autowired private FieldTemplateService fieldTemplateService; @GetMapping(value = "qoeQueryFieldTemplate", produces = MediaType.APPLICATION_JSON_VALUE) public Map<String, Object> queryFieldTemplate(FieldTemplateParamQuery fieldQuery) { PageInfo pageInfo = fieldTemplateService.queryByCond(fieldQuery); return ImmutableMap.of("totalCount", pageInfo.getTotal(), "data", pageInfo.getResults()); } @PostMapping(value = "qoeAddFieldTemplate", produces = MediaType.APPLICATION_JSON_VALUE) public FieldTemplateCommon addFieldTemplate(FieldTemplateVo fieTplVo) { fieldTemplateCommon.addFieldTemplate(fieTplVo); return fieldTemplateCommon;
public void queryFieldTemplate() { FieldTemplateParamQuery fieldQuery = new FieldTemplateParamQuery(); fieldQuery.setStart(start); fieldQuery.setLimit(limit); fieldQuery.setXdrId(xdrId); fieldQuery.setFieldTemplateName(fieldTemplateName); fieldQuery.setBusType(busType); PageInfo pageInfo = fieldTemplateCommon.queryByCond(fieldQuery); Map<String, Object> bean = new HashMap<>(); bean.put("totalCount", pageInfo.getTotal()); bean.put("data", pageInfo.getResults()); responseResult(SaUtil.bean2Json(bean)); } /** * 添加字段模板 */ public void addFieldTemplate() { try { FieldTemplateVo fieTplVo = new FieldTemplateVo(); fieTplVo.setXdrId(xdrId); fieTplVo.setFieldTemplateName(fieldTemplateName); fieTplVo.setFieldIdSeq(fieldIdSeq); fieTplVo.setDesc(desc); fieldTemplateCommon.addFieldTemplate(fieTplVo); } catch (Exception e) { throwException(e); } }
标签:rest,pageInfo,addFieldTemplate,fieldQuery,无标题,fieTplVo,public,fieldTemplateCommo 来源: https://blog.csdn.net/as619649246/article/details/123057540