【无标题】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);
    }
}
上一篇:PageInfo介绍及使用


下一篇:LINQ to Entities 不支持指定的类型成员“Date”。