org.hsweb.web.bean.common.QueryParam.where()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.hsweb.web.bean.common.QueryParam.where方法的一些代码示例,展示了QueryParam.where的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryParam.where方法的具体详情如下:
包路径:org.hsweb.web.bean.common.QueryParam
类名称:QueryParam
方法名:where

QueryParam.where介绍

暂无

代码示例

代码示例来源:origin: org.hsweb/hsweb-web-service-simple

/**
 * 根据资源md5 查询资源信息
 *
 * @param md5 md5值
 * @return 资源对象
 * @throws Exception
 */
@Cacheable(value = CACHE_KEY, key = "'md5.'+#md5")
@Transactional(readOnly = true)
public Resources selectByMd5(String md5) {
  return this.selectSingle(new QueryParam().where("md5", md5));
}

代码示例来源:origin: org.hsweb/hsweb-web-controller

/**
   * 根据类型查询分类 {@link GenericController#list(QueryParam)}
   *
   * @param type  分类类型
   * @param param 查询参数
   * @return 查询结果
   */
  @RequestMapping(value = "/type/{type}")
  @AccessLogger("根据类别请求")
  public ResponseMessage listByType(@PathVariable("type") String type, QueryParam param) {
    param.where("type", type);
    return list(param);
  }
}

代码示例来源:origin: org.hsweb/hsweb-web-controller

/**
 * 根据类型查询分类 {@link GenericController#list(QueryParam)}
 * 已过时,在正式版中删除 todo
 *
 * @param type  分类类型
 * @param param 查询参数
 * @return 查询结果
 */
@RequestMapping(value = "/byType/{type}")
@Deprecated
@AccessLogger(value = "根据类别请求", describe = "已弃用")
public ResponseMessage listByTypeOld(@PathVariable("type") String type, QueryParam param) {
  param.where("type", type);
  return list(param);
}

代码示例来源:origin: org.hsweb/hsweb-web-service-api

default List<ModuleMeta> selectByKey(String key) {
  QueryParam queryParam = new QueryParam();
  queryParam.where("key", key);
  return this.select(queryParam);
}

代码示例来源:origin: org.hsweb/hsweb-web-service-simple

@Override
  public List<Module> selectByPid(String pid) throws Exception {
    return this.select(new QueryParam().where("parentId", pid));
  }
}

代码示例来源:origin: org.hsweb/hsweb-web-controller

@RequestMapping(value = "/history/{jobId}", method = RequestMethod.GET)
@AccessLogger("执行历史")
@Authorize(action = "history")
public ResponseMessage history(@PathVariable("jobId") String jobId, QueryParam param) {
  param.where("jobId", jobId);
  return ResponseMessage.ok(quartzJobHistoryService.selectPager(param)).onlyData();
}

代码示例来源:origin: org.hsweb/hsweb-web-service-api

default UserProfile selectByUserIdAndType(String userId, String type) {
    return selectSingle(QueryParam.build().where("userId", userId).and("type", type));
  }
}

代码示例来源:origin: org.hsweb/hsweb-web-service-simple

@Override
public String insert(Form data) {
  List<Form> old = this.select(QueryParam.build().where("name", data.getName()));
  Assert.isTrue(old.isEmpty(), "表单 [" + data.getName() + "] 已存在!");
  data.setCreateDate(new Date());
  data.setVersion(1);
  if (StringUtils.isNullOrEmpty(data.getId()))
    data.setId(RandomUtil.randomChar());
  super.insert(data);
  return data.getId();
}

代码示例来源:origin: org.hsweb/hsweb-web-controller

@RequestMapping(value = "/type/{type}", method = RequestMethod.GET)
@AccessLogger("当前用户对应的类型")
public ResponseMessage byLoginUserAndType(@PathVariable("type") String type) {
  User user = WebUtil.getLoginUser();
  // where type=#{type} and (create_id=#{user.id} or sharing=1)
  QueryParam param = QueryParam.build().noPaging();
  param.where("type", type)
      .nest("creatorId", user.getId()).or("sharing", 1);
  return ResponseMessage.ok(queryPlanService.select(param)).onlyData();
}

代码示例来源:origin: org.hsweb/hsweb-web-oauth2-controller

@RequestMapping(value = "/user", method = RequestMethod.GET)
@AccessLogger("获取当前用户持有的客户端信息")
@Authorize
protected ResponseMessage loginUserClient() {
  User user = WebUtil.getLoginUser();
  OAuth2Client client = oAuth2ClientService.selectSingle(QueryParam.build().where("userId", user.getId()));
  if (client == null) {
    throw new NotFoundException("未绑定客户端");
  }
  return ResponseMessage.ok(client);
}

代码示例来源:origin: org.hsweb/hsweb-web-oauth2-controller

@RequestMapping(value = "/secret", method = RequestMethod.PUT)
@AccessLogger("刷新当前用户密钥")
@Authorize
protected ResponseMessage refreshLoginUserSecret() {
  User user = WebUtil.getLoginUser();
  OAuth2Client client = oAuth2ClientService.selectSingle(QueryParam.build().where("userId", user.getId()));
  if (client == null) {
    throw new NotFoundException("未绑定客户端");
  }
  return ResponseMessage.ok(oAuth2ClientService.refreshSecret(client.getId()));
}

代码示例来源:origin: org.hsweb/hsweb-web-service-simple

@Override
public String insert(DynamicScript data) {
  DynamicScript old = selectSingle(QueryParam.build().where("name", data.getName()).and("type", data.getType()));
  if (old != null) throw new BusinessException("已存在相同名称和类型的脚本!", 400);
  data.setStatus(1);
  return super.insert(data);
}

代码示例来源:origin: org.hsweb/hsweb-web-oauth2-controller

String clientSecret = tokenRequest.getClientSecret();
OAuth2Client client = oAuth2ClientService.selectSingle(QueryParam.build()
    .where("id", clientId)
    .and("secret", clientSecret).and("status", 1));

相关文章