dengsixing 1 ay önce
ebeveyn
işleme
afb588ceb5

+ 10 - 6
pom.xml

@@ -96,6 +96,10 @@
                     <groupId>com.alibaba.cloud</groupId>
                     <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
                 </exclusion>
+                <exclusion>
+                    <groupId>org.springframework.plugin</groupId>
+                    <artifactId>spring-plugin-core</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
 
@@ -128,12 +132,6 @@
             <version>1.3.6</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.yomahub</groupId>
-            <artifactId>tlog-feign-spring-boot-starter</artifactId>
-            <version>1.3.6</version>
-        </dependency>
-
         <!--        htt请求工具-->
         <dependency>
             <groupId>com.dtflys.forest</groupId>
@@ -193,6 +191,12 @@
             <version>1.34.0</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <version>2.0.9</version>
+        </dependency>
+
     </dependencies>
 
     <dependencyManagement>

+ 11 - 1
src/main/java/com/fdkankan/deploy/auth/SaTokenConfigure.java

@@ -40,7 +40,17 @@ public class SaTokenConfigure implements WebMvcConfigurer {
     public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(new SaInterceptor(handle -> {
             SaRouterStaff check = SaRouter.match("/**")
-                    .notMatch("/user/login")
+                    .notMatch("/auth/login")
+                    .notMatch("/auth/captcha")
+                    .notMatch("/doc.html")
+                    .notMatch("/swagger-ui.html")
+                    .notMatch("/swagger-resources")
+                    .notMatch("/swagger-ui/**")
+                    .notMatch("/webjars/**")
+                    .notMatch("/favicon.ico")
+                    .notMatch("/v3/api-docs/**")
+                    .notMatch("/v2/api-docs/**")
+                    .notMatch("/wx/**")
                     .check(r -> StpUtil.checkLogin());
         }));
     }

+ 28 - 20
src/main/java/com/fdkankan/deploy/controller/SceneController.java

@@ -1,9 +1,14 @@
 package com.fdkankan.deploy.controller;
 
 
+import cn.dev33.satoken.annotation.SaIgnore;
 import com.fdkankan.deploy.entity.Scene;
+import com.fdkankan.deploy.request.ScenePageRequest;
+import com.fdkankan.deploy.response.PageInfo;
 import com.fdkankan.deploy.service.SceneService;
 import com.fdkankan.web.response.ResultData;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -18,6 +23,7 @@ import java.util.Map;
  * @author 
  * @since 2025-11-05
  */
