Commit c25f07fa authored by 赵啸非's avatar 赵啸非

添加资源扫描接口

parent 9f2f3854
...@@ -85,6 +85,11 @@ ...@@ -85,6 +85,11 @@
<artifactId>javase</artifactId> <artifactId>javase</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
......
...@@ -61,6 +61,7 @@ import com.mortals.xhx.module.site.service.SiteService; ...@@ -61,6 +61,7 @@ import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.queue.DefaultTbQueueMsg; import com.mortals.xhx.queue.DefaultTbQueueMsg;
import com.mortals.xhx.queue.TbQueueMsg; import com.mortals.xhx.queue.TbQueueMsg;
import com.mortals.xhx.queue.TbQueueMsgHeaders; import com.mortals.xhx.queue.TbQueueMsgHeaders;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -89,6 +90,7 @@ import static com.mortals.xhx.common.key.RedisKey.KEY_TOKEN_API_CACHE; ...@@ -89,6 +90,7 @@ import static com.mortals.xhx.common.key.RedisKey.KEY_TOKEN_API_CACHE;
@RestController @RestController
@Slf4j @Slf4j
@RequestMapping("/api") @RequestMapping("/api")
@Tag(name ="设备api")
public class DeviceApiController { public class DeviceApiController {
@Autowired @Autowired
private DeviceService deviceService; private DeviceService deviceService;
......
...@@ -9,10 +9,12 @@ import com.mortals.framework.common.Rest; ...@@ -9,10 +9,12 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ILogService; import com.mortals.framework.service.ILogService;
import com.mortals.framework.service.impl.FileLogServiceImpl; import com.mortals.framework.service.impl.FileLogServiceImpl;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.busiz.req.TestReq; import com.mortals.xhx.busiz.req.TestReq;
import com.mortals.xhx.busiz.rsp.ApiResp; import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.busiz.rsp.DeviceResp; import com.mortals.xhx.busiz.rsp.DeviceResp;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.common.utils.ControllerScanUtil;
import com.mortals.xhx.common.utils.ImgUtils; import com.mortals.xhx.common.utils.ImgUtils;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
...@@ -145,11 +147,21 @@ public class TestSendMsgController { ...@@ -145,11 +147,21 @@ public class TestSendMsgController {
public String setData(@PathVariable("key") String key, public String setData(@PathVariable("key") String key,
@PathVariable("value") String value) { @PathVariable("value") String value) {
cacheService.set(key, value); cacheService.set(key, value);
String s =cacheService.get(key); String s = cacheService.get(key);
return s; return s;
} }
@PostMapping("scan")
public String scan() {
List<Class<?>> classList = ControllerScanUtil.getAllClassByPackageName("com.mortals.xhx");
//System.out.println(classList); //获取到了所有的类
List<ResourceEntity> list = ControllerScanUtil.getAnnotationInfo(classList);
return JSON.toJSONString(list);
}
public static void main(String[] args) { public static void main(String[] args) {
String resp = HttpUtil.get("http://59.225.206.13:8331/oauth-pro/admin-pro/sys/randomImage/1675827431800?_t=1675827431"); String resp = HttpUtil.get("http://59.225.206.13:8331/oauth-pro/admin-pro/sys/randomImage/1675827431800?_t=1675827431");
......
...@@ -46,6 +46,14 @@ public class AlarmConfigController extends BaseCRUDJsonBodyMappingController<Ala ...@@ -46,6 +46,14 @@ public class AlarmConfigController extends BaseCRUDJsonBodyMappingController<Ala
super.init(model, context); super.init(model, context);
} }
public static void main(String[] args) {
String input = "example//path//to//file//with/////multiple////slashes//";
// 将多个斜杠替换为单个斜杠
String result = input.replaceAll("/+", "/");
System.out.println("处理前: " + input);
System.out.println("处理后: " + result);
}
} }
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment