Przeglądaj źródła

给跃渊的获取日报的接口编写

wangmiaomiao 9 miesięcy temu
rodzic
commit
b732e0ceff

+ 36 - 0
slibra-admin/src/main/java/com/slibra/web/controller/business/OutController.java

@@ -0,0 +1,36 @@
+package com.slibra.web.controller.business;
+
+
+import com.slibra.business.domain.TXinyiDaily;
+import com.slibra.business.mapper.TXinyiDailyMapper;
+import com.slibra.common.core.domain.AjaxResult;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/out")
+@Slf4j
+public class OutController {
+
+
+    @Autowired
+    private TXinyiDailyMapper xinyiDailyMapper;
+
+    /**
+     * 通过日期获取某天的日报情况
+     * @return
+     */
+    @GetMapping("/getDailyByDate")
+    public AjaxResult recommendQAList(@RequestParam String date)
+    {
+        log.info("进入了 通过日期获取某天的日报情况  接口");
+        List<TXinyiDaily> xinyiDailies = xinyiDailyMapper.selectTXinyiDailyList(TXinyiDaily.builder().testDate(date).build());
+        if(!CollectionUtils.isEmpty(xinyiDailies))
+            return AjaxResult.success(xinyiDailies.get(0));
+        return AjaxResult.error("没有查询到对应的日报数据");
+    }
+}

+ 2 - 2
slibra-framework/src/main/java/com/slibra/framework/config/SecurityConfig.java

@@ -123,8 +123,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                 .antMatchers("/login", "/register", "/captchaImage","/sendSmsCode/*","/smsLogin","/test/**", "/demo/**").permitAll()
                 .antMatchers("/websocket/**").permitAll()//websocket的
-                .antMatchers("/front/**","/grpc/**").permitAll()//临时测试的
-                .antMatchers("/qiniuyun/**").permitAll()//文件上传相关
+//                .antMatchers("/front/**","/grpc/**").permitAll()//临时测试的
+                .antMatchers("/qiniuyun/**", "/out/**").permitAll()//文件上传相关
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

+ 29 - 0
slibra-system/src/main/java/com/slibra/business/res/XinyiDailyForOut.java

@@ -0,0 +1,29 @@
+//package com.slibra.business.res;
+//
+//
+//import lombok.AllArgsConstructor;
+//import lombok.Builder;
+//import lombok.Data;
+//import lombok.NoArgsConstructor;
+//
+//import java.math.BigDecimal;
+//
+//
+///**
+// *
+// * 跃渊的获取日报数据对象
+// *
+// */
+//@Builder
+//@Data
+//@AllArgsConstructor
+//@NoArgsConstructor
+//public class XinyiDailyForOut {
+//
+//
+//
+//
+//
+//
+//
+//}