+@Api(tags = "场景")
 @RestController
 @RequestMapping("/scene")
 public class SceneController {
@@ -25,31 +31,33 @@ public class SceneController {
     @Autowired
     private SceneService sceneService;
 
-    @GetMapping
-    private ResultData test(){
-        return ResultData.ok(sceneService.list());
-    }
+//    @PostMapping("/receive")
+//    public ResultData receive(@RequestBody Map<String, Object> params){
+//        return sceneService.receive(params);
+//    }
+//
+//    @SaIgnore
+//    @PostMapping("/receive2")
+//    public ResultData receive2(HttpServletRequest request) throws Exception {
+//        return sceneService.receive2(request);
+//    }
 
-    @GetMapping("test2")
-    private ResultData test2(){
-        Scene scene = new Scene();
-        scene.setNum("123");
-        scene.setTitle("123");
-        scene.setSpace(123);
-        scene.setUploadTime("123");
-        scene.setShootCount(123);
-        sceneService.save(scene);
-        return ResultData.ok();
+    @SaIgnore
+    @PostMapping("/deploy")
+    public ResultData deploy(HttpServletRequest request) throws Exception {
+        return sceneService.receive3(request);
     }
 
-    @PostMapping("/receive")
-    public ResultData receive(@RequestBody Map<String, Object> params){
-        return sceneService.receive(params);
+    @SaIgnore
+    @GetMapping("/getDeployStatus")
+    public ResultData<Integer> getDeployStatus(String taskId) throws Exception {
+        return sceneService.getDeployStatus(taskId);
     }
 
-    @PostMapping("/receive2")
-    public ResultData receive2(HttpServletRequest request) throws Exception {
-        return sceneService.receive2(request);
+    @ApiOperation(value = "场景列表")
+    @GetMapping("/list")
+    public ResultData<PageInfo<Scene>> listScene(ScenePageRequest request) throws Exception {
+        return ResultData.ok(sceneService.listScene(request));
     }
 
 

+ 16 - 1
src/main/java/com/fdkankan/deploy/controller/UserController.java

@@ -1,12 +1,17 @@
 package com.fdkankan.deploy.controller;
 
 
+import cn.dev33.satoken.annotation.SaIgnore;
+import cn.hutool.core.codec.Base64;
+import cn.hutool.crypto.digest.BCrypt;
 import com.dtflys.forest.annotation.Post;
 import com.fdkankan.deploy.dto.LoginTokenDto;
 import com.fdkankan.deploy.entity.User;
 import com.fdkankan.deploy.request.LoginRequest;
 import com.fdkankan.deploy.service.UserService;
 import com.fdkankan.web.response.ResultData;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -16,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import java.util.Map;
 
 /**
  * <p>
@@ -25,8 +31,9 @@ import javax.servlet.http.HttpSession;
  * @author 
  * @since 2025-11-05
  */
+@Api(tags = "鉴权")
 @RestController
-@RequestMapping("/user")
+@RequestMapping("/auth")
 public class UserController {
 
     private static final String CAPTCHA_KEY = "captchaKey";
@@ -40,6 +47,8 @@ public class UserController {
      * @param request 请求
      * @return 返回token
      */
+    @ApiOperation(value = "登录")
+    @SaIgnore
     @PostMapping("/login")
     public ResultData<LoginTokenDto> login(@RequestBody final LoginRequest request,
                                            HttpServletRequest httpServletRequest) {
@@ -52,5 +61,11 @@ public class UserController {
         return ResultData.ok(tokenDto);
     }
 
+    public static void main(String[] args) {
+        String hashpw = BCrypt.hashpw("123456");
+        System.out.println(hashpw);
+        System.out.println(Base64.encode("123456"));
+    }
+
 }
 

+ 8 - 1
src/main/java/com/fdkankan/deploy/entity/Scene.java

@@ -1,5 +1,7 @@
 package com.fdkankan.deploy.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import lombok.Getter;
@@ -20,6 +22,7 @@ public class Scene implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     private String title;
@@ -30,7 +33,11 @@ public class Scene implements Serializable {
 
     private Integer shootCount;
 
-    private Integer space;
+    private Long space;
+
+    private Integer status;
+
+    private String type;
 
 
 }

+ 41 - 0
src/main/java/com/fdkankan/deploy/entity/SceneReceiveLog.java

@@ -0,0 +1,41 @@
+package com.fdkankan.deploy.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-06
+ */
+@Getter
+@Setter
+@TableName("t_scene_receive_log")
+public class SceneReceiveLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String num;
+
+    private String createTime;
+
+    private String completedTime;
+
+    private String type;
+
+    private Integer status;
+
+    private String taskId;
+
+
+}

+ 107 - 0
src/main/java/com/fdkankan/deploy/exception/ExceptionHandlerConfigure.java

@@ -0,0 +1,107 @@
+package com.fdkankan.deploy.exception;
+
+import cn.dev33.satoken.exception.NotLoginException;
+import cn.dev33.satoken.exception.NotRoleException;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+/**
+ * 异常处理
+ *
+ * @author dhb
+ */
+@RestControllerAdvice
+@Slf4j
+public class ExceptionHandlerConfigure {
+
+    /**
+     * 处理在没有登录请求的异常
+     *
+     * @param exception NotLoginException
+     * @return 返回401的http状态码
+     */
+    @ResponseBody
+    @ExceptionHandler
+    public ResponseEntity<ResultData<String>> handle(NotLoginException exception) {
+        log.debug("", exception);
+        ResultData<String> r = new ResultData<>();
+        r.setCode(HttpStatus.UNAUTHORIZED.value());
+        return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(r);
+    }
+
+    /**
+     * 处理业务异常
+     *
+     * @param exception BizException
+     * @return 返回200的http状态码,body描述异常信息
+     */
+    @ResponseBody
+    @ExceptionHandler
+    public ResultData<Object> handle(BusinessException exception) {
+        return ResultData.error(exception.getCode(), exception.getMessage());
+    }
+
+//    /**
+//     * 处理参数错误的异常
+//     *
+//     * @param exception BadRequestException
+//     * @return 返回400状态码
+//     */
+//    @ResponseBody
+//    @ExceptionHandler
+//    public ResponseEntity<R<String>> handle(BadRequestException exception) {
+//        R<String> r = new R<>();
+//        r.setMessage(exception.getMessage()).setData(null).setCode(HttpStatus.BAD_REQUEST.value());
+//
+//        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(r);
+//    }
+
+
+    /**
+     * 处理参数错误异常
+     *
+     * @param exception ex
+     * @return r
+     */
+    @ResponseBody
+    @ExceptionHandler
+    public ResultData<String> handle(MethodArgumentNotValidException exception) {
+        ObjectError error = exception.getBindingResult().getAllErrors().get(0);
+        String defaultMessage = error.getDefaultMessage();
+        return ResultData.error(ErrorCode.PARAM_ERROR.code(), defaultMessage);
+    }
+
+    @ResponseBody
+    @ExceptionHandler(value = Exception.class)
+    public ResultData<String> handleException(Exception e) {
+        log.error("系统异常", e);
+        return ResultData.error(-1, "系统异常");
+    }
+
+//    /**
+//     * 处理角色无权操作异常
+//     *
+//     * @param exception ex
+//     * @return r
+//     */
+//    @ResponseBody
+//    @ExceptionHandler
+//    public R<String> handle(NotRoleException exception) {
+//        log.debug("当前用户角色无权操作", exception);
+//        BizResponseCode code = BizResponseCode.ERR_11003;
+//        R<String> r = new R<>();
+//        r.setMessage(code.getMsg())
+//                .setCode(code.getCode());
+//        return r;
+//    }
+
+}

+ 1 - 1
src/main/java/com/fdkankan/deploy/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir");
 
         generate(path,"deploy", getTables(new String[]{
-                "t_user"
+                "t_scene_receive_log"
         }));
     }
 

+ 18 - 0
src/main/java/com/fdkankan/deploy/mapper/SceneReceiveLogMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.deploy.mapper;
+
+import com.fdkankan.deploy.entity.SceneReceiveLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-06
+ */
+@Mapper
+public interface SceneReceiveLogMapper extends BaseMapper<SceneReceiveLog> {
+
+}

+ 10 - 0
src/main/java/com/fdkankan/deploy/request/ScenePageRequest.java

@@ -0,0 +1,10 @@
+package com.fdkankan.deploy.request;
+
+import com.fdkankan.web.request.RequestBase;
+import lombok.Data;
+
+@Data
+public class ScenePageRequest extends RequestBase {
+    private String title;
+
+}

+ 16 - 0
src/main/java/com/fdkankan/deploy/service/SceneReceiveLogService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.deploy.service;
+
+import com.fdkankan.deploy.entity.SceneReceiveLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-06
+ */
+public interface SceneReceiveLogService extends IService<SceneReceiveLog> {
+
+}

+ 10 - 0
src/main/java/com/fdkankan/deploy/service/SceneService.java

@@ -2,6 +2,8 @@ package com.fdkankan.deploy.service;
 
 import com.fdkankan.deploy.entity.Scene;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.deploy.request.ScenePageRequest;
+import com.fdkankan.deploy.response.PageInfo;
 import com.fdkankan.web.response.ResultData;
 
 import javax.servlet.http.HttpServletRequest;
@@ -21,4 +23,12 @@ public interface SceneService extends IService<Scene> {
     void donloadAndDeploy();
 
     ResultData receive2(HttpServletRequest request) throws Exception;
+
+    ResultData receive3(HttpServletRequest request) throws Exception;
+
+    PageInfo<Scene> listScene(ScenePageRequest request);
+
+    Scene getByNum(String num, String type);
+
+    ResultData getDeployStatus(String taskId);
 }

+ 20 - 0
src/main/java/com/fdkankan/deploy/service/impl/SceneReceiveLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.deploy.service.impl;
+
+import com.fdkankan.deploy.entity.SceneReceiveLog;
+import com.fdkankan.deploy.mapper.SceneReceiveLogMapper;
+import com.fdkankan.deploy.service.SceneReceiveLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-06
+ */
+@Service
+public class SceneReceiveLogServiceImpl extends ServiceImpl<SceneReceiveLogMapper, SceneReceiveLog> implements SceneReceiveLogService {
+
+}

+ 93 - 3
src/main/java/com/fdkankan/deploy/service/impl/SceneServiceImpl.java

@@ -7,15 +7,24 @@ import cn.hutool.core.util.ZipUtil;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.common.util.DateExtUtil;
 import com.fdkankan.deploy.bean.SceneDeployBean;
 import com.fdkankan.deploy.entity.Scene;
+import com.fdkankan.deploy.entity.SceneReceiveLog;
 import com.fdkankan.deploy.mapper.SceneMapper;
+import com.fdkankan.deploy.request.ScenePageRequest;
+import com.fdkankan.deploy.response.PageInfo;
+import com.fdkankan.deploy.service.SceneReceiveLogService;
 import com.fdkankan.deploy.service.SceneService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.web.response.ResultData;
 import lombok.extern.slf4j.Slf4j;
 import net.lingala.zip4j.core.ZipFile;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -55,6 +64,12 @@ public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements
     @Value("${scene.list-file-path}")
     private String listFilePath;
     private static final String  pattern = "^\\[\\d{2}:\\d{2}:\\d{2}\\]";
+    @Autowired
+    private SceneReceiveLogService sceneReceiveLogService;
+    @Value("${scene.log.path}")
+    private String sceneLogPath;
+
+
 
     @Override
     public ResultData receive(Map<String, Object> params) {
@@ -139,6 +154,64 @@ public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements
     }
 
     @Override
+    public ResultData receive3(HttpServletRequest request) throws Exception {
+        String id = request.getParameter("id");
+        String action = request.getParameter("action");
+        String fileName = request.getParameter("fileName");
+        String num = request.getParameter("num");
+        String zipPath = zipDir + id + "/";
+        String zipFilePath = zipPath.concat(fileName);
+        String zipType = request.getParameter("zipType");
+        String title = request.getParameter("title");
+        String shootCount = request.getParameter("shootCount");
+        SceneReceiveLog sceneReceiveLog = null;
+        try {
+            sceneReceiveLog = sceneReceiveLogService.getOne(new LambdaQueryWrapper<SceneReceiveLog>().eq(SceneReceiveLog::getTaskId, id));
+            if(sceneReceiveLog == null){
+                sceneReceiveLog = new SceneReceiveLog();
+                sceneReceiveLog.setTaskId(id);
+                sceneReceiveLog.setNum(num);
+                sceneReceiveLog.setStatus(CommonSuccessStatus.WAITING.code());
+                sceneReceiveLog.setCreateTime(DateExtUtil.format(new Date(), DateExtUtil.dateStyle));
+                sceneReceiveLog.setType(zipType);
+            }
+
+            if("upload".equals(action)){
+                InputStream ins = request.getPart("file").getInputStream();
+                FileUtil.mkParentDirs(zipFilePath);
+                FileUtil.writeFromStream(ins,zipFilePath);
+            }else{
+                ZipFile zipFile = new ZipFile(new File(zipFilePath));
+                zipFile.extractAll(zipPath);
+                String scenePath = "kankan".equals(zipType) ? delpoyKankan : delpoyLaser;
+                FileUtil.copy(zipPath + num, scenePath, true);
+                Scene scene = lambdaQuery().eq(Scene::getNum, num).eq(Scene::getType, zipType).one();
+                if(scene == null){
+                    scene = new Scene();
+                }
+                scene.setNum(num);
+                scene.setTitle(title);
+                scene.setType(zipType);
+                scene.setStatus(CommonSuccessStatus.SUCCESS.code());
+                scene.setUploadTime(DateExtUtil.format(new Date(), DateExtUtil.dateStyle));
+                scene.setShootCount(Integer.valueOf(shootCount));
+                scene.setSpace(FileUtil.size(new File(scenePath + num)));
+                this.saveOrUpdate(scene);
+
+                sceneReceiveLog.setStatus(CommonSuccessStatus.SUCCESS.code());
+                sceneReceiveLog.setCompletedTime(DateExtUtil.format(new Date(), DateExtUtil.dateStyle));
+
+            }
+        }catch (Exception e){
+            log.error("场景部署失败,num:{}", num, e);
+            sceneReceiveLog.setStatus(CommonSuccessStatus.FAIL.code());
+        }finally {
+            sceneReceiveLogService.saveOrUpdate(sceneReceiveLog);
+        }
+        return ResultData.ok();
+    }
+
+    @Override
     public ResultData receive2(HttpServletRequest request) throws Exception {
         String id = request.getParameter("id");
         String action = request.getParameter("action");
@@ -176,9 +249,6 @@ public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements
         return ResultData.ok();
     }
 
-    @Value("${scene.log.path}")
-    private String sceneLogPath;
-
     private void reWriteLog(String num, String logPath, int time){
         List<String> strings = FileUtil.readLines(logPath, StandardCharsets.UTF_8);
         Date endTime = Calendar.getInstance().getTime();
@@ -271,4 +341,24 @@ public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements
             return false;
         }
     }
+
+    @Override
+    public PageInfo<Scene> listScene(ScenePageRequest request) {
+        Page<Scene> page = lambdaQuery().like(Scene::getTitle, request.getTitle()).page(Page.of(request.getPageNum(), request.getPageSize()));
+        return PageInfo.convert(page);
+    }
+
+    @Override
+    public Scene getByNum(String num, String type) {
+        return lambdaQuery().eq(Scene::getNum, num).eq(Scene::getType, type).one();
+    }
+
+    @Override
+    public ResultData getDeployStatus(String taskId) {
+        SceneReceiveLog one = sceneReceiveLogService.getOne(new LambdaQueryWrapper<SceneReceiveLog>().eq(SceneReceiveLog::getTaskId, taskId));
+        if(one == null){
+            return ResultData.ok(0);
+        }
+        return ResultData.ok(one.getStatus());
+    }
 }

+ 1 - 1
src/main/java/com/fdkankan/deploy/service/impl/UserServiceImpl.java

@@ -32,7 +32,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     public LoginTokenDto login(LoginRequest request) {
         User user = lambdaQuery().eq(User::getUserName, request.getUsername()).one();
         if (user == null) {
-            throw new BusinessException(ErrorCode.NON_TOKEN);
+            throw new BusinessException(ErrorCode.PASSWORD_ERROR);
         }
         // 预览环境下可快速登录,不用验证码
 //        if (Boolean.TRUE.equals(request.getIsQuick()) && Boolean.TRUE.equals(previewProperties.getPreview())) {

+ 63 - 0
src/main/java/com/fdkankan/deploy/swagger/SwaggerConfig.java

@@ -0,0 +1,63 @@
+package com.fdkankan.deploy.swagger;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.service.Parameter;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author qwh
+ * @Date 2024/6/1 0:10
+ */
+@Configuration
+@EnableSwagger2WebMvc
+public class SwaggerConfig {
+    /**
+     * 配置Swagger的Docket Bean,用于定义API的文档信息和扫描的包路径。
+     *
+     * @return Docket 返回配置好的Docket实例
+     */
+    @Bean
+    public Docket adminApiConfig(){
+        // 初始化参数列表
+        List<Parameter> pars = new ArrayList<>();
+        // 创建Docket实例并配置文档信息、包路径选择器、路径选择器等
+        Docket adminApi = new Docket(DocumentationType.SWAGGER_2)
+//                .groupName("adminApi")
+                .apiInfo(adminApiInfo())
+                .select()
+                //扫描的包
+                .apis(RequestHandlerSelectors.basePackage("com.fdkankan.deploy.controller"))
+                // 选择处理admin路径下的API
+                .build()
+                // 全局操作参数设置
+                .globalOperationParameters(pars);
+        return adminApi;
+    }
+
+    /**
+     * 构建后台管理系统API的详细信息
+     *
+     * @return 返回构建好的ApiInfo对象,包含API文档的标题、描述、版本信息以及联系方式
+     */
+    private ApiInfo adminApiInfo(){
+        // 使用ApiInfoBuilder构建API信息
+        return new ApiInfoBuilder()
+                .title("API文档") // 设置文档标题
+                .description("接口定义") // 设置文档描述
+                .version("1.0") // 设置文档版本号
+                .contact(new Contact("username", "http://username.com", "username@gmail.com")) // 设置联系人信息
+                .build(); // 构建并返回ApiInfo对象
+    }
+
+}
+

+ 14 - 0
src/main/resources/application.yml

@@ -1,5 +1,7 @@
 server:
   port: 8080
+  servlet:
+    context-path: /historyrical
 spring:
   application:
     name: 4dkankan-scene-deploy
@@ -54,5 +56,17 @@ scene:
   log:
     path: ${scene.dir}/log/%s.log
 
+sa-token:
+  token-name: token
+  token-prefix:
+  jwt-secret-key: xxx
+knife4j:
+  enable: true
+
+# 不配默认为false
+  tlog:
+    enable-invoke-time-print: true
+
+
 
 

+ 1 - 1
src/main/resources/db/data.sql

@@ -1 +1 @@
-INSERT INTO t_user(user_name, password) VALUES ("admin", "123456");
+INSERT INTO t_user(user_name, password) VALUES ("admin", "$2a$10$8lIldt/6x5Rdy6sNTvFRS.vZ4SaBgmQBh1F7gcYyFUThH/1i.Kwty");

+ 18 - 1
src/main/resources/db/schema.sql

@@ -4,7 +4,9 @@ CREATE TABLE IF NOT EXISTS "t_scene"  (
   "num" TEXT NOT NULL,
   "upload_time" text NOT NULL,
   "shoot_count" integer,
-  "space" integer NOT NULL
+  "space" integer NOT NULL,
+  "type" text NOT NULL,
+  "status" integer NOT NULL
 );
 
 CREATE UNIQUE INDEX IF NOT EXISTS "IDX_NUM"
@@ -26,4 +28,19 @@ CREATE TABLE IF NOT EXISTS "t_user"  (
 CREATE UNIQUE INDEX IF NOT EXISTS "IDX_USERNAME"
 ON "t_user" (
   "user_name"
+);
+
+CREATE TABLE IF NOT EXISTS "t_scene_receive_log"  (
+  "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+  "num" TEXT NOT NULL,
+  "create_time" text NOT NULL,
+  "completed_time" text,
+  "type" text NOT NULL,
+  "status" integer NOT NULL,
+  "task_id" text NOT NULL
+);
+
+CREATE INDEX IF NOT EXISTS"IDX_TASKID"
+ON "t_scene_receive_log" (
+  "task_id"
 );

+ 5 - 0
src/main/resources/mapper/deploy/SceneReceiveLogMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.deploy.mapper.SceneReceiveLogMapper">
+
+</mapper>