Merge remote-tracking branch 'origin/a2'

# Conflicts:
#	.idea/encodings.xml
#	.idea/workspace.xml
#	bwie-modules/pom.xml
pull/1/head
31353 2023-12-17 11:05:06 +08:00
commit 9184f9129e
10 changed files with 253 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package com.bwie.common.domain;
import lombok.Data;
import java.util.Date;
@Data
public class Formation {
private Integer formationId;//用户具体信息表
private Integer formationPress;//血压
private Integer formationSugar;//血糖
private Date formationDate;//加入时间
private String formationAddress;//住址
private Integer userId; //用户Id
private String userName;//用户名
private String userPwd;//密码
private String formationPhone;//手机号
private Integer formationAge; //年龄
private String formationSex;//性别
private String formationName;//昵称
private Integer isDele;
}

View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>
<parent>
<groupId>com.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-formation</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.8</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,13 @@
package com.bwie.formaiton;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan("com.bwie.formaiton.mapper")
public class FormaitonAppliaction {
public static void main(String[] args) {
SpringApplication.run(FormaitonAppliaction.class,args);
}
}

View File

@ -0,0 +1,28 @@
package com.bwie.formaiton.controller;
import com.bwie.common.domain.Formation;
import com.bwie.common.result.Result;
import com.bwie.formaiton.service.FormationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class FormationController {
@Autowired
private FormationService formationService;
@PostMapping("/list")
public Result<List<Formation>> list(){
return formationService.list();
}
@PostMapping("/insert")
public Result<Integer> insert(@RequestBody Formation formation){
return formationService.insert(formation);
}
}

View File

@ -0,0 +1,11 @@
package com.bwie.formaiton.mapper;
import com.bwie.common.domain.Formation;
import java.util.List;
public interface FormationMapper {
List<Formation> list();
Integer insert(Formation formation);
}

View File

@ -0,0 +1,12 @@
package com.bwie.formaiton.service;
import com.bwie.common.domain.Formation;
import com.bwie.common.result.Result;
import java.util.List;
public interface FormationService {
Result<List<Formation>> list();
Result<Integer> insert(Formation formation);
}

View File

@ -0,0 +1,28 @@
package com.bwie.formaiton.service.impl;
import com.bwie.common.domain.Formation;
import com.bwie.common.result.Result;
import com.bwie.formaiton.mapper.FormationMapper;
import com.bwie.formaiton.service.FormationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class FormationServiceImpl implements FormationService {
@Autowired
private FormationMapper formationMapper;
@Override
public Result<List<Formation>> list() {
List<Formation> list = formationMapper.list();
return Result.success(list);
}
@Override
public Result<Integer> insert(Formation formation) {
Integer i = formationMapper.insert(formation);
return Result.success(i);
}
}

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 9002
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-formation
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 122.51.35.58:8848
config:
# 配置中心地址
server-addr: 122.51.35.58:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,13 @@
<?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.bwie.formaiton.mapper.FormationMapper">
<insert id="insert">
INSERT INTO `health`.`formation` (`formation_press`, `formation_sugar`, `formation_date`, `formation_address`, `user_id`, `user_name`, `user_pwd`, `formation_phone`,`formation_age`, `formation_sex`, `formation_name`, `is_dele`) VALUES
(#{formationPress}, #{formationSugar}, now(), #{formationAddress}, #{userId}, #{userName}, #{userPwd}, #{formationPhone},#{formationAge}, #{formationSex}, #{formationName}, 1);
</insert>
<select id="list" resultType="com.bwie.common.domain.Formation">
select * from formation f left join user u on f.user_id=u.id
</select>
</mapper>