12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package com.yihu.jw.controller.base;
- import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
- import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
- import com.yihu.jw.commnon.base.BaseContants;
- import com.yihu.jw.fegin.base.SaasFegin;
- import com.yihu.jw.restmodel.common.Envelop;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.cloud.sleuth.Tracer;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- @RestController
- @RequestMapping(BaseContants.base_common)
- @Api(description = "saas相关")
- public class SaasController {
- private Logger logger= LoggerFactory.getLogger(SaasController.class);
- @Autowired
- private SaasFegin saasFegin;
- @Autowired
- private Tracer tracer;
- @GetMapping(value = BaseContants.Saas.api_getList)
- @ApiOperation(value = "获取saas,不分页")
- @HystrixCommand(commandProperties = {
- @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
- @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
- public Envelop getSaasNoPage(
- @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
- @RequestParam(value = "fields", required = false) String fields,
- @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
- @RequestParam(value = "filters", required = false) String filters,
- @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
- @RequestParam(value = "sorts", required = false) String sorts) {
- return saasFegin.getList(fields, filters, sorts);
- }
- }
|