初始信息
This commit is contained in:
parent
457c5dcb39
commit
2320526d12
@ -4,11 +4,11 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.csg</groupId>
|
<groupId>com.csg</groupId>
|
||||||
<artifactId>ai-china-southern-power-grid</artifactId>
|
<artifactId>china-southern-power-grid</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>ai-china-southern-power-grid</name>
|
<name>china-southern-power-grid</name>
|
||||||
<description>ai-china-southern-power-grid</description>
|
<description>china-southern-power-grid</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.southern.power.grid;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MyBatis-Plus测试应用启动类
|
||||||
|
*
|
||||||
|
* @author jinshan
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class SouthernPowerGridApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(SouthernPowerGridApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
29
src/main/java/com/southern/power/grid/common/Result.java
Normal file
29
src/main/java/com/southern/power/grid/common/Result.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package com.southern.power.grid.common;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Result<T> {
|
||||||
|
private String code;
|
||||||
|
private String message;
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public static <T> Result<T> success(T data) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode("ok");
|
||||||
|
result.setMessage("success");
|
||||||
|
result.setData(data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> error(String message) {
|
||||||
|
return error("error", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> error(String code, String message) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.setCode(code);
|
||||||
|
result.setMessage(message);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.southern.power.grid.controller;
|
||||||
|
|
||||||
|
import com.southern.power.grid.common.Result;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ContentDisposition;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AI问答消息Controller
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
* @date 2025-01-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/ai/message")
|
||||||
|
@Slf4j
|
||||||
|
public class AiMessageController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* demo
|
||||||
|
*/
|
||||||
|
@GetMapping("/report/download/{messageId}")
|
||||||
|
public Result<Boolean> downloadReport() {
|
||||||
|
log.info("download report");
|
||||||
|
return Result.success(Boolean.TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -3,7 +3,7 @@ server:
|
|||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: jinshan-mybatis-test
|
name: china-southern-power-grid
|
||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
Loading…
x
Reference in New Issue
Block a user